You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason Chaffee <ja...@zilliontv.tv> on 2009/02/03 00:12:59 UTC

RE: Issue with ArtifactHandler in reactor builds

I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that has it's own packaging type and creates a file of it's own extension type.  This only happens if I run a reactor build.  If run maven in that project, it works correctly. For example,

<packaging>my-bundle</packaging>

will create artifactId-version.exe

However, with maven-2.0.9 it creates the file correcting in the target directory but it installs it and deploys it as artifactId-version.my-bundle.
Here is an example output:

[INFO] Installing C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe to C:\Documents and Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle

I wrote a similar plugin with a previous company and it worked fine.  That was on maven-2.0.7 though.

Here is my component.xml snippet?
<component-set>
  <components>
     ...
    <component>
      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
      <role-hint>my-bundle</role-hint>
      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
      <configuration>
        <extension>exe</extension>
        <type>my-bundle</type>
        <packaging>my-bundle</packaging>
        <language>java</language>
        <addedToClasspath>true</addedToClasspath>
      </configuration>
    </component>
  </components>
</component-set>

Does anyone have any ideas what could be happening here or have a good way to debug this?



RE: Issue with ArtifactHandler in reactor builds

Posted by Jason Chaffee <ja...@zilliontv.tv>.
Likewise.

These are the type of bugs that really make maven look bad.  I have been promoting maven for well over 5 years now and I am currently converting a new company to maven and we encountered this bug.  It really has turned everyone off on Maven and it is making it an uphill battle to convince them that maven does have benefits.


________________________________________
From: Stuart McCulloch [mcculls@gmail.com]
Sent: Tuesday, February 03, 2009 9:09 PM
To: Maven Developers List
Subject: Re: Issue with ArtifactHandler in reactor builds

2009/2/4 Jason Chaffee <ja...@zilliontv.tv>

> I found a workaround that works, but it really bothers me because there is
> an underlying issue here that is unresolved and could cause any number of
> plugins to not work properly.
>

yep, same here - I really hope it gets fixed sooner rather than later...


> Here is the workaround:
>
> Instead of making a primary artifact, I attach the artifact.
>
>        projectHelper.attachArtifact(project, "exe", null, file);
>        //project.getArtifact().setFile(file);
>
>
> -----Original Message-----
> From: Jason Chaffee [mailto:jason.chaffee@zilliontv.tv]
> Sent: Tuesday, February 03, 2009 12:35 PM
> To: Maven Developers List
> Subject: RE: Issue with ArtifactHandler in reactor builds
>
> FYI, I looked into the workaround that was suggested...resetting the
> extension in the ArtifactHandler.  However, I found that the extension is
> set correctly in both the reactor build and individual project build.  It is
> almost as if there is some code that isn't even using extension, but rather
> using packaging.
>
> -----Original Message-----
> From: Stuart McCulloch [mailto:mcculls@gmail.com]
> Sent: Monday, February 02, 2009 10:46 PM
> To: dev@maven.apache.org
> Subject: Re: Issue with ArtifactHandler in reactor builds
>
> 2009/2/3 Jason Chaffee <ja...@zilliontv.tv>
>
> > I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that
> has
> > it's own packaging type and creates a file of it's own extension type.
>  This
> > only happens if I run a reactor build.  If run maven in that project, it
> > works correctly. For example,
> >
> > <packaging>my-bundle</packaging>
> >
> > will create artifactId-version.exe
> >
> > However, with maven-2.0.9 it creates the file correcting in the target
> > directory but it installs it and deploys it as
> artifactId-version.my-bundle.
> > Here is an example output:
> >
> > [INFO] Installing
> >
> C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe
> > to C:\Documents and
> >
> Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle
> >
> > I wrote a similar plugin with a previous company and it worked fine.
>  That
> > was on maven-2.0.7 though.
> >
> > Here is my component.xml snippet?
> > <component-set>
> >  <components>
> >     ...
> >    <component>
> >      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
> >      <role-hint>my-bundle</role-hint>
> >
> >
>  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
> >      <configuration>
> >        <extension>exe</extension>
> >        <type>my-bundle</type>
> >        <packaging>my-bundle</packaging>
> >        <language>java</language>
> >        <addedToClasspath>true</addedToClasspath>
> >      </configuration>
> >    </component>
> >  </components>
> > </component-set>
> >
> > Does anyone have any ideas what could be happening here or have a good
> way
> > to debug this?
> >
>
> hmm, sounds like http://jira.codehaus.org/browse/MNG-2426 (see also
> MNG-1682)
>
> as a workaround you could try to reset the handler extension in your code
> before
> installing the artifact, but this might require messing around with Maven
> internals
>
> --
> Cheers, Stuart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


