jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-2426

Artifact copied to local repository with wrong file extension when using jboss-packaging plugin

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.0.4
  • Fix Version/s: None
  • Component/s: Artifacts and Repositories
  • Labels:
    None
  • Environment:
    jdk 1.5.0_06, maven 2.0.4, jboss-package-maven-plugin 2.0-SNAPSHOT (from mojo-sandbox SVN r2088)
  • Complexity:
    Intermediate

Description

When using the jboss-packaging plugin and setting <packaging> to jboss-sar in my pom, the artifact is copied into the local repository with the wrong file extension (.jboss-sar instead of .sar). The jboss-packaging components.xml has <extension> set to sar. The file in the build target directory has the correct .sar extension.

Here's the relevant excerpt from my pom.xml:

<packaging>jboss-sar</packaging>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-packaging-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<extensions>true</extensions>
...

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    bug.zip
    25/Feb/09 3:02 PM
    32 kB
    Nigel Magnay
    1. File
      bug/.classpath 0.3 kB
    2. File
      __MACOSX/bug/._.classpath 0.2 kB
    3. File
      bug/.DS_Store 6 kB
    4. File
      __MACOSX/bug/._.DS_Store 0.1 kB
    5. File
      bug/.project 0.5 kB
    6. File
      __MACOSX/bug/._.project 0.2 kB
    7. File
      bug/.settings/org.eclipse.jdt.core.prefs 0.2 kB
    8. File
      __MACOSX/.../._org.eclipse.jdt.core.prefs 0.2 kB
    9. File
      bug/.../org.maven.ide.eclipse.prefs 0.3 kB
    10. File
      __MACOSX/.../._org.maven.ide.eclipse.prefs 0.2 kB
    11. File
      __MACOSX/bug/._.settings 0.2 kB
    12. File
      bug/master-pom/.classpath 0.3 kB
    13. File
      __MACOSX/bug/master-pom/._.classpath 0.2 kB
    14. File
      bug/master-pom/.project 0.5 kB
    15. File
      __MACOSX/bug/master-pom/._.project 0.2 kB
    16. File
      bug/.../org.eclipse.jdt.core.prefs 0.2 kB
    17. File
      __MACOSX/.../._org.eclipse.jdt.core.prefs 0.2 kB
    18. File
      bug/.../org.maven.ide.eclipse.prefs 0.3 kB
    19. File
      __MACOSX/.../._org.maven.ide.eclipse.prefs 0.2 kB
    20. File
      __MACOSX/bug/master-pom/._.settings 0.2 kB
    21. XML File
      bug/master-pom/pom.xml 1 kB
    22. XML File
      __MACOSX/bug/master-pom/._pom.xml 0.2 kB
    23. File
      __MACOSX/bug/._master-pom 0.2 kB
    24. XML File
      bug/pom.xml 0.7 kB
    25. XML File
      __MACOSX/bug/._pom.xml 0.2 kB
    26. File
      bug/sar-dep/.classpath 0.7 kB
    27. File
      __MACOSX/bug/sar-dep/._.classpath 0.2 kB
    28. File
      bug/sar-dep/.DS_Store 6 kB
    29. File
      __MACOSX/bug/sar-dep/._.DS_Store 0.1 kB
    30. File
      bug/sar-dep/.project 1 kB
    Showing 30 of 81 items Download Zip
    Show
    Zip Archive
    bug.zip
    25/Feb/09 3:02 PM
    32 kB
    Nigel Magnay
  2. Java Source File
    FrigExtensionMojo.java
    26/Feb/09 3:43 AM
    3 kB
    Nigel Magnay

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-3506 Custom ArtifactHandler not resolved for project when an additional plugin with extensions is defined in parent pom

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Bug - A problem which impairs or prevents the functions of the product. MNG-1682 Plugins do not honor the correct extension when run as a part of a multiproject build

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MJBOSSPACK-5 jboss-sar packaging copies artifact into local repository with .jboss-sar extension

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. MNG-2240 Handling of custom lifecycle artifacts is not working properly

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Fredrik Vraalsen added a comment - 07/Jul/06 11:23 AM

Also reported as http://jira.codehaus.org/browse/MOJO-449

Related to http://jira.codehaus.org/browse/MNG-2240 ?

Show
Fredrik Vraalsen added a comment - 07/Jul/06 11:23 AM Also reported as http://jira.codehaus.org/browse/MOJO-449 Related to http://jira.codehaus.org/browse/MNG-2240 ?
Hide
Permalink
Kenney Westerhof added a comment - 07/Jul/06 1:27 PM

