You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dave Hoffer <DH...@xrite.com> on 2007/10/09 17:03:47 UTC

How can I specify the output name using maven-assembly-plugin?

How can I specify the output name of the generated jar-with-dependencies
artifact using maven-assembly-plugin?  I want the final jar to be called
something like somename.xyz.

 

 

 

 


Re: How can I specify the output name using maven-assembly-plugin?

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

Dave Hoffer schrieb:
> More data points on this problem:
> 
> The build failure I reported is caused when I have <goal>attached</goal>
> in my pom.

Look at the error description in the log output:

   org.apache.maven.artifact.InvalidArtifactRTException: For artifact 
{com.xrite.tcd:matchstik-tcd:1.1-SNAPSHOT:jar}:
     An attached artifact must have a different ID than its 
corresponding main artifact.

The explanation is easy, if you set appendAssemblyId=false and attach 
the assembly to the pom (goal attach) but dont change the finalName of 
the assembly, it defaults to ${project.build.finalName}. This is the 
same name as the main artifact of you pom...

> However if I don't have this but have
> <goal>directory-inline</goal> instead it does not fail but then it does
> not make the final jar specified by the
> <finalName>custom-name</finalName> pom entry.

Yes, that's what the directory* goals are for, to create an exploded 
vesion of the assembly.

> 
> Oh how, it times like these, I just wish that maven was simpler.  There
> is no useful information on the maven-assembly-plugin web site that
> explains when these entries are valid or not.

Can you file an issue for this in jira [1], so the documentation can be 
improved. Please be specific about what is missing for you and what 
should be elaborated.

> All I want to do is specify the name of my jar with dependencies
> artifact when I run mvn clean install.

As I wrote in an earlier mail, you can change the *name* of the assembly 
via the <finalName/> tag. This won't change the extension, though. If 
you really need to have a non-standard extension for the packaging type 
of your assembly you have to use the antrun-plugin to rename/copy it.

> Any ideas how to get this work?
> 
> -Dave

-Tim

[1] http://jira.codehaus.org/browse/MASSEMBLY

> -----Original Message-----
> From: Dave Hoffer [mailto:DHoffer@xrite.com] 
> Sent: Tuesday, October 09, 2007 4:37 PM
> To: Maven Users List
> Subject: RE: How can I specify the output name using
> maven-assembly-plugin?
> 
> When I include <appendAssemblyId>false</appendAssemblyId> I get the
> following build error, any ideas?
> 
> Here is my pom's plugin config:
> <artifactId>maven-assembly-plugin</artifactId>
>   <executions>
>     <execution>
>       <phase>package</phase>
>         <goals>
>           <goal>directory-inline</goal>
>           <goal>attached</goal>
>         </goals>
>       </execution>
>     </executions>
> 
> 
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] An invalid artifact was detected.
> 
> This artifact might be in your project's POM, or it might have been
> included tra
> nsitively during the resolution process. Here is the information we do
> have for
> this artifact:
> 
>     o GroupID:     com.xrite.tcd
>     o ArtifactID:  matchstik-tcd
>     o Version:     1.1-SNAPSHOT
>     o Type:        jar
> 
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.artifact.InvalidArtifactRTException: For artifact
> {com.xrite.tc
> d:matchstik-tcd:1.1-SNAPSHOT:jar}: An attached artifact must have a
> different ID
>  than its corresponding main artifact.
>         at
> org.apache.maven.project.artifact.AttachedArtifact.<init>(AttachedArt
> ifact.java:51)
>         at
> org.apache.maven.project.DefaultMavenProjectHelper.attachArtifact(Def
> aultMavenProjectHelper.java:53)
>         at
> org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(A
> bstractAssemblyMojo.java:295)
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:443)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:539)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:480)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:459)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:278)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:143)
>         at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> 
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 1 minute 40 seconds
> [INFO] Finished at: Tue Oct 09 16:34:04 EDT 2007
> [INFO] Final Memory: 13M/28M
> [INFO]
> ------------------------------------------------------------------------
> 
> C:\svn\toolcrib\ToolCrib\matchstik-tcd\trunk>
> 
> 
> -Dave
> 
> -----Original Message-----
> From: rodolphe.beck@gmail.com [mailto:rodolphe.beck@gmail.com] On Behalf
> Of Rodolphe Beck
> Sent: Tuesday, October 09, 2007 11:26 AM
> To: Maven Users List
> Subject: Re: How can I specify the output name using
> maven-assembly-plugin?
> 
> Hi,
> 
> <configuration>
>       <finalName>custom-name</finalName>
>       <appendAssemblyId>false</appendAssemblyId>
> </configuration>
> 
> 
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html
> 
> 2007/10/9, Dave Hoffer <DH...@xrite.com>:
>> How can I specify the output name of the generated
> jar-with-dependencies
>> artifact using maven-assembly-plugin?  I want the final jar to be
> called
>> something like somename.xyz.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
> 
> 


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


