maven-release-plugin reported not threadsafe during parallel execution - maven-release-plugin

We have a multi-module maven project in which I'm enabling parallel execution. But when I run the build with the -T option (e.g. mvn -T 2C clean package install), the following warning is reported in the build logs:
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project *
[WARNING] * contains the following plugin(s) that are not marked as *
[WARNING] * #threadSafe to support parallel building. *
[WARNING] * While this /may/ work fine, please look for plugin updates *
[WARNING] * and/or request plugins be made thread-safe. *
[WARNING] * If reporting an issue, report it against the plugin in *
[WARNING] * question, not against maven-core *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked #threadSafe in test-service:
[WARNING] org.apache.maven.plugins:maven-release-plugin:3.0.0-M1
[WARNING] ****************************************************************
As you can see, I have already upgraded to version of maven-release-plugin to 3.0.0-M1, which is the latest version available in my company's nexus repository.
I also checked other documents for parallel execution and list of plugins, but could not find a version for this specific plugin which is thread-safe. Please can anyone advise which version is thread-safe or what else I can do resolve this issue ?

Related

Warning while Building maven project in multiple thread

I am trying to build my maven project in parallel multithread using the command
mvn -T 1C install
but I am getting below warning and the thread in building in single thread. I have checked the documentation for this plugin but i am not getting any help
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project *
[WARNING] * contains the following plugin(s) that have goals not marked *
[WARNING] * as #threadSafe to support parallel building. *
[WARNING] * While this /may/ work fine, please look for plugin updates *
[WARNING] * and/or request plugins be made thread-safe. *
[WARNING] * If reporting an issue, report it against the plugin in *
[WARNING] * question, not against maven-core *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked #threadSafe in Abs Microservice Analytics:
[WARNING] org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.4.RELEASE
[WARNING] Enable debug to see more precisely which goals are not marked #threadSafe.
[WARNING] *****************************************************************

Maven shade plugin overlapping classes vs. dependency plugin omitted for conflict

I'm using the Maven shade plugin, and I get output like the following from mvn package:
[WARNING] kryo-4.0.0.jar, kryo-2.21.jar define 91 overlapping classes:
followed by:
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs.
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
On the other hand, there are many other jars that I would expect to get such warnings for, but I don't. In particular, if I do mvn dependency:tree -Dverbose, I get a lot of output like:
[INFO] | | +- (org.apache.commons:commons-lang3:jar:3.3.2:compile - omitted for conflict with 3.5)
My question is, why do some cases of duplicate classes result only in the "overlapping classes" warnings, while other cases result only in the "omitted for conflict" information messages?
The groupId of kryo changed from version 2.x to 3.x. This means that technically, kryo 4.0.0 and kryo 2.21 are different artifacts for Maven. No dependency mediation occurs, they are just put both on the classpath. This is why the shade plugin complains.

Nexus refusing to download artifacts?

