I need to be able to run Maven release:prepare / release:perform on an artifact from Jenkins without its JUnit tests running.
Surefire configuration in my test pom.xml
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</execution>
</executions>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</plugin>
Apache’s Surefire documentation suggests using either mvn install -DskipTests or mvn install -Dmaven.test.skip=true. Both work when I run an install:
mvn clean install -Dsurefire.testFailureIgnore=true --show-version --batch-mode -e
But neither argument works when I try them on a release:perform.
I’ve tried the following commands:
mvn -DpreparationGoals=clean release:prepare release:perform -DskipTests -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
I’d expect the tests to be skipped and the release:perform to succeed. Instead, the tests run and fail (see below) causing the entire release:perform to fail.
mvn -DpreparationGoals=clean release:prepare release:perform -Dmaven.test.skip=true -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
I’d expect the tests to be skipped and the release:perform to succeed. Instead, the tests run and fail (see below) causing the entire release:perform to fail.
mvn -DpreparationGoals=clean release:prepare release:perform -Dsurefire.testFailureIgnore=true -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
This isn’t ideal (there’s no need to rerun the JUnit tests since they’ve already been run), but if ignoring the JUnit results allows the release:perform to succeed, that would get us by for now. Instead of ignoring the results, the tests run and still fail, though, causing the entire release:perform to fail.
mvn -DpreparationGoals=clean release:prepare release:perform -fn -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
This isn’t ideal either. It does allow release:perform to complete successfully, but at the expense of end users not being notified if the release:perform fails for other reasons than failed JUnit tests.
Here’s the output from running either release:prepare release:perform -DskipTests or release:prepare release:perform -Dmaven.test.skip=true:
+ mvn -DpreparationGoals=clean release:prepare release:perform -DskipTests -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T11:29:23-06:00)
…
Java version: 1.7.0_71, vendor: Oracle Corporation
…
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-862.11.6.el7.x86_64", arch: "amd64", family: "unix"
[INFO] [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) # TestInvProfileWeb ---
[INFO] [INFO]
[INFO] [INFO] -------------------------------------------------------
[INFO] [INFO] T E S T S
[INFO] [INFO] -------------------------------------------------------
[INFO] [INFO] Running com.investmentprofile.jsf.EndUserBeanTest
[INFO] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.028 s <<< FAILURE! - in com.investmentprofile.jsf.EndUserBeanTest
[INFO] [ERROR] test1(com.investmentprofile.jsf.EndUserBeanTest) Time elapsed: 0.008 s <<< FAILURE!
[INFO] junit.framework.AssertionFailedError
[INFO] at com.investmentprofile.jsf.EndUserBeanTest.test1(Unknown Source)
[INFO]
[INFO] [INFO]
[INFO] [INFO] Results:
[INFO] [INFO]
[INFO] [ERROR] Failures:
[INFO] [ERROR] EndUserBeanTest.test1:48
[INFO] [INFO]
[INFO] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Reactor Summary:
[INFO] [INFO]
[INFO] [INFO] TestInvProfileWebParent ............................ SUCCESS [ 1.622 s]
[INFO] [INFO] TestInvProfileWebClient ............................ SUCCESS [ 8.253 s]
[INFO] [INFO] TestInvProfileWeb .................................. FAILURE [ 5.333 s]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 15.396 s
[INFO] [INFO] Finished at: 2018-10-19T13:40:42-05:00
[INFO] [INFO] Final Memory: 48M/600M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project TestInvProfileWeb: There are test failures.
[INFO] [ERROR]
[INFO] [ERROR] Please refer to /opt/Jenkins/workspace/unk_TestInvProfileWebParent-YI772VMG3PH6E767GSGQFPUMCBV45RSLSRI75337QAZHUOO63NUQ/target/checkout/TestInvProfileWebParent/TestInvProfileWeb/target/surefire-reports for the individual test results.
[INFO] [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[INFO] [ERROR] -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[INFO] [ERROR]
[INFO] [ERROR] After correcting the problems, you can resume the build with the command
[INFO] [ERROR] mvn <goals> -rf :TestInvProfileWeb
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] TestInvProfileWebParent ............................ FAILURE [ 20.071 s]
[INFO] TestInvProfileWebClient ............................ SKIPPED
[INFO] TestInvProfileWeb .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.508 s
[INFO] Finished at: 2018-10-19T13:40:42-05:00
[INFO] Final Memory: 15M/210M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:perform (default-cli) on project TestInvProfileWebParent: Maven execution failed, exit code: '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:perform (default-cli) on project TestInvProfileWebParent: Maven execution failed, exit code: '1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:181)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.runLogic(RunPerformGoalsPhase.java:135)
at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(RunPerformGoalsPhase.java:46)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:429)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:381)
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:177)
... 21 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:394)
at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:110)
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
... 26 more
How can I get Surefire not to run tests during release:perform?
Regards,
M.Manojkumar
First, I agree with the two comments above. That said, the problem is that your '-DskipTests' needs to be passed to the release:perform. You can do that by setting the arguments parameter:
mvn release:perform -Darguments=-DskipTests
Related
I'm trying to install Giraph 1.1 but ran into an issue. According to this thread I should apply a patch to my installation. Unfortunately, my problem stems from that. I downloaded and copied the .patch file linked in there to the source folder and added the following to the pom.xml:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-patch-plugin</artifactId>
<version>1.2</version>
<configuration>
<patches>
<patch>GIRAPH-1110.02.patch</patch>
</patches>
...
</plugins>
Unfortunately when I run Maven with:
sudo mvn -Phadoop_yarn -Dhadoop.version=2.8.1 clean package -DskipTests
it still fails with the same error as it did before:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /usr/local/giraph/giraph-core/target/munged/main/org/apache/giraph/job/GiraphJob.java:[213,11] setPingInterval(org.apache.hadoop.conf.Configuration,int) is not public in org.apache.hadoop.ipc.Client; cannot be accessed from outside package
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Giraph Parent ............................... SUCCESS [ 6.298 s]
[INFO] Apache Giraph Core ................................. FAILURE [ 9.359 s]
[INFO] Apache Giraph Examples ............................. SKIPPED
[INFO] Apache Giraph Distribution ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.062 s
[INFO] Finished at: 2018-02-06T22:53:00+02:00
[INFO] Final Memory: 51M/640M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project giraph-core: Compilation failure
[ERROR] /usr/local/giraph/giraph-core/target/munged/main/org/apache/giraph/job/GiraphJob.java:[213,11] setPingInterval(org.apache.hadoop.conf.Configuration,int) is not public in org.apache.hadoop.ipc.Client; cannot be accessed from outside package
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
which clearly shows that the issue has not been patched. When I check the file manually, I can confirm that there's no change. If I change the file manually before compilation, the changes get discarded (I'm guessing the file gets redownloaded). Also can't run the installation with offline flag since it depends on downloading some dependencies. I'm at my wits end here.
My Maven version is 3.3.9.
I am trying to compile some of the maven reversions project. Unfortunately, I am getting error:
Failed to execute goal org.apache.rat:apache-rat-plugin:0.10:check (check) on project maven: Too many files with unapproved license: 2 See RAT report
As someone suggest to skip the checking, so I am using the commands
mvn -X -Drat.skip=true compile
mvn -X -Drat.skip=true test-compile
I also tried
-Drat.numUnapprovedLicense=100
-Dlicense.skip=true
-Drat.ignoreErrors=true
Using the skip worked for few reversion but now I am still getting this error even with using the skip.
This is the stack-trace:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Apache Maven
[INFO] Maven Model
[INFO] Maven Artifact
[INFO] Maven Plugin API
[INFO] Maven Model Builder
[INFO] Maven Settings
[INFO] Maven Settings Builder
[INFO] Maven Repository Metadata Model
[INFO] Maven Aether Provider
[INFO] Maven Core
[INFO] Maven Compat
[INFO] Maven Embedder
[INFO] Apache Maven Distribution
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Maven 3.2.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-bytecode-version) # maven ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ban-known-bad-maven-versions) # maven ---
[INFO]
[INFO] --- apache-rat-plugin:0.10:check (check) # maven ---
[INFO] 63 implicit excludes (use -debug for more details).
[INFO] Exclude: src/test/resources*/**
[INFO] Exclude: src/test/projects/**
[INFO] Exclude: src/test/remote-repo/**
[INFO] Exclude: **/*.odg
[INFO] Exclude: bootstrap/**
[INFO] Exclude: README.bootstrap.txt
[INFO] Exclude: .repository/**
[INFO] Exclude: .maven/spy.log
[INFO] 12 resources included (use -debug for more details)
Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Compiler warnings:
WARNING: 'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
Warning: org.apache.xerces.parsers.SAXParser: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
Warning: org.apache.xerces.parsers.SAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
Warning: org.apache.xerces.parsers.SAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[INFO] Rat check: Summary of files. Unapproved: 2 unknown: 2 generated: 0 approved: 6 licence.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Maven ....................................... FAILURE [ 0.725 s]
[INFO] Maven Model ........................................ SKIPPED
[INFO] Maven Artifact ..................................... SKIPPED
[INFO] Maven Plugin API ................................... SKIPPED
[INFO] Maven Model Builder ................................ SKIPPED
[INFO] Maven Settings ..................................... SKIPPED
[INFO] Maven Settings Builder ............................. SKIPPED
[INFO] Maven Repository Metadata Model .................... SKIPPED
[INFO] Maven Aether Provider .............................. SKIPPED
[INFO] Maven Core ......................................... SKIPPED
[INFO] Maven Compat ....................................... SKIPPED
[INFO] Maven Embedder ..................................... SKIPPED
[INFO] Apache Maven Distribution .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.936 s
[INFO] Finished at: 2017-08-12T15:23:22-07:00
[INFO] Final Memory: 17M/277M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.10:check (check) on project maven: Too many files with unapproved license: 2 See RAT report in: /tmp/12311_1502575092/target/rat.txt -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.rat:apache-rat-plugin:0.10:check (check) on project maven: Too many files with unapproved license: 2 See RAT report in: /tmp/12311_1502575092/target/rat.txt
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.rat.mp.RatCheckException: Too many files with unapproved license: 2 See RAT report in: /tmp/12311_1502575092/target/rat.txt
at org.apache.rat.mp.RatCheckMojo.check(RatCheckMojo.java:183)
at org.apache.rat.mp.RatCheckMojo.execute(RatCheckMojo.java:171)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[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/MojoFailureException
Any suggestion to solve this error.
Thank you
Below command worked in my case.
mvn clean install -Drat.numUnapprovedLicenses=100
I am trying to execute this :
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT"
but it shows this error:
C:\TPMaven>mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.090 s
[INFO] Finished at: 2015-04-20T17:28:05+00:00
[INFO] Final Memory: 5M/108M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\TPMaven). Please verify you invoked Maven from the correct directory. -> [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]
What's wrong with my maven statement?
The right code should be:
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple -DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
If you use Win, running the code above in cmd.exe is ok.
If you run the code in PowerShell, please use the code below:
mvn archetype:generate "-DgroupId=org.sonatype.mavenbook.simple" "-DartifactId=simple" "-DpackageName=org.sonatype.mavenbook" "-Dversion=1.0-SNAPSHOT"
There are two errors in your code:
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT"
- DpackageName
should be
-DpackageName
-Dversion=1.0-SNAPSHOT"
should be
-Dversion=1.0-SNAPSHOT
There is a space in between one of your command line arguments. Running your command:
acanby#PANAMERA /c/projects/mvntest $ mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.072 s
[INFO] Finished at: 2015-04-21T15:20:41+10:00
[INFO] Final Memory: 5M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (c:\projects\mvntest). Please verify you invoked Maven from the correct directory
. -> [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]
[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/MissingProjectException
Fixing the - DpackageName=... part to -DpackageName=...:
acanby#host /c/projects/mvntest$ mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple -DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Interactive mode
I've a fully working project that use version 1.1 of tomcat maven plugin. I tried to switch to the last maven tomcat plugin version, specifying in the pom.xml:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<contextFile>src/main/webapp/META-INF/context.xml</contextFile>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
</dependencies>
</plugin>
However launching the project with tomcat7:run instead of tomcat:run i get the following error:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building group-organizer-server 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.0:run (default-cli) # group-organizer-server >>>
[INFO]
[INFO] --- aspectj-maven-plugin:1.2:compile (default) # group-organizer-server ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # group-organizer-server ---
[debug] execute contextualize
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # group-organizer-server ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.0:run (default-cli) # group-organizer-server <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.0:run (default-cli) # group-organizer-server ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/10/maven-parent-10.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:03.805s
[INFO] Finished at: Mon Nov 05 18:18:32 CET 2012
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:run (default-cli) on project group-organizer-server: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:run failed: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.0 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.0 (): Failed to read artifact descriptor for org.apache.maven.doxia:doxia-sink-api:jar:1.0: Could not transfer artifact org.apache.maven:maven-parent:pom:10 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 -> [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]
[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
How can i fix this?
It looks maven central had some issues yesterday.
So try again with -U
I have following settings in POM file.But my build script fails with 'SVN file locked' message.Is there any other way to do conditional checkout.If project is already checked out then I want to update only otherwise if project is not checkedout it should check out the code and should not update it.Thanks in advance.
<!-- Initial check out of (will not do anything if directory already there) -->
<execution>
<id>check-out-project</id>
<phase>generate-sources</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<checkoutDirectory>${project.build.directory}/project</checkoutDirectory>
<connectionUrl>scm:svn:http://XX:XX/svn/repos/${XX}</connectionUrl>
<username>${svn.username}</username>
<password>${svn.password}</password>
<skipCheckoutIfExists>true</skipCheckoutIfExists>
</configuration>
</execution>
<!-- Update project (if directory was already there) -->
<execution>
<id>update-project</id>
<phase>generate-sources</phase>
<goals>
<goal>update</goal>
</goals>
<configuration>
<basedir>${project.build.directory}/project</basedir>
<connectionUrl>scm:svn:http://XXX:XXX/svn/repos/${project}</connectionUrl>
<username>${svn.username}</username>
<password>${svn.password}</password>
<revisionKey>project.revision</revisionKey>
</configuration>
</execution>
Error log after running maven (Please note I have replaced directory paths and urls with xxxx)
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxxxx.and.xxxxxx 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-xxxxxx-xxxxxx) # xxxxxx.and.
xxxxxx ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-sat) # xxxxxx.and.xxxxxx ---
[INFO]
[INFO] --- maven-scm-plugin:1.4:checkout (check-out-xxxxxx) # xxxxxx.and.xxxxxx --
-
[INFO] Removing x:\xxxx\xxxx\target\xxxxxx
[INFO] Executing: cmd.exe /X /C "svn --username xxxx --password ***** --no-aut
h-cache --non-interactive checkout http://xxxx:xxx/svn/repos/xxxx/xxx x:\
projects\xxxx\target\xxxxxx"
[INFO] Working directory: x:\xxxx\xxxx\target
[INFO]
[INFO] --- maven-scm-plugin:1.4:update (update-xxxxxx) # xxxxxx.and.xxxxxx ---
[INFO] Executing: cmd.exe /X /C "svn --username xxxx --password ***** --no-aut
h-cache --non-interactive update x:\xxxx\xxx\target\xxxxxx"
[INFO] Working directory: x:\xxx\xxx\target\xxxxxx
[INFO] Svn command failed due to some locks in working copy. We try to run a 'sv
n cleanup'.
[INFO] Executing: cmd.exe /X /C "svn"
[INFO] Working directory: x:\xxx\xxxx\target\xxxxxx
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: Working copy 'x:\xxxx\xxxx\target\xxxxxx' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
Type 'svn help' for usage.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8:03.303s
[INFO] Finished at: Thu Apr 28 17:24:50 BST 2011
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.4:upd
ate (update-xxxxxx) on project xxxxxx.and.xxxxxx: Command failed.The svn command f
ailed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
First run
mvn clean
After this run
mvn scm:update