RE: How can I specify the output name using maven-assembly-plugin?

Posted by Dave Hoffer <DH...@xrite.com>.
More data points on this problem:

The build failure I reported is caused when I have <goal>attached</goal>
in my pom.  However if I don't have this but have
<goal>directory-inline</goal> instead it does not fail but then it does
not make the final jar specified by the
<finalName>custom-name</finalName> pom entry.

Oh how, it times like these, I just wish that maven was simpler.  There
is no useful information on the maven-assembly-plugin web site that
explains when these entries are valid or not.

All I want to do is specify the name of my jar with dependencies
artifact when I run mvn clean install.

Any ideas how to get this work?

-Dave

-----Original Message-----
From: Dave Hoffer [mailto:DHoffer@xrite.com] 
Sent: Tuesday, October 09, 2007 4:37 PM
To: Maven Users List
Subject: RE: How can I specify the output name using
maven-assembly-plugin?

When I include <appendAssemblyId>false</appendAssemblyId> I get the
following build error, any ideas?

Here is my pom's plugin config:
<artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <phase>package</phase>
        <goals>
          <goal>directory-inline</goal>
          <goal>attached</goal>
        </goals>
      </execution>
    </executions>


[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An invalid artifact was detected.

This artifact might be in your project's POM, or it might have been
included tra
nsitively during the resolution process. Here is the information we do
have for
this artifact:

    o GroupID:     com.xrite.tcd
    o ArtifactID:  matchstik-tcd
    o Version:     1.1-SNAPSHOT
    o Type:        jar

[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.artifact.InvalidArtifactRTException: For artifact
{com.xrite.tc
d:matchstik-tcd:1.1-SNAPSHOT:jar}: An attached artifact must have a
different ID
 than its corresponding main artifact.
        at
org.apache.maven.project.artifact.AttachedArtifact.<init>(AttachedArt
ifact.java:51)
        at
org.apache.maven.project.DefaultMavenProjectHelper.attachArtifact(Def
aultMavenProjectHelper.java:53)
        at
org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(A
bstractAssemblyMojo.java:295)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 40 seconds
[INFO] Finished at: Tue Oct 09 16:34:04 EDT 2007
[INFO] Final Memory: 13M/28M
[INFO]
------------------------------------------------------------------------

C:\svn\toolcrib\ToolCrib\matchstik-tcd\trunk>


-Dave

-----Original Message-----
From: rodolphe.beck@gmail.com [mailto:rodolphe.beck@gmail.com] On Behalf
Of Rodolphe Beck
Sent: Tuesday, October 09, 2007 11:26 AM
To: Maven Users List
Subject: Re: How can I specify the output name using
maven-assembly-plugin?

Hi,

<configuration>
      <finalName>custom-name</finalName>
      <appendAssemblyId>false</appendAssemblyId>
</configuration>


http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html

2007/10/9, Dave Hoffer <DH...@xrite.com>:
>
> How can I specify the output name of the generated
jar-with-dependencies
> artifact using maven-assembly-plugin?  I want the final jar to be
called
> something like somename.xyz.
>
>
>
>
>
>
>
>
>
>


-- 
Cordialement,
Rodolphe Beck
rodolphe.beck@aaescp-eap.net

---------------------------------------------------------------------
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


RE: How can I specify the output name using maven-assembly-plugin?

Posted by Dave Hoffer <DH...@xrite.com>.
When I include <appendAssemblyId>false</appendAssemblyId> I get the
following build error, any ideas?

Here is my pom's plugin config:
<artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <phase>package</phase>
        <goals>
          <goal>directory-inline</goal>
          <goal>attached</goal>
        </goals>
      </execution>
    </executions>


[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An invalid artifact was detected.

This artifact might be in your project's POM, or it might have been
included tra
nsitively during the resolution process. Here is the information we do
have for
this artifact:

    o GroupID:     com.xrite.tcd
    o ArtifactID:  matchstik-tcd
    o Version:     1.1-SNAPSHOT
    o Type:        jar

[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.artifact.InvalidArtifactRTException: For artifact
{com.xrite.tc
d:matchstik-tcd:1.1-SNAPSHOT:jar}: An attached artifact must have a
different ID
 than its corresponding main artifact.
        at
org.apache.maven.project.artifact.AttachedArtifact.<init>(AttachedArt
ifact.java:51)
        at
org.apache.maven.project.DefaultMavenProjectHelper.attachArtifact(Def
aultMavenProjectHelper.java:53)
        at
org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(A
bstractAssemblyMojo.java:295)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 40 seconds
[INFO] Finished at: Tue Oct 09 16:34:04 EDT 2007
[INFO] Final Memory: 13M/28M
[INFO]
------------------------------------------------------------------------

C:\svn\toolcrib\ToolCrib\matchstik-tcd\trunk>


-Dave

-----Original Message-----
From: rodolphe.beck@gmail.com [mailto:rodolphe.beck@gmail.com] On Behalf
Of Rodolphe Beck
Sent: Tuesday, October 09, 2007 11:26 AM
To: Maven Users List
Subject: Re: How can I specify the output name using
maven-assembly-plugin?

Hi,

<configuration>
      <finalName>custom-name</finalName>
      <appendAssemblyId>false</appendAssemblyId>
</configuration>


http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html

2007/10/9, Dave Hoffer <DH...@xrite.com>:
>
> How can I specify the output name of the generated
jar-with-dependencies
> artifact using maven-assembly-plugin?  I want the final jar to be
called
> something like somename.xyz.
>
>
>
>
>
>
>
>
>
>


-- 
Cordialement,
Rodolphe Beck
rodolphe.beck@aaescp-eap.net

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


Re: How can I specify the output name using maven-assembly-plugin?

Posted by Rodolphe Beck <ro...@aaescp-eap.net>.
Hi,

<configuration>
      <finalName>custom-name</finalName>
      <appendAssemblyId>false</appendAssemblyId>
</configuration>


http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html

2007/10/9, Dave Hoffer <DH...@xrite.com>:
>
> How can I specify the output name of the generated jar-with-dependencies
> artifact using maven-assembly-plugin?  I want the final jar to be called
> something like somename.xyz.
>
>
>
>
>
>
>
>
>
>


-- 
Cordialement,
Rodolphe Beck
rodolphe.beck@aaescp-eap.net

Re: How can I specify the output name using maven-assembly-plugin?

Posted by Tim Kettler <ti...@udo.edu>.
See my reply to your other mail.

Dave Hoffer schrieb:
> Okay, if that's the case...how can I copy this file and give it the name
> I need?
> 
> -Dave
> 
> -----Original Message-----
> From: Tim Kettler [mailto:tim.kettler@udo.edu] 
> Sent: Tuesday, October 09, 2007 11:37 AM
> To: users@maven.apache.org
> Subject: Re: How can I specify the output name using
> maven-assembly-plugin?
> 
> Hi,
> 
>   [...]
>   <configuration>
>     <finalName>your-custom-name</finalName>
>     <appendAssemblyId>false</appendAssemblyId>
>   </configuration>
>   [...]
> 
> This will not allow you to change the file extension of the
> generated assembly and a don't think this is possible at all.
> 
> -Tim
> 
> Am Tue, 9 Oct 2007 11:03:47 -0400
> schrieb "Dave Hoffer" <DH...@xrite.com>:
> 
>> How can I specify the output name of the generated
>> jar-with-dependencies artifact using maven-assembly-plugin?  I want
>> the final jar to be called something like somename.xyz.
> 
> ---------------------------------------------------------------------
> 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


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


RE: How can I specify the output name using maven-assembly-plugin?

Posted by Dave Hoffer <DH...@xrite.com>.
Okay, if that's the case...how can I copy this file and give it the name
I need?

-Dave

-----Original Message-----
From: Tim Kettler [mailto:tim.kettler@udo.edu] 
Sent: Tuesday, October 09, 2007 11:37 AM
To: users@maven.apache.org
Subject: Re: How can I specify the output name using
maven-assembly-plugin?

Hi,

  [...]
  <configuration>
    <finalName>your-custom-name</finalName>
    <appendAssemblyId>false</appendAssemblyId>
  </configuration>
  [...]

This will not allow you to change the file extension of the
generated assembly and a don't think this is possible at all.

-Tim

Am Tue, 9 Oct 2007 11:03:47 -0400
schrieb "Dave Hoffer" <DH...@xrite.com>:

> How can I specify the output name of the generated
> jar-with-dependencies artifact using maven-assembly-plugin?  I want
> the final jar to be called something like somename.xyz.

---------------------------------------------------------------------
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


Re: How can I specify the output name using maven-assembly-plugin?

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

  [...]
  <configuration>
    <finalName>your-custom-name</finalName>
    <appendAssemblyId>false</appendAssemblyId>
  </configuration>
  [...]

This will not allow you to change the file extension of the
generated assembly and a don't think this is possible at all.

-Tim

Am Tue, 9 Oct 2007 11:03:47 -0400
schrieb "Dave Hoffer" <DH...@xrite.com>:

> How can I specify the output name of the generated
> jar-with-dependencies artifact using maven-assembly-plugin?  I want
> the final jar to be called something like somename.xyz.

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