I'm trying to integrate the Atlassian Clover plugin to work with my existing Maven 3 project. I'm also using Nexus 2.6.3. e.g.
mvn clover2:setup test clover2:aggregate clover2:clover
produces the error:
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-clover2-plugin:3.2.0:instrumentInternal (default-cli) on project hpcmom: Execution default-cli of goal com.atlassian.maven.plugins:maven-clover2-plugin:3.2.0:instrumentInternal failed: Plugin com.atlassian.maven.plugins:maven-clover2-plugin:3.2.0 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.ant:ant:jar:1.8.4, com.cenqua.clover:clover:jar:3.2.0: Could not find artifact org.apache.ant:ant:jar:1.8.4 in nexus (http://olympus:8081/nexus/content/groups/public) -> [Help 1]
And this is not true, I can see and download manually the supposedly missing artifacts org.apache.ant:ant:jar:1.8.4 correctly in Central and even from the Remote repository tab view I can also find the needed artifacts.
My build also results in the following errors:
Downloading: http://olympus:8081/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-api/2.2/plexus-compiler-api-2.2.pom
[WARNING] The POM for org.codehaus.plexus:plexus-compiler-api:jar:2.2 is missing, no dependency information available
Downloading: http://olympus:8081/nexus/content/groups/public/org/apache/ant/ant/1.8.4/ant-1.8.4.pom
[WARNING] The POM for org.apache.ant:ant:jar:1.8.4 is missing, no dependency information available
Downloading: http://olympus:8081/nexus/content/groups/public/org/apache/ant/ant-launcher/1.8.4/ant-launcher-1.8.4.pom
[WARNING] The POM for org.apache.ant:ant-launcher:jar:1.8.4 is missing, no dependency information available
Downloading: http://olympus:8081/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting-impl/2.0.5/maven-reporting-impl-2.0.5.pom
[WARNING] The POM for org.apache.maven.reporting:maven-reporting-impl:jar:2.0.5 is missing, no dependency information available
Downloading: http://olympus:8081/nexus/content/groups/public/com/cenqua/clover/clover/3.2.0/clover-3.2.0.pom
[WARNING] The POM for com.cenqua.clover:clover:jar:3.2.0 is missing, no dependency information available
Downloading: http://olympus:8081/nexus/content/groups/public/com/intellij/annotations/9.0.4/annotations-9.0.4.pom
[WARNING] The POM for com.intellij:annotations:jar:9.0.4 is missing, no dependency information available
Downloading: http://olympus:8081/nexus/content/groups/public/org/apache/ant/ant/1.8.4/ant-1.8.4.jar
Downloading: http://olympus:8081/nexus/content/groups/public/com/cenqua/clover/clover/3.2.0/clover-3.2.0.jar
Make sure the Central repository is part of your public group. Check out the configuration and potentially check by browsing the remote repo from within Nexus to make sure no network issue prevents Nexus from connecting to the Central repo to download these jars.
Once you have confirmed force an update since Maven might have cached the fact that components were not found in your local repo. Use
mvn -U clover2:setup test clover2:aggregate clover2:clover

Thread-safe warning when executing maven parallel build

I am running Maven parallel build. I am gettting some warning.
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project *
[WARNING] * contains the following plugin(s) that are not marked as *
[WARNING] * #threadSafe to support parallel building. *
[WARNING] * While this /may/ work fine, please look for plugin updates *
[WARNING] * and/or request plugins be made thread-safe. *
[WARNING] * If reporting an issue, report it against the plugin in *
[WARNING] * question, not against maven-core *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked #threadSafe in my-project:
[WARNING] org.apache.maven.plugins:maven-clean-plugin:2.1.1
[WARNING] org.codehaus.mojo:cobertura-maven-plugin:2.2
[WARNING] ****************************************************************
The build is success. Can some one tell me which version of the following plugins will be threadsafe.
Can I simply ignore this.
org.apache.maven.plugins:maven-clean-plugin:2.5 and org.codehaus.mojo:cobertura-maven-plugin:2.5.2 are both threadsafe (from https://maven.apache.org/plugins/)
Mostly this warning is nothing to worry about, but I recommend using a threadsafe version for your plugins if you are using the parallel build feature.

Maven errors and build faliure

The following problem happened: once i opened Eclipe, all the procects were signed with a red X. Opening the projet tree, there was no error sign in the nodes. Nothig showed me what caused the errors. I could not build the projects. Finally i created a new workspace for Eclipse, checked out the projects from SVN, imported them as Maven projects. (There were two main and several child projects.)
Ther are still two projects showing the red X but not showing what causes the errors. I have tried to refresh, clean in Eclipse. I cannot build the other projects without error either, of course also not the ones with errors. The error message is e.g.:
[WARNING] Some problems were encountered while building the effective model for hu.bz.ikti.insurance:SAMCommon:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # hu.bz.ikti.insurance:InSurance:0.0.1-SNAPSHOT, C:\Dev\workspace\InSurance\pom.xml, line 27, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SAM-függő közös osztályok 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for hu.bz.ikti:common:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.110s
[INFO] Finished at: Fri Jul 12 11:33:33 CEST 2013
[INFO] Final Memory: 4M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SAMCommon: Could not resolve dependencies for project hu.bz.ikti.insurance:SAMCommon:jar:0.0.1-SNAPSHOT: Could not find artifact hu.bz.ikti:common:jar:0.0.1-SNAPSHOT -> [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.
And for the erroneus project part of the message is:
[ERROR] Failed to execute goal on project Service: Could not resolve dependencies for project hu.bz.ikti.insurance:Service:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [org.springframework:spring-context:jar:3.1.2.RELEASE (compile), org.springframework:spring-core:jar:3.1.2.RELEASE (compile), org.springframework:spring-beans:jar:3.1.2.RELEASE (compile), commons-dbcp:commons-dbcp:jar:1.4 (compile), postgresql:postgresql:jar:9.1-901-1.jdbc4 (compile), org.springframework:spring-tx:jar:3.1.2.RELEASE (compile), hu.bz.ikti.insurance:Model:jar:0.0.1-SNAPSHOT (compile), org.springframework:spring-orm:jar:3.1.2.RELEASE (compile), hu.bz.ikti:service-base:jar:0.0.1-SNAPSHOT (compile), org.springframework:spring-test:jar:3.1.2.RELEASE (compile), org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 (compile)]: Failed to read artifact descriptor for hu.bz.ikti.insurance:Model:jar:0.0.1-SNAPSHOT: Could not transfer artifact hu.bz.ikti.insurance:Model:pom:0.0.1-SNAPSHOT from/to ikti (https://fcd3.ikti.hu/artifactory/ext-release-local): Failed to transfer https://fcd3.ikti.hu/artifactory/ext-release-local/hu/bz/ikti/insurance/Model/0.0.1-SNAPSHOT/Model-0.0.1-SNAPSHOT.pom. Error code 409, The repository 'ext-release-local' rejected the artifact 'ext-release-local:hu/bz/ikti/insurance/Model/0.0.1-SNAPSHOT/Model-0.0.1-SNAPSHOT.pom' due to its snapshot/release handling policy. -> [Help 1]
Could anyone please help me?
Edited:
What does it mean:
You are trying to deploy a snapshot version (Model-0.0.1-SNAPSHO‌​T.pom) into a releases-only repository ext-release-local ?
Select a snapshot repository (e.g. ext-snapshot-local) instead of a release one.
Should i change my pom.xml? How? I do not understand how is it possible that it earlier worked but now there is this compilation problem. What else could have been changed? I did not change anythig wih intention.
Edited 2
I also noticed that settings.xml under .m2 folder does not exist. Something really went wrong with Maven.
As #user944849 mentioned, 409 is the important part.
You are trying to deploy a snapshot version (Model-0.0.1-SNAPSHO‌​T.pom) into a releases-only repository ext-release-local, thus the conflict.
Select a snapshot repository (e.g. ext-snapshot-local) instead of a release one.
I stumbled over this post with a slightly different problem: we tried to deploy an artifact artifact-1.2.1.jar to a Snapshot repository and got this error:
org.artifactory.api.repo.exception.RepoRejectException: Cannot deploy file
'artifact-1.2.1.jar'. The repository 'repo_snapshot' rejected the resolution
of an artifact 'repo_snapshot:xxx/artifact/1.2.1/artifact-1.2.1.jar' due to
conflict in the snapshot release handling policy.
Problem for us was that SNAPSHOT was not part of the file name of the artifact, so renaming it to artifact-1.2.1-SNAPSHOT.jar solved the issue.

Resources