The artifact + ArtifactHandler are created before the project is scanned for plugins,
and before the custom ArtifactHandler is discovered.

It is never updated again after that, resulting in a default artifact handler of type 'jboss-sar',
and getExtension defaults to the type.

It works fine for core plugins since they're in the core components.xml which gets discovered
before any maven project instance and/or artifact is created.

Show
Kenney Westerhof added a comment - 07/Jul/06 1:27 PM The artifact + ArtifactHandler are created before the project is scanned for plugins, and before the custom ArtifactHandler is discovered. It is never updated again after that, resulting in a default artifact handler of type 'jboss-sar', and getExtension defaults to the type. It works fine for core plugins since they're in the core components.xml which gets discovered before any maven project instance and/or artifact is created.
Hide
Permalink
Kenney Westerhof added a comment - 07/Jul/06 1:43 PM

Actually, after the extensions are processed, the artifactHandler is updated on the project,
except that the newly discovered artifact handler is not present in there.

some debug:

+ Error stacktraces are turned on.
Maven version: 2.1-SNAPSHOT
[INFO] Scanning for projects...
No artifact handler for type jboss-sar - using a default handler
java.lang.Throwable
        at org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager.getArtifactHandler(DefaultArtifactHandlerManager.java:42)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:153)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:114)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:108)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createBuildArtifact(DefaultArtifactFactory.java:72)
        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:903)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:754)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:425)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:194)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:580)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:512)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:412)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:338)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:171)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:689)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:372)
        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)
XXXX EXTENSION NULL, USING TYPE: pom (classifier=null, packaging=null)
[INFO] FOUND PLUGIN COMPONENT: org.codehaus.mojo:jboss-packaging-maven-plugin:2.0-SNAPSHOT (org.codehaus.mojo:jboss-packaging-maven-plugin) jar:file:/home/forge/.m2/repository/org/codehaus/mojo/jboss-packaging-maven-plugin/2.0-SNAPSHOT/jboss-packaging-maven-plugin-2.0-S
NAPSHOT.jar!/META-INF/maven/plugin.xml [KEY: org.codehaus.mojo:jboss-packaging-maven-plugin] collector: org.apache.maven.plugin.MavenPluginCollector@17182c1
[INFO] FOUND PLUGIN COMPONENT: org.codehaus.mojo:jboss-packaging-maven-plugin:2.0-SNAPSHOT (org.codehaus.mojo:jboss-packaging-maven-plugin) jar:file:/home/forge/.m2/repository/org/codehaus/mojo/jboss-packaging-maven-plugin/2.0-SNAPSHOT/jboss-packaging-maven-plugin-2.0-S
NAPSHOT.jar!/META-INF/maven/plugin.xml [KEY: org.codehaus.mojo:jboss-packaging-maven-plugin] collector: org.apache.maven.plugin.MavenPluginCollector@18fd984
[INFO] Got 14 ArtifactHandlers from plugin jboss-packaging-maven-plugin
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@12152e6 (packaging: javadoc classifier=javadoc extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@f99ff5 (packaging: jar classifier=null extension=spring)
XXXX EXTENSION NULL, USING TYPE: jar (classifier=null, packaging=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@c9ba38 (packaging: jar classifier=null extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1e859c0 (packaging: ejb classifier=client extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1ded0fd (packaging: jar classifier=tests extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@7a84e4 (packaging: java-source classifier=sources extension=jar)
XXXX EXTENSION NULL, USING TYPE: ejb3 (classifier=null, packaging=ejb3)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1aaa14a (packaging: ejb3 classifier=null extension=ejb3)
XXXX EXTENSION NULL, USING TYPE: ear (classifier=null, packaging=ear)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1430b5c (packaging: ear classifier=null extension=ear)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@74c3aa (packaging: jar classifier=null extension=sar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1e0be38 (packaging: ejb classifier=null extension=jar)
XXXX EXTENSION NULL, USING TYPE: war (classifier=null, packaging=war)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@15c7850 (packaging: war classifier=null extension=war)
XXXX EXTENSION NULL, USING TYPE: par (classifier=null, packaging=par)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@16a9d42 (packaging: par classifier=null extension=par)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@9ed927 (packaging: maven-plugin classifier=null extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@c2a132 (packaging: pom classifier=null extension=pom)
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - testing:jboss-sar-test:jboss-sar:0.1-SNAPSHOT
[INFO]    task-segment: [install]
[INFO] ----------------------------------------------------------------------------

In the [INFO] Handler list the jboss-sar plugin doesn't occur.
Also note the different hashCodes for MavenPluginCollector.

On a side note, when using plexus-1.0-alpha-10-SNAPSHOT (the above is with alpha-9) I continuously get errors for not being able to find
any plugin descriptor - this is because the MavenPluginCollector instance is different in any invocation.
I've tried setting instantiation-stratety to 'once' or 'once-per-session' but that didn't help.
So probably a bug is fixed in plexus alpha-10 that's still in here which causes things to 'work' more or less.

Show
Kenney Westerhof added a comment - 07/Jul/06 1:43 PM Actually, after the extensions are processed, the artifactHandler is updated on the project, except that the newly discovered artifact handler is not present in there. some debug:
+ Error stacktraces are turned on.
Maven version: 2.1-SNAPSHOT
[INFO] Scanning for projects...
No artifact handler for type jboss-sar - using a default handler
java.lang.Throwable
        at org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager.getArtifactHandler(DefaultArtifactHandlerManager.java:42)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:153)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:114)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:108)
        at org.apache.maven.artifact.factory.DefaultArtifactFactory.createBuildArtifact(DefaultArtifactFactory.java:72)
        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:903)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:754)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:425)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:194)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:580)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:512)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:412)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:338)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:171)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:689)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:372)
        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)
