maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Friedenhagen <mfriedenha...@gmail.com>
Subject RE: artifact attached by plugin not appearing in subsequent plugins
Date Tue, 20 Aug 2013 10:20:15 GMT
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" <rsand@idfconnect.com> 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:rsand@idfconnect.com]
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message