--
Cheers, Stuart

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


Re: Issue with ArtifactHandler in reactor builds

Posted by Stuart McCulloch <mc...@gmail.com>.
2009/2/4 Jason Chaffee <ja...@zilliontv.tv>

> I found a workaround that works, but it really bothers me because there is
> an underlying issue here that is unresolved and could cause any number of
> plugins to not work properly.
>

yep, same here - I really hope it gets fixed sooner rather than later...


> Here is the workaround:
>
> Instead of making a primary artifact, I attach the artifact.
>
>        projectHelper.attachArtifact(project, "exe", null, file);
>        //project.getArtifact().setFile(file);
>
>
> -----Original Message-----
> From: Jason Chaffee [mailto:jason.chaffee@zilliontv.tv]
> Sent: Tuesday, February 03, 2009 12:35 PM
> To: Maven Developers List
> Subject: RE: Issue with ArtifactHandler in reactor builds
>
> FYI, I looked into the workaround that was suggested...resetting the
> extension in the ArtifactHandler.  However, I found that the extension is
> set correctly in both the reactor build and individual project build.  It is
> almost as if there is some code that isn't even using extension, but rather
> using packaging.
>
> -----Original Message-----
> From: Stuart McCulloch [mailto:mcculls@gmail.com]
> Sent: Monday, February 02, 2009 10:46 PM
> To: dev@maven.apache.org
> Subject: Re: Issue with ArtifactHandler in reactor builds
>
> 2009/2/3 Jason Chaffee <ja...@zilliontv.tv>
>
> > I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that
> has
> > it's own packaging type and creates a file of it's own extension type.
>  This
> > only happens if I run a reactor build.  If run maven in that project, it
> > works correctly. For example,
> >
> > <packaging>my-bundle</packaging>
> >
> > will create artifactId-version.exe
> >
> > However, with maven-2.0.9 it creates the file correcting in the target
> > directory but it installs it and deploys it as
> artifactId-version.my-bundle.
> > Here is an example output:
> >
> > [INFO] Installing
> >
> C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe
> > to C:\Documents and
> >
> Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle
> >
> > I wrote a similar plugin with a previous company and it worked fine.
>  That
> > was on maven-2.0.7 though.
> >
> > Here is my component.xml snippet?
> > <component-set>
> >  <components>
> >     ...
> >    <component>
> >      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
> >      <role-hint>my-bundle</role-hint>
> >
> >
>  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
> >      <configuration>
> >        <extension>exe</extension>
> >        <type>my-bundle</type>
> >        <packaging>my-bundle</packaging>
> >        <language>java</language>
> >        <addedToClasspath>true</addedToClasspath>
> >      </configuration>
> >    </component>
> >  </components>
> > </component-set>
> >
> > Does anyone have any ideas what could be happening here or have a good
> way
> > to debug this?
> >
>
> hmm, sounds like http://jira.codehaus.org/browse/MNG-2426 (see also
> MNG-1682)
>
> as a workaround you could try to reset the handler extension in your code
> before
> installing the artifact, but this might require messing around with Maven
> internals
>
> --
> Cheers, Stuart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Cheers, Stuart

RE: Issue with ArtifactHandler in reactor builds

Posted by Jason Chaffee <ja...@zilliontv.tv>.
I found a workaround that works, but it really bothers me because there is an underlying issue here that is unresolved and could cause any number of plugins to not work properly.

Here is the workaround:

Instead of making a primary artifact, I attach the artifact.

        projectHelper.attachArtifact(project, "exe", null, file);
        //project.getArtifact().setFile(file);


-----Original Message-----
From: Jason Chaffee [mailto:jason.chaffee@zilliontv.tv]
Sent: Tuesday, February 03, 2009 12:35 PM
To: Maven Developers List
Subject: RE: Issue with ArtifactHandler in reactor builds

FYI, I looked into the workaround that was suggested...resetting the extension in the ArtifactHandler.  However, I found that the extension is set correctly in both the reactor build and individual project build.  It is almost as if there is some code that isn't even using extension, but rather using packaging.