XXXX EXTENSION NULL, USING TYPE: pom (classifier=null, packaging=null)
[INFO] FOUND PLUGIN COMPONENT: org.codehaus.mojo:jboss-packaging-maven-plugin:2.0-SNAPSHOT (org.codehaus.mojo:jboss-packaging-maven-plugin) jar:file:/home/forge/.m2/repository/org/codehaus/mojo/jboss-packaging-maven-plugin/2.0-SNAPSHOT/jboss-packaging-maven-plugin-2.0-S
NAPSHOT.jar!/META-INF/maven/plugin.xml [KEY: org.codehaus.mojo:jboss-packaging-maven-plugin] collector: org.apache.maven.plugin.MavenPluginCollector@17182c1
[INFO] FOUND PLUGIN COMPONENT: org.codehaus.mojo:jboss-packaging-maven-plugin:2.0-SNAPSHOT (org.codehaus.mojo:jboss-packaging-maven-plugin) jar:file:/home/forge/.m2/repository/org/codehaus/mojo/jboss-packaging-maven-plugin/2.0-SNAPSHOT/jboss-packaging-maven-plugin-2.0-S
NAPSHOT.jar!/META-INF/maven/plugin.xml [KEY: org.codehaus.mojo:jboss-packaging-maven-plugin] collector: org.apache.maven.plugin.MavenPluginCollector@18fd984
[INFO] Got 14 ArtifactHandlers from plugin jboss-packaging-maven-plugin
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@12152e6 (packaging: javadoc classifier=javadoc extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@f99ff5 (packaging: jar classifier=null extension=spring)
XXXX EXTENSION NULL, USING TYPE: jar (classifier=null, packaging=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@c9ba38 (packaging: jar classifier=null extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1e859c0 (packaging: ejb classifier=client extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1ded0fd (packaging: jar classifier=tests extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@7a84e4 (packaging: java-source classifier=sources extension=jar)
XXXX EXTENSION NULL, USING TYPE: ejb3 (classifier=null, packaging=ejb3)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1aaa14a (packaging: ejb3 classifier=null extension=ejb3)
XXXX EXTENSION NULL, USING TYPE: ear (classifier=null, packaging=ear)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1430b5c (packaging: ear classifier=null extension=ear)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@74c3aa (packaging: jar classifier=null extension=sar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@1e0be38 (packaging: ejb classifier=null extension=jar)
XXXX EXTENSION NULL, USING TYPE: war (classifier=null, packaging=war)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@15c7850 (packaging: war classifier=null extension=war)
XXXX EXTENSION NULL, USING TYPE: par (classifier=null, packaging=par)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@16a9d42 (packaging: par classifier=null extension=par)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@9ed927 (packaging: maven-plugin classifier=null extension=jar)
[INFO]   Handler: org.apache.maven.artifact.handler.DefaultArtifactHandler@c2a132 (packaging: pom classifier=null extension=pom)
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - testing:jboss-sar-test:jboss-sar:0.1-SNAPSHOT
[INFO]    task-segment: [install]
[INFO] ----------------------------------------------------------------------------
In the [INFO] Handler list the jboss-sar plugin doesn't occur. Also note the different hashCodes for MavenPluginCollector. On a side note, when using plexus-1.0-alpha-10-SNAPSHOT (the above is with alpha-9) I continuously get errors for not being able to find any plugin descriptor - this is because the MavenPluginCollector instance is different in any invocation. I've tried setting instantiation-stratety to 'once' or 'once-per-session' but that didn't help. So probably a bug is fixed in plexus alpha-10 that's still in here which causes things to 'work' more or less.
Hide
Permalink
Jason Chaffee added a comment - 05/Feb/09 4:18 PM

I just ran into this same issue with maven-2.0.9

Show
Jason Chaffee added a comment - 05/Feb/09 4:18 PM I just ran into this same issue with maven-2.0.9
Hide
Permalink
Nigel Magnay added a comment - 25/Feb/09 2:47 PM

I just ran into this same issue with maven-2.0.10

Show
Nigel Magnay added a comment - 25/Feb/09 2:47 PM I just ran into this same issue with maven-2.0.10
Hide
Permalink
Nigel Magnay added a comment - 25/Feb/09 3:02 PM

Here is a demonstration project of the bug. It uses SWF and JBoss-SAR, though it seems any combination of external plugins (e.g. cargo uberwar) will have the same problem.

Just do an mvn install from the top level, and observe that what gets deployed to your repo has the extension .jboss-sar, rather than the more correct .sar.

Show
Nigel Magnay added a comment - 25/Feb/09 3:02 PM Here is a demonstration project of the bug. It uses SWF and JBoss-SAR, though it seems any combination of external plugins (e.g. cargo uberwar) will have the same problem. Just do an mvn install from the top level, and observe that what gets deployed to your repo has the extension .jboss-sar, rather than the more correct .sar.
Hide
Permalink
Nigel Magnay added a comment - 25/Feb/09 3:12 PM

I've also now tested it on 2.1.0-M1 - and that disappointingly also fails.
3.0-alpha-2 also fails (hard - it doesn't even create any artifacts at all) - but the 'alpha-2' is the hint here

This is similar to the behaviour I saw in MNG-1682 way back in Nov 2005 (though this bug is getting pretty close to it's 3rd birthday too...) - but I think then it could be produced with only 1 plugin-with-extensions, rather than the 2 here. It's a particularly nasty one, as it's come back to bite after lying dormant because we recently switched to flex-mojos which seems to have re-ignited this bug in our build. It took a few hours to track down why all of a sudden our artefacts were containing old build items (reason - the new ones had the wrong names in the repo, and those artifacts are later re-used in other artifacts further on).

Show
Nigel Magnay added a comment - 25/Feb/09 3:12 PM I've also now tested it on 2.1.0-M1 - and that disappointingly also fails. 3.0-alpha-2 also fails (hard - it doesn't even create any artifacts at all) - but the 'alpha-2' is the hint here This is similar to the behaviour I saw in MNG-1682 way back in Nov 2005 (though this bug is getting pretty close to it's 3rd birthday too...) - but I think then it could be produced with only 1 plugin-with-extensions, rather than the 2 here. It's a particularly nasty one, as it's come back to bite after lying dormant because we recently switched to flex-mojos which seems to have re-ignited this bug in our build. It took a few hours to track down why all of a sudden our artefacts were containing old build items (reason - the new ones had the wrong names in the repo, and those artifacts are later re-used in other artifacts further on).
Hide
Permalink
Jason Chaffee added a comment - 25/Feb/09 4:07 PM

I am of the opinion that this is a bug in Plexus.

I am really perplexed why the maven team chose to use Plexus over more popular, better implemented, and battled tested containers such as Spring and PicoContainer.
Even Bob Lee's Guice, which is a newer entry into DI and IoC would be an improvement. Other Apache projects are built on top of spring (CXF, ServiceMix, Camel), so not sure why maven couldn't be as well.

Show
Jason Chaffee added a comment - 25/Feb/09 4:07 PM I am of the opinion that this is a bug in Plexus. I am really perplexed why the maven team chose to use Plexus over more popular, better implemented, and battled tested containers such as Spring and PicoContainer. Even Bob Lee's Guice, which is a newer entry into DI and IoC would be an improvement. Other Apache projects are built on top of spring (CXF, ServiceMix, Camel), so not sure why maven couldn't be as well.
Hide
Permalink
Nigel Magnay added a comment - 26/Feb/09 3:43 AM

Plexus = Time and energy vampire.

I've attached a mojo that I'm using to work around this - it simply attaches a correctly named artifact if you put something like

<plugin>
<groupId>plexusbraindamage</groupId>
<artifactId>fix-mojo</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>frigextension</goal>
</goals>
<configuration>
<extension>sar</extension>
</configuration>
</execution>
</executions>
</plugin>

in your pom (or whatever you name your copy)

Show
Nigel Magnay added a comment - 26/Feb/09 3:43 AM Plexus = Time and energy vampire. I've attached a mojo that I'm using to work around this - it simply attaches a correctly named artifact if you put something like <plugin> <groupId>plexusbraindamage</groupId> <artifactId>fix-mojo</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>frigextension</goal> </goals> <configuration> <extension>sar</extension> </configuration> </execution> </executions> </plugin> in your pom (or whatever you name your copy)
Hide
Permalink
James Roper added a comment - 04/May/09 8:42 PM

This bug can be worked around in any plugins that experience this problem, by adding something like this (I found this code in the Felix bundle plugin):

Artifact mainArtifact = currentProject.getArtifact();

            // workaround for MNG-1682: force maven to install artifact using the "jar" handler
            mainArtifact.setArtifactHandler( m_artifactHandlerManager.getArtifactHandler( "jar" ) );
Show
James Roper added a comment - 04/May/09 8:42 PM This bug can be worked around in any plugins that experience this problem, by adding something like this (I found this code in the Felix bundle plugin):
Artifact mainArtifact = currentProject.getArtifact();

            // workaround for MNG-1682: force maven to install artifact using the "jar" handler
            mainArtifact.setArtifactHandler( m_artifactHandlerManager.getArtifactHandler( "jar" ) );
Hide
Permalink
Jason Chaffee added a comment - 04/May/09 9:03 PM

James,

How does this work with custom packaging and custom types declared in the component.xml? For example,

<extension>bin</extension>
<type>bin</type>
<packaging>bin-bundle</packaging>

Do I replace "jar" in the above example with "bin" or with "bin-bundle"?

Show
Jason Chaffee added a comment - 04/May/09 9:03 PM James, How does this work with custom packaging and custom types declared in the component.xml? For example, <extension>bin</extension> <type>bin</type> <packaging>bin-bundle</packaging> Do I replace "jar" in the above example with "bin" or with "bin-bundle"?
Hide
Permalink
Johannes Becker added a comment - 29/May/09 2:34 AM

Jason,

another workaround is you reference your ArtifactHandler directly as component. Supposed you defined an ArtifactHandler like this in components.xml:

<component>
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
<role-hint>product</role-hint>
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
<configuration>
<type>product</type>
<includesDependencies>true</includesDependencies>
<language>java</language>
<extension>zip</extension>
<addedToClasspath>false</addedToClasspath>
</configuration>
</component>

then you can reference it from your Mojo with:

/**

  • @component roleHint="product"
    */
    private ArtifactHandler artifactHandler;

And set it to the artifact with:

project.getArtifact().setArtifactHandler(artifactHandler);

Show
Johannes Becker added a comment - 29/May/09 2:34 AM Jason, another workaround is you reference your ArtifactHandler directly as component. Supposed you defined an ArtifactHandler like this in components.xml: <component> <role>org.apache.maven.artifact.handler.ArtifactHandler</role> <role-hint>product</role-hint> <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> <configuration> <type>product</type> <includesDependencies>true</includesDependencies> <language>java</language> <extension>zip</extension> <addedToClasspath>false</addedToClasspath> </configuration> </component> then you can reference it from your Mojo with: /**
  • @component roleHint="product" */ private ArtifactHandler artifactHandler;
And set it to the artifact with: project.getArtifact().setArtifactHandler(artifactHandler);
Hide
Permalink
John Casey added a comment - 30/Jul/09 4:18 PM

See MNG-3506

Show
John Casey added a comment - 30/Jul/09 4:18 PM See MNG-3506

People

  • Assignee:
    John Casey
    Reporter:
    Fredrik Vraalsen
Vote (16)
Watch (16)

Dates

  • Created:
    07/Jul/06 11:21 AM
    Updated:
    30/Jul/09 4:18 PM
    Resolved:
    30/Jul/09 4:18 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.