Is there any merit to the idea of having a configuration option in 
maven-war-plugin to include attached artifacts in the webapp in the same way it 
includes dependent artifacts?

-Richard

-----Original Message-----
From: Mirko Friedenhagen [mailto:[email protected]] 
Sent: Tuesday, August 20, 2013 6:20 AM
To: Maven Users List
Subject: RE: artifact attached by plugin not appearing in subsequent plugins

Richard,

AFAIK attachArtifact just tells Maven to install an additional binary to it's 
local cache resp. to deploy it to the distribution repository.

What you want, as far as I understand, is to create an artifact which will be 
picked up later on and included in a war? You should probably create a separate 
module project, which creates the jar and just include this jar as runtime 
dependency in your war project.

Regards Mirko
--
Sent from my mobile
On Aug 20, 2013 7:42 AM, "Richard Sand" <[email protected]> wrote:

> I concluded that this was a missing feature of maven-war-plugin, where 
> it simply wasn't looking to see if there were attached resources.
>
> I supplied a simple patch to the handleArtifacts() method to have that 
> method also handle attached artifacts,  You can see the report here.
> https://jira.codehaus.org/browse/MWAR-304
>
> -Richard
>
> -----Original Message-----
> From: Richard Sand [mailto:[email protected]]
> Sent: Monday, August 19, 2013 6:19 PM
> To: 'Maven Users List'
> Subject: artifact attached by plugin not appearing in subsequent 
> plugins
>
> Hi all - I've been stuck for a while trying to get an artifact 
> injected by a plugin to apply to subsequent plugins/goals in a 
> project.
>
> I have a project which generates a web application. My use case here 
> is the obfuscator plugin which I wrote, which creates a jar file 
> called "<projectname>-small.jar". The plugin creates jar file using 
> MavenProjectHelper.attachArtifact(). The plugin executes during the 
> packaging phase, before the maven-war-plugin. The jar file is created 
> successfully, and the call to attachArtifact() returns with no errors, 
> but the maven-war-plugin does not "see" the jar file and therefore 
> doesn't include it in the results. When I turn on debugging I can see 
> maven-war-plugin copying the other project artifacts into 
> target/<projectname>/WEB-INF/lib.
>
> Have I missed a step? I know I can explicitly configure 
> maven-war-plugin to grab the new artifact, but I thought the point of 
> "attachArtifact" was to inject the new artifact into the flow.
>
> Appreciate any insight into what I'm doing wrong...
>
> Thanks!
>
> -Richard
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to