-----Original Message-----
From: Stuart McCulloch [mailto:mcculls@gmail.com]
Sent: Monday, February 02, 2009 10:46 PM
To: dev@maven.apache.org
Subject: Re: Issue with ArtifactHandler in reactor builds

2009/2/3 Jason Chaffee <ja...@zilliontv.tv>

> I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that has
> it's own packaging type and creates a file of it's own extension type.  This
> only happens if I run a reactor build.  If run maven in that project, it
> works correctly. For example,
>
> <packaging>my-bundle</packaging>
>
> will create artifactId-version.exe
>
> However, with maven-2.0.9 it creates the file correcting in the target
> directory but it installs it and deploys it as artifactId-version.my-bundle.
> Here is an example output:
>
> [INFO] Installing
> C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe
> to C:\Documents and
> Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle
>
> I wrote a similar plugin with a previous company and it worked fine.  That
> was on maven-2.0.7 though.
>
> Here is my component.xml snippet?
> <component-set>
>  <components>
>     ...
>    <component>
>      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
>      <role-hint>my-bundle</role-hint>
>
>  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
>      <configuration>
>        <extension>exe</extension>
>        <type>my-bundle</type>
>        <packaging>my-bundle</packaging>
>        <language>java</language>
>        <addedToClasspath>true</addedToClasspath>
>      </configuration>
>    </component>
>  </components>
> </component-set>
>
> Does anyone have any ideas what could be happening here or have a good way
> to debug this?
>

hmm, sounds like http://jira.codehaus.org/browse/MNG-2426 (see also
MNG-1682)

as a workaround you could try to reset the handler extension in your code
before
installing the artifact, but this might require messing around with Maven
internals

--
Cheers, Stuart

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


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


RE: Issue with ArtifactHandler in reactor builds

Posted by Jason Chaffee <ja...@zilliontv.tv>.
FYI, I looked into the workaround that was suggested...resetting the extension in the ArtifactHandler.  However, I found that the extension is set correctly in both the reactor build and individual project build.  It is almost as if there is some code that isn't even using extension, but rather using packaging.

-----Original Message-----
From: Stuart McCulloch [mailto:mcculls@gmail.com]
Sent: Monday, February 02, 2009 10:46 PM
To: dev@maven.apache.org
Subject: Re: Issue with ArtifactHandler in reactor builds

2009/2/3 Jason Chaffee <ja...@zilliontv.tv>

> I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that has
> it's own packaging type and creates a file of it's own extension type.  This
> only happens if I run a reactor build.  If run maven in that project, it
> works correctly. For example,
>
> <packaging>my-bundle</packaging>
>
> will create artifactId-version.exe
>
> However, with maven-2.0.9 it creates the file correcting in the target
> directory but it installs it and deploys it as artifactId-version.my-bundle.
> Here is an example output:
>
> [INFO] Installing
> C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe
> to C:\Documents and
> Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle
>
> I wrote a similar plugin with a previous company and it worked fine.  That
> was on maven-2.0.7 though.
>
> Here is my component.xml snippet?
> <component-set>
>  <components>
>     ...
>    <component>
>      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
>      <role-hint>my-bundle</role-hint>
>
>  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
>      <configuration>
>        <extension>exe</extension>
>        <type>my-bundle</type>
>        <packaging>my-bundle</packaging>
>        <language>java</language>
>        <addedToClasspath>true</addedToClasspath>
>      </configuration>
>    </component>
>  </components>
> </component-set>
>
> Does anyone have any ideas what could be happening here or have a good way
> to debug this?
>

hmm, sounds like http://jira.codehaus.org/browse/MNG-2426 (see also
MNG-1682)

as a workaround you could try to reset the handler extension in your code
before
installing the artifact, but this might require messing around with Maven
internals

--
Cheers, Stuart

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


RE: Issue with ArtifactHandler in reactor builds

Posted by Jason Chaffee <ja...@zilliontv.tv>.
Yep, that is it.  I have the same problem with a servicemix plugin as well.  It must be a bug with some dependency that is used by maven because not everyone is experiencing this behavior.  I have a colleague at a former company that has tried both plugins in his environment with maven-2.0.9 and it works properly for him.

These are rather nasty bugs to deal with in maven because they are so difficult to pinpoint what is going on.  Also, bugs that happen with the reactor, but do not happen when the individual project is built are quite common in maven, from my experience over the last 3 years or so.  These bugs eat up many man hours trying to debug.

