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] *****************************************************************
Related
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 ?
all:
in my project ,I executed this maven command to analyze it's dependency
mvn dependency:analyze
it shows me the following message:
[INFO] --- maven-dependency-plugin:2.1:analyze (default-cli) # console ---
[WARNING] Used undeclared dependencies found:
[WARNING] org.apache.httpcomponents:httpclient:jar:4.3.3:compile
[WARNING] org.apache.httpcomponents:httpcore:jar:4.3.2:compile
[WARNING] commons-lang:commons-lang:jar:2.6:compile
[WARNING] com.itextpdf:itextpdf:jar:5.5.1:compile
[WARNING] commons-logging:commons-logging:jar:1.0.4:compile
How can I find which file used the specific jar?
commons-logging:commons-logging:jar:1.0.4:compile e.g
What you can do is search for the packages or classes contained within that jar from the Eclipse search in the concerned project
Search>File
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
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.
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-SNAPSHOT.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-SNAPSHOT.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.