[ 
http://jira.codehaus.org/browse/MOJO-844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103434
 ] 

Kevin Conner commented on MOJO-844:
-----------------------------------

Hiya Jaco.

The failure I have fixed in the ESB plugin occurs when you have a pom with a 
packaging type which is different from the artifact extension and the packaging 
type is declared in an extension plugin.

When maven initialises the artifact handler for the packaging artifact it 
queries the ArtifactHandlerManager using the packaging type (jboss-esb in this 
case).  As the extension plugin has still to be configured this does not exist. 
 The consequence of this is that a default artifact handler is created and 
assigned to the packaging artifact.

The default artifact handler is created as DefaultArtifactHandler("jboss-esb"), 
no other information is populated.  When this is queried for the artifact 
extension it will return "jboss-esb" (the type) instead of the actual extension 
("esb").

The result is that the artifact will be placed into the repository with the 
wrong extension.

The workaround for my scenario is to set the artifact handler to the correct 
value at the time the artifact is associated with the project.

The specific part of my patch is in AbstractPackagingMojo and is therefore 
applicable to all subclasses.

            final Artifact artifact = project.getArtifact();
            artifact.setFile( archiveFile );
            artifact.setArtifactHandler( artifactHandler );

I suspect that this dependency issue is related to the above but have not 
investigated.  The comment was to raise the potential connection between this 
and MOJO-449.

> Dependency to project with packaging-type 'jboss-sar' doesn't work
> ------------------------------------------------------------------
>
>                 Key: MOJO-844
>                 URL: http://jira.codehaus.org/browse/MOJO-844
>             Project: Mojo
>          Issue Type: Bug
>          Components: jboss-packaging-maven-plugin
>            Reporter: Christian Presslmayr
>
> Hi!
> In my multi-module environment I have the following problem: 
> - I have several projects, where one is dependent on another one, let's say 
> project B is dependent on A. 
> - Both projects have packaging-type 'jboss-sar'.
> - Project A compiles successfully, also the .sar file is created on mvn 
> install
> - But compile for project B doesn't succeed, because it can't resolve the 
> dependency to project A, i. e. it doesn't find the classes of project A, 
> therefore I get an compile error. I defined this dependency in B's pom.xml as 
> follows:
>     <dependency>
>       <groupId>mygroup</groupId>
>       <artifactId>A</artifactId>
>       <version>${project.version}</version>
>       <type>jboss-sar</type>
>       <scope>provided</scope>
>     </dependency>
> I defined the scope 'provided', because I don't want the dependency to be 
> packed into B's sar-file. But this seems is not the problem, because when 
> omitting the scope, it doesn't work either.
> So it seems to me, that there's something wrong with the dependency mechanism 
> for projects of type jboss-sar.
> Or am I missing some setting? Any help is appreciated!
> Thanks,
> Chris

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to