We have found that the only way we can be sure that something works in maven is to test not only on an individual project, but a project with at least 3 levels of inheritance.  Also, we need to blow away the local repo and try downloading fresh artifacts to see if downloading new artifacts causes strange behavior.  We have found that if we don't test all 3 scenarios, we can end up with major maven issues that can cost developers many lost days.  Sadly, it makes many people dislike maven and want to go back to ant.  We have taken many precautions, such as locking down plugin versions and using depedencyManagement to control versions of jars, but we still encounter these issues.  Sometimes, I wonder if it is worth it as I spend more time solving maven issues that developing code for my company...sigh

Jason

-----Original Message-----
From: Stuart McCulloch [mailto:mcculls@gmail.com]
Sent: Monday, February 02, 2009 10:46 PM
To: dev@maven.apache.org
Subject: Re: Issue with ArtifactHandler in reactor builds

2009/2/3 Jason Chaffee <ja...@zilliontv.tv>

> I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that has
> it's own packaging type and creates a file of it's own extension type.  This
> only happens if I run a reactor build.  If run maven in that project, it
> works correctly. For example,
>
> <packaging>my-bundle</packaging>
>
> will create artifactId-version.exe
>
> However, with maven-2.0.9 it creates the file correcting in the target
> directory but it installs it and deploys it as artifactId-version.my-bundle.
> Here is an example output:
>
> [INFO] Installing
> C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe
> to C:\Documents and
> Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle
>
> I wrote a similar plugin with a previous company and it worked fine.  That
> was on maven-2.0.7 though.
>
> Here is my component.xml snippet?
> <component-set>
>  <components>
>     ...
>    <component>
>      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
>      <role-hint>my-bundle</role-hint>
>
>  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
>      <configuration>
>        <extension>exe</extension>
>        <type>my-bundle</type>
>        <packaging>my-bundle</packaging>
>        <language>java</language>
>        <addedToClasspath>true</addedToClasspath>
>      </configuration>
>    </component>
>  </components>
> </component-set>
>
> Does anyone have any ideas what could be happening here or have a good way
> to debug this?
>

hmm, sounds like http://jira.codehaus.org/browse/MNG-2426 (see also
MNG-1682)

as a workaround you could try to reset the handler extension in your code
before
installing the artifact, but this might require messing around with Maven
internals

--
Cheers, Stuart

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


Re: Issue with ArtifactHandler in reactor builds

Posted by Stuart McCulloch <mc...@gmail.com>.
2009/2/3 Jason Chaffee <ja...@zilliontv.tv>

> I am having an issue on 2.0.9.  Basicallly, I have a custom plugin that has
> it's own packaging type and creates a file of it's own extension type.  This
> only happens if I run a reactor build.  If run maven in that project, it
> works correctly. For example,
>
> <packaging>my-bundle</packaging>
>
> will create artifactId-version.exe
>
> However, with maven-2.0.9 it creates the file correcting in the target
> directory but it installs it and deploys it as artifactId-version.my-bundle.
> Here is an example output:
>
> [INFO] Installing
> C:\workspace\server\manager\project\bundle\target\project-1.0.0-SNAPSHOT.exe
> to C:\Documents and
> Settings\jason.chaffee\.m2\repository\com\foo\project\project\1.0.0-SNAPSHOT\project-1.0.0-SNAPSHOT.my-bundle
>
> I wrote a similar plugin with a previous company and it worked fine.  That
> was on maven-2.0.7 though.
>
> Here is my component.xml snippet?
> <component-set>
>  <components>
>     ...
>    <component>
>      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
>      <role-hint>my-bundle</role-hint>
>
>  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
>      <configuration>
>        <extension>exe</extension>
>        <type>my-bundle</type>
>        <packaging>my-bundle</packaging>
>        <language>java</language>
>        <addedToClasspath>true</addedToClasspath>
>      </configuration>
>    </component>
>  </components>
> </component-set>
>
> Does anyone have any ideas what could be happening here or have a good way
> to debug this?
>

hmm, sounds like http://jira.codehaus.org/browse/MNG-2426 (see also
MNG-1682)

as a workaround you could try to reset the handler extension in your code
before
installing the artifact, but this might require messing around with Maven
internals

-- 
Cheers, Stuart