You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James Levinson <zi...@gmail.com> on 2007/12/14 07:23:00 UTC
using release plugin with a profile and distributionManagement section
I have been able to use profiles with the standard "mvn deploy", but when I
try to run mvn release:perform (after prepare) I get the error below. My
distributionManagement is inside my profile in my pom, but the plugin can't
seem to find it. Perhaps, I am not understanding the plugin properly. Does
anybody have this working ? Thanks.
==ERROR======================================================================
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for:
org.apache.maven.plugins:maven-deploy-plugin:2.3
check that the following section of the pom.xml is present and correct:
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>repo</id>
<name>Repository Name</name>
<url>scp://host/path/to/repo</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>repo</id>
<name>Repository Name</name>
<url>scp://host/path/to/repo</url>
</snapshotRepository>
</distributionManagement>
Cause: Class 'org.apache.maven.artifact.repository.ArtifactRepository'
cannot be instantiated
==PROFILE======================================================================
<profile>
<id>prod</id>
<build>
<plugins>
<!--do not run junit on the production build-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<activation>
<property>
<name>prod</name>
</property>
</activation>
<!-- only copy a prod snapshot build to the sv domain -->
<distributionManagement>
<repository>
<id>prod-releases</id>
<name>Managed Releases Repository</name>
<url>file:///mnt/code/repository/releases</url>
</repository>
</distributionManagement>
</profile>
==CMDLINE======================================================================
1) mvn deploy -P prod --this works
2) mvn release:perform -P prod --fails
[INFO] Executing: mvn deploy --no-plugin-updates -P prod
-DperformRelease=true
looks right but still fails with same error
3) mvn release:perform -Dprod --fails
[INFO] Executing: mvn deploy --no-plugin-updates -P maestro
-DperformRelease=true
this one defaults out to my settings active profile (this may have something
to do with my issue, not sure?)
4) thinking my activation section was wrong I perused
http://maven.apache.org/guides/introduction/introduction-to-profiles.htmland
decided to change the section to:
<activation>
<property>
<name>env</name>
<value>prod</value>
</property>
</activation>
and call it like thus: mvn release:perform -Denv=prod. Same failure with
"[INFO] Executing: mvn deploy --no-plugin-updates -P prod
-DperformRelease=true" printed.
==STACK======================================================================
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Maven execution
failed, exit code: '1'
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(
DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.jav
a:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:224)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution
failed, exit code: '1'
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(
PerformReleaseMojo.java:106)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:420)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:539)
... 16 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:66)
at
org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(
RunPerformGoalsPhase.java:57)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(
DefaultReleaseManager.java:319)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(
DefaultReleaseManager.java:267)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(
DefaultReleaseManager.java:260)
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(
PerformReleaseMojo.java:102)
... 18 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException:
Maven execution failed, exit code: '1'
at
org.apache.maven.shared.release.exec.ForkedMavenExecutor.executeGoals(
ForkedMavenExecutor.java:103)
at
org.apache.maven.shared.release.exec.ForkedMavenExecutor.executeGoals(
ForkedMavenExecutor.java:121)
at
org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(
AbstractRunGoalsPhase.java:59)
... 23 more
Re: using release plugin with a profile and distributionManagement section
Posted by Wendy Smoak <ws...@gmail.com>.
On Dec 13, 2007 11:23 PM, James Levinson <zi...@gmail.com> wrote:
> I have been able to use profiles with the standard "mvn deploy", but when I
> try to run mvn release:perform (after prepare) I get the error below. My
> distributionManagement is inside my profile in my pom, but the plugin can't
> seem to find it. Perhaps, I am not understanding the plugin properly. Does
> anybody have this working ? Thanks.
...
> 1) mvn deploy -P prod --this works
>
> 2) mvn release:perform -P prod --fails
> [INFO] Executing: mvn deploy --no-plugin-updates -P prod
> -DperformRelease=true
> looks right but still fails with same error
I think it forks executions and does not pass the original parameters through.
Try (something like) -Darguments="-P prod"
http://maven.apache.org/plugins/maven-release-plugin/prepare-mojo.html
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org