You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Blake Martin <bl...@gmail.com> on 2008/06/13 16:08:02 UTC

Want to add a classifier/suffix to a war artifact from the POM using a profile

The command I'm using to deploy my plugins is: mvn clean deploy

I'm currently generating two war files from the same plugin, but when
they're installed or deployed, they're always named
${artifact}-${version}.war

I'd like to either specify something in a build profile in my POM
(preferred) or something in on the command line (also acceptable) that will
cause my artifacts to be named

${artifact}-${version}-${suffix1}.war
${artifact}-${version}-${suffix2}.war

These wars have to be built one-at-a-time from the command line, I'm limited
to 1 POM file (I just finished merging 5 of them) and I can't modify the POM
between builds.

Is this possible with the deploy phase, or do i have to use the
deploy:deploy-file goal to accomplish this task?

Re: Want to add a classifier/suffix to a war artifact from the POM using a profile

Posted by Blake Martin <bl...@gmail.com>.
Wendy, thank you very much! Actually, with my current version of the war
plugin and your suggestion, the install and deploy phases perform exactly
what I want them to... I don't need a workaround anymore.

I looked at the results of the install and deploy phases and the artifact is
named with the correct classifier in both cases (after
installation/deployment). Perhaps the maintainers fixed the deploy plugin.

Just for reference, I'm using the latest snapshot of maven-war-plugin.


> > I'd like to either specify something in a build profile in my POM
> > (preferred) or something in on the command line (also acceptable) that
> will
> > cause my artifacts to be named
> >
> > ${artifact}-${version}-${suffix1}.war
> > ${artifact}-${version}-${suffix2}.war
>

> [snip]
>
>  <plugin>
>    <artifactId>maven-war-plugin</artifactId>
>    <version>2.0.2</version>
>    <configuration>
>      <classifier>thesuffix</classifier>
>    </configuration>
>  </plugin>
>
> You could go ahead and add it to the pom, then continue using your
> deploy:deploy-file workaround [...]

Re: Want to add a classifier/suffix to a war artifact from the POM using a profile

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Jun 13, 2008 at 7:08 AM, Blake Martin <bl...@gmail.com> wrote:

> I'd like to either specify something in a build profile in my POM
> (preferred) or something in on the command line (also acceptable) that will
> cause my artifacts to be named
>
> ${artifact}-${version}-${suffix1}.war
> ${artifact}-${version}-${suffix2}.war
>
> These wars have to be built one-at-a-time from the command line, I'm limited
> to 1 POM file (I just finished merging 5 of them) and I can't modify the POM
> between builds.
>
> Is this possible with the deploy phase, or do i have to use the
> deploy:deploy-file goal to accomplish this task?

You can configure the war plugin to add a classifier, with profiles
for the different ones you need, but you will then run into MDEPLOY-45
[1].

  <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.0.2</version>
    <configuration>
      <classifier>thesuffix</classifier>
    </configuration>
  </plugin>

You could go ahead and add it to the pom, then continue using your
deploy:deploy-file workaround until the next version of the deploy
plugin is released.  Or you might want to try an internal release of
the deploy plugin with the fix applied.

[1] http://jira.codehaus.org/browse/MDEPLOY-45

-- 
Wendy

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