Hi,
I'd like to have my deployment defined in a profile:
<profiles>
<profile>
<id>deploy-nightly</id>
<distributionManagement>
<repository>
<id>snapshots</id>
<name>Inhouse Internal Release Repository</name>
<url>http://mspring-lnx:8081/nexus/content/repositories/snapshots</url>
</repository>
</distributionManagement>
</profile>
</profiles>
I run this as
mvn deploy -P deploy-nightly
and I get
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot
be instantiated
While building project with id: my.group:my-pom:pom:1.0-SNAPSHOT
Project File: /auto/cliq/tools/maven/tests/deploy-problem/pom.xml
Please find the full -X output down below.
When I have my distributionManagement element outside of a profile, it
does
work.
What's the problem?
Thanks!
-Max
[DEBUG]
------------------------------------------------------------------------
[DEBUG] Entering lifecycle phase: deploy
[DEBUG]
------------------------------------------------------------------------
[DEBUG] Resolving plugin: org.apache.maven.plugins:maven-deploy-plugin
with version: 2.3
[DEBUG] In verifyVersionedPlugin for:
org.apache.maven.plugins:maven-deploy-plugin
[DEBUG]
org.apache.maven.plugins:maven-deploy-plugin:maven-plugin:2.3:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0:runtime (selected
for runtime)
[DEBUG] org.apache.maven:maven-core:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-settings:jar:2.0:runtime (selected
for runtime)
[DEBUG] org.apache.maven:maven-model:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(selected for runtime)
[DEBUG]
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime
(selected for runtime)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5:runtime
(selected for runtime)
[DEBUG]
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime
(selected for runtime)
[DEBUG]
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:runtime
(selected for runtime)
[DEBUG]
org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5:runtime
(selected for runtime)
[DEBUG]
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime (selected
for runtime)
[DEBUG] doxia:doxia-sink-api:jar:1.0-alpha-4:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-profile:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-model:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-artifact:jar:2.0:runtime (selected
for runtime)
[DEBUG]
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime
(selected for runtime)
[DEBUG]
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime
(selected for runtime)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime (selected
for runtime)
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-error-diagnostics:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-project:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0:runtime
(selected for runtime)
[DEBUG] commons-cli:commons-cli:jar:1.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-plugin-descriptor:jar:2.0:runtime
(selected for runtime)
[DEBUG]
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-monitor:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5:runtime
(selected for runtime)
[DEBUG] com.jcraft:jsch:jar:0.1.23:runtime (selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (selected
for runtime)
[DEBUG] org.apache.maven:maven-project:jar:2.0:runtime (selected for
runtime)
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-artifact:jar:2.0:runtime (selected for
runtime)
[DEBUG] Using the following artifacts for classpath of:
org.apache.maven.plugins:maven-deploy-plugin:maven-plugin:2.3:
[org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5:runtime
commons-cli:commons-cli:jar:1.0:runtime
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime
org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5:runtime
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime
org.apache.maven:maven-plugin-registry:jar:2.0:runtime
junit:junit:jar:3.8.1:runtime
org.apache.maven:maven-core:jar:2.0:runtime
org.apache.maven:maven-repository-metadata:jar:2.0:runtime
org.apache.maven:maven-error-diagnostics:jar:2.0:runtime
org.apache.maven:maven-plugin-api:jar:2.0:runtime
org.apache.maven:maven-project:jar:2.0:runtime
org.apache.maven:maven-model:jar:2.0:runtime
org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5:runtime
org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime
org.apache.maven:maven-profile:jar:2.0:runtime
classworlds:classworlds:jar:1.1-alpha-2:runtime
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:runtime
org.apache.maven:maven-settings:jar:2.0:runtime
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:runtime
org.apache.maven:maven-plugin-descriptor:jar:2.0:runtime
doxia:doxia-sink-api:jar:1.0-alpha-4:runtime
org.apache.maven:maven-artifact:jar:2.0:runtime
org.apache.maven:maven-artifact-manager:jar:2.0:runtime
org.apache.maven:maven-monitor:jar:2.0:runtime
com.jcraft:jsch:jar:0.1.23:runtime]
[DEBUG] Got plugin artifacts:
[org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5:runtime,
commons-cli:commons-cli:jar:1.0:runtime,
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime,
org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5:runtime,
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime,
org.apache.maven:maven-plugin-registry:jar:2.0:runtime,
junit:junit:jar:3.8.1:runtime,
org.apache.maven:maven-core:jar:2.0:runtime,
org.apache.maven:maven-repository-metadata:jar:2.0:runtime,
org.apache.maven:maven-error-diagnostics:jar:2.0:runtime,
org.apache.maven:maven-plugin-api:jar:2.0:runtime,
org.apache.maven:maven-project:jar:2.0:runtime,
org.apache.maven:maven-model:jar:2.0:runtime,
org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5:runtime,
org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime,
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime,
org.apache.maven:maven-profile:jar:2.0:runtime,
classworlds:classworlds:jar:1.1-alpha-2:runtime,
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-settings:jar:2.0:runtime,
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:runtime,
org.apache.maven:maven-plugin-descriptor:jar:2.0:runtime,
doxia:doxia-sink-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-artifact:jar:2.0:runtime,
org.apache.maven:maven-artifact-manager:jar:2.0:runtime,
org.apache.maven:maven-monitor:jar:2.0:runtime,
com.jcraft:jsch:jar:0.1.23:runtime]
[DEBUG] Retrieving realm for plugin with id:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Getting artifacts used in realm for plugin with id:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Returning artifacts:
[org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5:runtime,
commons-cli:commons-cli:jar:1.0:runtime,
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime,
org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5:runtime,
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime,
org.apache.maven:maven-plugin-registry:jar:2.0:runtime,
junit:junit:jar:3.8.1:runtime,
org.apache.maven:maven-core:jar:2.0:runtime,
org.apache.maven:maven-repository-metadata:jar:2.0:runtime,
org.apache.maven:maven-error-diagnostics:jar:2.0:runtime,
org.apache.maven:maven-plugin-api:jar:2.0:runtime,
org.apache.maven:maven-project:jar:2.0:runtime,
org.apache.maven:maven-model:jar:2.0:runtime,
org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5:runtime,
org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime,
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime,
org.apache.maven:maven-profile:jar:2.0:runtime,
classworlds:classworlds:jar:1.1-alpha-2:runtime,
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-settings:jar:2.0:runtime,
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:runtime,
org.apache.maven:maven-plugin-descriptor:jar:2.0:runtime,
doxia:doxia-sink-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-artifact:jar:2.0:runtime,
org.apache.maven:maven-artifact-manager:jar:2.0:runtime,
org.apache.maven:maven-monitor:jar:2.0:runtime,
com.jcraft:jsch:jar:0.1.23:runtime]
for plugin:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Realm for project: my.group:my-pom:pom:1.0-SNAPSHOT not found.
Using container realm instead.
[DEBUG] Retrieving realm for plugin with id:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Setting realm for plugin descriptor:
org.apache.maven.plugins:maven-deploy-plugin:2.3 to:
ClassRealm[/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main,
parent: ClassRealm[plexus.core, parent: null]]
[DEBUG] Getting artifacts used in realm for plugin with id:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Returning artifacts:
[org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5:runtime,
commons-cli:commons-cli:jar:1.0:runtime,
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime,
org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5:runtime,
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime,
org.apache.maven:maven-plugin-registry:jar:2.0:runtime,
junit:junit:jar:3.8.1:runtime,
org.apache.maven:maven-core:jar:2.0:runtime,
org.apache.maven:maven-repository-metadata:jar:2.0:runtime,
org.apache.maven:maven-error-diagnostics:jar:2.0:runtime,
org.apache.maven:maven-plugin-api:jar:2.0:runtime,
org.apache.maven:maven-project:jar:2.0:runtime,
org.apache.maven:maven-model:jar:2.0:runtime,
org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5:runtime,
org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime,
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime,
org.apache.maven:maven-profile:jar:2.0:runtime,
classworlds:classworlds:jar:1.1-alpha-2:runtime,
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-settings:jar:2.0:runtime,
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:runtime,
org.apache.maven:maven-plugin-descriptor:jar:2.0:runtime,
doxia:doxia-sink-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-artifact:jar:2.0:runtime,
org.apache.maven:maven-artifact-manager:jar:2.0:runtime,
org.apache.maven:maven-monitor:jar:2.0:runtime,
com.jcraft:jsch:jar:0.1.23:runtime]
for plugin:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Realm for project: my.group:my-pom:pom:1.0-SNAPSHOT not found.
Using container realm instead.
[DEBUG] Retrieving realm for plugin with id:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Setting realm for plugin descriptor:
org.apache.maven.plugins:maven-deploy-plugin:2.3 to:
ClassRealm[/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main,
parent: ClassRealm[plexus.core, parent: null]]
[DEBUG] Getting artifacts used in realm for plugin with id:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Returning artifacts:
[org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5:runtime,
commons-cli:commons-cli:jar:1.0:runtime,
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime,
org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5:runtime,
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime,
org.apache.maven:maven-plugin-registry:jar:2.0:runtime,
junit:junit:jar:3.8.1:runtime,
org.apache.maven:maven-core:jar:2.0:runtime,
org.apache.maven:maven-repository-metadata:jar:2.0:runtime,
org.apache.maven:maven-error-diagnostics:jar:2.0:runtime,
org.apache.maven:maven-plugin-api:jar:2.0:runtime,
org.apache.maven:maven-project:jar:2.0:runtime,
org.apache.maven:maven-model:jar:2.0:runtime,
org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5:runtime,
org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime,
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime,
org.apache.maven:maven-profile:jar:2.0:runtime,
classworlds:classworlds:jar:1.1-alpha-2:runtime,
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-settings:jar:2.0:runtime,
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:runtime,
org.apache.maven:maven-plugin-descriptor:jar:2.0:runtime,
doxia:doxia-sink-api:jar:1.0-alpha-4:runtime,
org.apache.maven:maven-artifact:jar:2.0:runtime,
org.apache.maven:maven-artifact-manager:jar:2.0:runtime,
org.apache.maven:maven-monitor:jar:2.0:runtime,
com.jcraft:jsch:jar:0.1.23:runtime]
for plugin:
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Looking up mojo
org.apache.maven.plugins:maven-deploy-plugin:2.3:deploy in realm
/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
-
descRealmId=/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main
[DEBUG] Looked up - org.apache.maven.plugin.deploy.deploym...@5b057b -
ClassRealm[/plugins/org.apache.maven.plugins:maven-deploy-plugin:2...@48/thread:main,
parent: ClassRealm[plexus.core, parent: null]]
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-deploy-plugin:2.3:deploy' with basic
configurator -->
[DEBUG] (f) artifact = my.group:my-pom:pom:1.0-SNAPSHOT
[DEBUG] (f) attachedArtifacts = []
[ERROR]
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot
be instantiated
While building project with id: my.group:my-pom:pom:1.0-SNAPSHOT
Project File: /auto/cliq/tools/maven/tests/deploy-problem/pom.xml
Error stacktrace:
org.apache.maven.lifecycle.LifecycleExecutionException:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot
be instantiated
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:557)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:288)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:214)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:172)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:218)
at
org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:899)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
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:597)
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:408)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
Caused by: org.apache.maven.plugin.PluginConfigurationException:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot
be instantiated
at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1367)
at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:899)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:608)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:521)
... 15 more
Caused by:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot
be instantiated
at
org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.instantiateObject(AbstractConfigurationConverter.java:133)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:85)
at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:262)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:140)
at
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:58)
at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1361)
... 18 more
Caused by: java.lang.InstantiationException:
org.apache.maven.artifact.repository.ArtifactRepository
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at
org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.instantiateObject(AbstractConfigurationConverter.java:123)
... 23 more