I installed latest version of Netbeans (8.0.2) with Maven (4.27.1) installed as a plugin (so by default).
When I try to build latest version of optaplanner (6.3.0) I get exception
Building OptaPlanner examples 6.3.0.Final
------------------------------------------------------------------------
--- maven-enforcer-plugin:1.3.1:enforce (enforce-plugin-versions) # optaplanner-examples ---
--- maven-enforcer-plugin:1.3.1:enforce (enforce-java-version) # optaplanner-examples ---
--- maven-enforcer-plugin:1.3.1:enforce (enforce-maven-version) # optaplanner-examples ---
Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
To build this project Maven 3.2.3 (or greater) is required. Please install it.
------------------------------------------------------------------------
BUILD FAILURE
--------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-maven-version) on project optaplanner-examples: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
What can I do in order to build this project ?
4.27.1 can be a Netbeans Maven Plugin version, but not Maven version (there is no Maven 4 yet). You need to find out in settings what Maven is used and maybe install a new version in your system if you have Maven 2 (instead of 3) installed.
in the setting of intellij there is a option called maven, in which you can set the maven version intellij should use.
As I recall the default ist 3.10 or so but if you have maven installed (with an other version) you can select it in the intellij settings
Related
I am using MacOS and I am using Maven in version 3.8.7. I am using Java in 11.0.17 by Eclipse Temurin.
Somehow, when building a big Maven project, Maven creates resolver-status.properties files that contain invalid characters:
.m2/repository/some-project/1.0-SNAPSHOT/resolver-status.properties:3:\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
.m2/repository/some-project/1.0-SNAPSHOT/resolver-status.properties:4:maven-metadata-willhaben-ne\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
.m2/repository/some-project/1.0-SNAPSHOT/resolver-status.properties:8:maven-metadata-shibboleth-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
A subsequent Maven build is then failing with this error message:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.281 s
[INFO] Finished at: 2023-01-17T09:19:29+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Malformed \uxxxx encoding.
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
The error is happening when I run Maven both with one thread and with multiple threads.
How can I fix my build so that Maven no longer writes \u0000 in resolver-status.properties files?
I know suspect that the broken files get downloaded from Nexus when performing the Maven build anew.
On our CI they are built with a somewhat older Maven version and with multiple threads.
I want to build apache ignite source code with NetBeans IDE 8.2 and maven 3.3.9 in ubuntu 16.04 but when I build it, it encounters the following error:
Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.0.1:flatten (flatten) on project ignite-tools: The plugin org.codehaus.mojo:flatten-maven-plugin:1.0.1 requires Maven version 3.2.5 -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginIncompatibleException
After correcting the problems, you can resume the build with the command
mvn <goals> -rf :ignite-tools
and it is stopped with failure on the "Ignite tools" step.
It is normally built with the terminal command, but I need to build it with IDE.
I've already modified the Maven version, but the same error still appeared.
Just checked: You need to supply updated Maven to Netbeans instead of built-in version.
You have to go Tools -> Options -> Java pane -> Maven tab.
Maven Home: Browse..., choose your own downloaded Maven version directory, since built-in 3.0.2 < 3.2.5. You will have to download a fresh Maven install, I assume you already did.
You also need to choose [x] Skip tests for builds not related to testing, otherwise Apache Ignite will not build for you (running all tests takes 24h or so).
Then you can do Run -> Clean and Build Project, it will build all right.
I am using mvn clean command from the command prompt and build is failing.
Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] Reactor Summary:
[INFO] ABC ......................................... FAILURE [ 2.226 s]
[INFO] BUILD FAILURE
[INFO] Total time: 3.098 s
[INFO] Finished at: 2018-11-16T15:10:36+05:30
[INFO] Final Memory: 12M/153M
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of
its
dependencies could not be resolved: Failed to read artifact descriptor for
org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer
artifact
org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central
(https://repo.maven.apache.org/maven2): Received fatal alert:
protocol_version -
> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions,
please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
But when I am using mvn clean command from inside of eclipse it is building successfully.
[INFO] ---------------------------------------------------------------------
---
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.4.1/maven-clean-plugin-2.4.1.pom (5 KB at 5.2 KB/sec)
-------------------------
[INFO] BUILD SUCCESS
[INFO] Total time: 4.387s
The difference i am able to see is that , in command prompt it is trying to download maven-clean-plugin-2.5 whereas from eclipse it is successfully downloading 2.4.1
But I need to run through 2.5 only .
Can anyone help me on this.
Thanks.
I don't know did you install maven globally. You can try to install maven globally. follow the steps.
Download maven from maven download link
Create or export M2_HOME="MAVEN ROOT LOCATION". Ex. : E:\SoftwareRepo\building tools\apache-maven-3.5.2
Create or export MAVEN bin folder location to PATH variable. For example: E:\SoftwareRepo\building tools\apache-maven-3.5.2\bin
Open terminal or cmd and run mvn --version to confirm maven is installed or not.
You can use this same as with Eclipse.
Then go to eclipse. and setup project.follow this steps
Import existing maven project or create a maven project
Goto project explorer and Right click on your pom.xml
then select Run As maven install.
and then what you want.
Hope it will serve your purpose. You can download a sample spring boot project .
Or you can run a maven project from terminal or cmd. Just goto project root folder and then run a maven task like maven clean install . Happy Coding :)
I downloaded eclipselink from here https://github.com/eclipse/eclipselink.runtime. There are a lot of subprojects in it. Some of them can be built using maven, some with ant and some with gradle.
However, org.eclipse.persistence.core which I want to build is maven project. But when I try to build it (either parent project) I get exception:
Scanning for projects...
Computing target platform for MavenProject: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/jpa/org.eclipse.persistence.jpa.jpql/pom.xml
Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository/ (0B at 0B/s)
Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository
Fetching p2.index from http://download.eclipse.org/releases/luna/ (0B at 0B/s)
Adding repository http://download.eclipse.org/releases/luna
Fetching p2.index from http://download.eclipse.org/releases/luna/201406250900/ (0B at 0B/s)
Fetching p2.index from http://download.eclipse.org/releases/luna/201409261001/ (0B at 0B/s)
Fetching p2.index from http://download.eclipse.org/releases/luna/201501121000/ (0B at 0B/s)
Fetching p2.index from http://download.eclipse.org/releases/luna/201502271000/ (0B at 0B/s)
Resolving dependencies of MavenProject: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/jpa/org.eclipse.persistence.jpa.jpql/pom.xml
Resolving class path of MavenProject: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/jpa/org.eclipse.persistence.jpa.jpql/pom.xml
Computing target platform for MavenProject: org.eclipse.persistence:org.eclipse.persistence.core:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/foundation/org.eclipse.persistence.core/pom.xml
Resolving dependencies of MavenProject: org.eclipse.persistence:org.eclipse.persistence.core:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/foundation/org.eclipse.persistence.core/pom.xml
{osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
Cannot resolve project dependencies:
Software being installed: org.eclipse.persistence.core 2.7.0.qualifier
Missing requirement: org.eclipse.persistence.core 2.7.0.qualifier requires 'bundle org.eclipse.persistence.antlr 3.5.2' but it could not be found
See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
Cannot resolve dependencies of MavenProject: org.eclipse.persistence:org.eclipse.persistence.core:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/foundation/org.eclipse.persistence.core/pom.xml: See log for details -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException
The jar org.eclipse.persistence.antlr 3.5.2 is already in zip I downloaded and there are besides sources of it, which can be built using ant.
And I could add this jar as dependency but I don't think this is the right way - because there are a lot of jars inside this zip file.
Question: how to build it?
Indeed the pom.xml files are misleading, these projects are not Maven projects or - at least - are not meant to be built directly via maven. The whole build is an ant build which makes uses of Maven as a supporting tool because of the need of using Tycho integration.
Looking at the antbuild.xml ant build file, you would see it is invoking Maven via its Java main class (Maven is built in Java and the entry point is an old plain Java main after all): org.codehaus.plexus.classworlds.launcher.Launcher, in its build-core target.
So the workflow is:
Start an ant build, from the root folder, invoking ant -f antbuild.xml
Ant will then invoke Maven builds as nested builds
Nested Maven builds are on multi-module/aggregator projects, which in turn will build several Maven modules (sub-projects), starting form the root/parent Maven pom.xml located under buildsystem/org.eclipse.persistence.parent
Note you would need to have:
Maven 3 to build it, as a prerequisites of the aforementioned parent pom file.
the M2_HOME env variable set, pointing at your maven installation folder
Use Ant 1.9+
However, as part of the minimal set-up, the default build would not run properly (successfully), because of junit missing library, as specified by the echo statement below:
[echo] junit.lib = '${junit.lib}' (if not set tests may not compile; let alone run)
Hence, the minimal invocation would be:
ant -f antbuild.xml -Djunit.lib=<path_to_junit_jar>
For instance, you could directly point to your maven repository as following (which worked for me):
ant -f antbuild.xml -DC:\data\m2\repository\junit\junit\4.12\junit-4.12.jar
alternatively, you can specify the path in the antbuild.properties file, here:
# The directory that holds the oracle-specific jar files.
# You can either put the jars in this directory, or specify your own directory.
junit.lib=../extension.lib.external/junit.jar
The same should also be made for jmockit, otherwise causing some compilation errors, althought not affecting a successful build.
The jmockit.jar property can be set in the antbuild.properties file of the eclipse.moxy.test module, here:
#JMockit
jmockit.jar=jmockit-1.10.jar
Or, again, via command line as per the following example:
ant -f antbuild.xml -Djunit.lib=C:\data\m2\repository\junit\junit\4.12\junit-4.12.jar -Djmockit.jar=C:\data\m2\repository\org\jmockit\jmockit\1.10\jmockit-1.10.jar
The command above gave me a successful build, no compilation errors at all. Only warnings were present concerning usage of deprecated or internal API.
You may use this guide for building EclipseLink.
Some elements may be outdated but you should have no issues.
I have got same type of problem in one project. There was a parent project. There is another project also. But they are dependent on each other. What I have to do to make it runnable is given below.
You must have identify which one need to be build first. Then next, then next. If you have no documentation, then it is tough and time consuming to identify.
Another thing:
The minimum requirement to run EclipseLink 2.7.0 is Java 8. Please ensure that you have Java 8 installed and it's working.
What on earth does this mean? Cant find any help via google.
> mvn release:prepare
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Base 1.0.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.3.2:prepare (default-cli) # base ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.386s
[INFO] Finished at: Tue Oct 08 08:22:46 EST 2013
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project base: You don't have a SNAPSHOT project in the reactor projects list. -> [Help 1]
release:prepare command is supposed to prepare your snapshot project for the release. It sounds like you don't have such a snapshot project.
Here's the full details what it'll do: http://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html
If you're sure you should be releasing, you should be working on a maven module that has version ending with -SNAPSHOT.
Update: like noted by #khmarbaise in the comments, if your release has failed, you should do release:rollback to go back to previous state. Note though that it is not supported if you release through jenkins (jenkins issue), and it won't rollback the tags.
Don't needed manually edit pom.xml.
You can use "mvn versions:set" for batch update, something like this:
mvn versions:set -DnewVersion=1.0.3-SNAPSHOT
I've had the same error with Jenkins. In a previous release, Jenkins updated the version of the POM to a non-snapshot version, but the build failed before Jenkins could set the version to a -SNAPSHOT version again. Afterwards, making a release resulted in the error described above.
Fixing this is easy: just manually change the version of your app in pom.xml to a -SNAPSHOT version.
I know this is an old question but I had this issue recently and I found 2 solutions that others may find useful. I am using bamboo as my CI tool. The issue was that there was an error in the bamboo build leaving bamboo in an incorrect state. It had locally updated my project pom.xml with the new release version but had not checked this into SVN. The two solution that worked for me were:
Either
Delete the bamboo build-dir directory for the project and run the release again: rm -rf /opt/bamboo-home/xml-data/build-dir/PROJECT_NAME-RELEASE-JOB1
OR
Run the maven release from the command line using the following commands:
mvn release:prepare -DignoreSnapshots -Dresume=false
mvn release:perform
No need to update versions manually as that is time consuming, if version change is all you need, there is a different command that only updates the pom versions, just like updating them manually:
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=1.0.XX-SNAPSHOT