Thread-safe warning when executing maven parallel build - maven

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.

Related

How can I reduce validation strictness for Maven resolution in Shrinkwrap?

I am using JBoss Shrinkwrap 3.1.4 to resolve dependencies for given Maven coordinates. To achieve this, the following code is doing a fine job in most cases:
var artifacts = Maven.configureResolver()
.withClassPathResolution(false)
.loadPomFromFile(f)
.importCompileAndRuntimeDependencies()
.resolve()
.withTransitivity()
.asResolvedArtifact();
However, in some cases Shrinkwrap is not able to build the POM model and identifies validation problems in the POM file. For example, for javax.mail:mail:1.4.3, I get the following error message:
org.jboss.shrinkwrap.resolver.api.InvalidConfigurationFileException: Found 4 problems while building POM model from /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
1/ [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
2/ [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
3/ [WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. # javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
4/ [ERROR] 'build.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin must be a valid version but is 'RELEASE'. # javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
I am only interested in the dependencies... these problems in the build section (like error 4) are irrelevant for me. I am wondering, if it is somehow possible to reduce validation strictness when processing the POM files (or disable it altogether), but I could not find anything in the APIs.
Any pointer would be appreciated.
best
Sebastian

maven-release-plugin reported not threadsafe during parallel execution

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 ?

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 install beanstalk error

I am starting out with Maven, following a book. I'm using 3.2.1 on Ubuntu. I have run the following commands:
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook
mvn install
I then get a beanstalk error. Essentially, I don't have Amazon credentials. I understand the concepts surrounding Maven. What if I don't want to use Amazon services? Is this really necessary?
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.sonatype.mavenbook.ch03:simple:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 143, 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 simple 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- beanstalk-maven-plugin:0.2.8:expose-security-credentials (expose-security-credentials) # simple ---
[WARNING] FAILURE
java.lang.IllegalArgumentException: Settings for serverId ('aws.amazon.com') not found. See http://beanstalker.ingenieux.com.br/beanstalk-maven-plugin/security.html for more information
You probably used the elasticbeanstalk archetypes. A short reason (as it seems you're just learning Maven) is to edit your pom and remove the <plugin/> sections for br.com.ingenieux groupId.
Hope it helps
For those who care about the little details on why did it fail
Since release 1.3.x (a few weeks ago), we dropped the usage of aws.accessKey and aws.secretKey. The warnings were there for more than two years in fact :)
Reason: Many projects on github were leaking AWS Keys
Instead, set those as environment variables (AWS_ACCESS_KEY_ID) and (AWS_SECRET_ACCESS_KEY) or use encryption - see this doc for an overview

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