You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Hewett <ma...@gmail.com> on 2006/07/25 19:15:30 UTC

[m2] Custom built org.apache.maven.plugins.* plugins

I'm having an issue with some custom built plugins - I'm taking a
SNAPSHOT version of a plugin (e.g. maven-jar-plugin-2.1-SNAPSHOT) from
SVN, modifying the version to be a release (e.g. 2.1-417949, using the
svn version for the number) and building the plugin and deploying it
into an in-house remote plugin repository (this is so we can use the
release plugin, which doesn't like SNAPSHOTs).  I have referenced this
plugin repository in our organization POM:

<pluginRepositories>
  <pluginRepository>
    <id>custom</id>
    <name>Custom Built Plugin Repository</name>
    <url>http://my.server.com/maven/custom</url>
    <layout>default</layout>
    <releases>
      <enabled>true</enabled>
      <updatePolicy>daily</updatePolicy>
      <checksumPolicy>warn</checksumPolicy>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

Everything works fine *as long as* this custom build is also installed
in the local repository.  If it is not installed in the local
repository it doesn't seem to download correctly from the remote
custom plugin repository and the build fails.  Also, in my local
repository I am left with just the JAR and not the POM for the plugin.

I can also get this to work if I use our central proxy (using
Proximity) to also proxy this custom repository - I suppose because
then the custom version is in central, as far as mvn knows.  My reason
for not wanting to do this is so that if someone doesn't have their
mirror settings set up to point to our proxy then things should still
work because the custom build is in a specifically defined plugin
repository.  i.e. the "central" mirror contains *only* central
artifacts and nothing else.

So, is there a way to deploy custom builds of
org.apache.maven.plugins.* plugins to an internal remote repository?
I had a search through the archives and it seems that maybe others
have seen this, but previous messages seemed to imply that the issue
was resolved.  Am I just doing something wrong or is there a real
issue here?

Hopefully this makes sense - let me know if I need to clarify anything!

Thanks,
Mark

Here's the partial output from "mvn clean package" on our project that
should use the custom maven-jar-plugin version.  (this is edited a
little to remove company specifics - just paths, URLs etc.)

...
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking
for updates from custom
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking
for updates from central
[DEBUG] maven-jar-plugin: resolved to version 2.1-417949 from repository central
[DEBUG] Trying repository central
Downloading: http://my.server.com/proximity/repository/org/apache/maven/plugins/maven-jar-plugin/2.1-417949/maven-jar-plugin-2.1-417949.pom
[DEBUG] Artifact not found - using stub model: Unable to locate
resource in repository

  org.apache.maven.plugins:maven-jar-plugin:pom:2.1-417949

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  custom (http://my.server.com/maven/custom)

[DEBUG] Using defaults for missing POM
org.apache.maven.plugins:maven-jar-plugin:pom:2.1-417949
[DEBUG] Trying repository fdsecure-custom
Downloading: http://my.server.com/maven/custom/org/apache/maven/plugins/maven-jar-plugin/2.1-417949/maven-jar-plugin-2.1-417949.jar
20K downloaded
[DEBUG]   Artifact resolved
...
[DEBUG] org.apache.maven.plugins:maven-jar-plugin:maven-plugin:2.1-417949:runtime
(selected for runtime)
-----------------------------------------------------
this realm = app0.child-container[org.apache.maven.plugins:maven-jar-plugin]
urls[0] = file:/C:/maven-repo/org/apache/maven/plugins/maven-jar-plugin/2.1-417949/maven-jar-plugin-2.1-417949.jar
Number of imports: 0


this realm = plexus.core.maven
urls[0] = file:/G:/bin/maven-2.0.4/bin/../lib/commons-cli-1.0.jar
urls[1] = file:/G:/bin/maven-2.0.4/bin/../lib/doxia-sink-api-1.0-alpha-7.jar
urls[2] = file:/G:/bin/maven-2.0.4/bin/../lib/jsch-0.1.24.jar
urls[3] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-artifact-2.0.4.jar
urls[4] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-artifact-manager-2.0.4.jar
urls[5] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-core-2.0.4.jar
urls[6] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-error-diagnostics-2.0.4.jar
urls[7] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-model-2.0.4.jar
urls[8] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-monitor-2.0.4.jar
urls[9] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-plugin-api-2.0.4.jar
urls[10] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-plugin-descriptor-2.0.4.jar
urls[11] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-plugin-parameter-documenter-2.0.4.jar
urls[12] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-plugin-registry-2.0.4.jar
urls[13] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-profile-2.0.4.jar
urls[14] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-project-2.0.4.jar
urls[15] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-reporting-api-2.0.4.jar
urls[16] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-repository-metadata-2.0.4.jar
urls[17] = file:/G:/bin/maven-2.0.4/bin/../lib/maven-settings-2.0.4.jar
urls[18] = file:/G:/bin/maven-2.0.4/bin/../lib/plexus-interactivity-api-1.0-alpha-4.jar
urls[19] = file:/G:/bin/maven-2.0.4/bin/../lib/wagon-file-1.0-alpha-7.jar
urls[20] = file:/G:/bin/maven-2.0.4/bin/../lib/wagon-http-lightweight-1.0-alpha-6.jar
urls[21] = file:/G:/bin/maven-2.0.4/bin/../lib/wagon-provider-api-1.0-alpha-6.jar
urls[22] = file:/G:/bin/maven-2.0.4/bin/../lib/wagon-ssh-1.0-alpha-7.jar
urls[23] = file:/G:/bin/maven-2.0.4/bin/../lib/wagon-ssh-external-1.0-alpha-6.jar
Number of imports: 0


this realm = plexus.core
urls[0] = file:/G:/bin/maven-2.0.4/bin/../core/plexus-container-default-1.0-alpha-9.jar
urls[1] = file:/G:/bin/maven-2.0.4/bin/../core/plexus-utils-1.1.jar
Number of imports: 0
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal
'org.apache.maven.plugins:maven-jar-plugin:2.1-417949:jar': Unable to
find the mojo 'org.apache.maven.plugins:maven-jar-plugin:2.1-417949:jar'
in the plugin 'org.apache.maven.plugins:maven-jar-plugin'
org/codehaus/plexus/archiver/AbstractArchiver
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error
in the plugin manager executing goal
'org.apache.maven.plugins:maven-jar-plugin:2.1-417949:jar': Unable to
find the mojo 'org.apache.maven.plugins:maven-jar-plugin:2.1-417949:jar'
in the plugin 'org.apache.maven.plugins:maven-jar-plugin'
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:538)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
        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.PluginManagerException: Unable to
find the mojo 'org.apache.maven.plugins:maven-jar-plugin:2.1-417949:jar'
in the plugin 'org.apache.maven.plugins:maven-jar-plugin'
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:533)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:390)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
        ... 16 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Unable to lookup component
'org.apache.maven.plugin.Mojoorg.apache.maven.plugins:maven-jar-plugin:2.1-417949:jar',
it could not be created
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:524)
        ... 18 more
Caused by: org.codehaus.plexus.component.factory.ComponentInstantiationException:
Could not instanciate component: role:'null', implementation:
'org.apache.maven.plugin.jar.JarMojo'
        at org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
        at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
        at org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
        at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
        ... 20 more
Caused by: java.lang.NoClassDefFoundError:
org/codehaus/plexus/archiver/AbstractArchiver
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
        at java.lang.Class.getConstructor0(Class.java:2640)
        at java.lang.Class.newInstance0(Class.java:321)
        at java.lang.Class.newInstance(Class.java:303)
        at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)
        ... 24 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 3 seconds
[INFO] Finished at: Tue Jul 25 11:53:25 CDT 2006
[INFO] Final Memory: 7M/15M
[INFO] ------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org