You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Larry Meadors <lm...@apache.org> on 2006/11/20 19:25:25 UTC

Using the assembly plugin to build a stand-alone application

Hi, I am using maven for the first time, so I apologize if this is a
retarded question, but I can't find it anywhere in the docs.

I have an app that is a command line app. I want to create an assembly
that has my jar, along with the other jars that are listed as
dependencies on it.

I tried the "jar-with-dependencies" approach, and that *almost* works,
but one of the jars i am including has some added files in the
META-INF directory, and they do not end up getting included, so the
app fails. Bummer. :(

So, I guess i am looking for one of two things:

1) how can I get *all* the files in the uber jar.

-or-

2) how can I get the assembly to just put all the individual dependent
jars in a directory somewhere?

I think I'd prefer #2, but at this point... I'll take what I can get! :-)

TIA,
Larry

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


Re: Using the assembly plugin to build a stand-alone application

Posted by Larry Meadors <lm...@apache.org>.
OK, I got it.

I added a section to my pom for snapshot plugins like this:
<project ...>
...
    <pluginRepositories>
        <pluginRepository>
            <id>maven-snaps</id>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
...
</project>

Then to build, I do this:

  mvn install dependency:copy-dependencies

That does a totally adequate job of putting everything out in my
target directory for me.

Thanks for your help, people.

Larry


On 11/20/06, Barrie Treloar <ba...@gmail.com> wrote:
> On 11/21/06, Larry Meadors <lm...@apache.org> wrote:
> > Hi, I am using maven for the first time, so I apologize if this is a
> > retarded question, but I can't find it anywhere in the docs.
> >
> > I have an app that is a command line app. I want to create an assembly
> > that has my jar, along with the other jars that are listed as
> > dependencies on it.
>
> See
> * http://www.nabble.com/forum/ViewPost.jtp?post=5936062&framed=y&skin=177
> * http://www.nabble.com/forum/ViewPost.jtp?post=5954911&framed=y&skin=177
> for an example of how to do this.
>
> ---------------------------------------------------------------------
> 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: Using the assembly plugin to build a stand-alone application

Posted by Barrie Treloar <ba...@gmail.com>.
On 11/21/06, Larry Meadors <lm...@apache.org> wrote:
> Hi, I am using maven for the first time, so I apologize if this is a
> retarded question, but I can't find it anywhere in the docs.
>
> I have an app that is a command line app. I want to create an assembly
> that has my jar, along with the other jars that are listed as
> dependencies on it.

See
* http://www.nabble.com/forum/ViewPost.jtp?post=5936062&framed=y&skin=177
* http://www.nabble.com/forum/ViewPost.jtp?post=5954911&framed=y&skin=177
for an example of how to do this.

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


Re: Using the assembly plugin to build a stand-alone application

Posted by pjungwir <ma...@9stmaryrd.com>.
I'm sorry, I misunderstood your "#2" option. I think you should forget about
the assembly plugin and use the maven-dependency-plugin.

Paul


Larry Meadors-2 wrote:
> 
> Hmm, no, not really.
> 
> I have dependencies on oracle (ojdbc), spring, mail, activation,
> commons-net, log4j, ibatis-common, and ibatis-sqlmap in my project.
> 
> I want to have my jar, and all of the jars required to run it
> somewhere in the target directory.
> 
> Larry
> 
> 
> On 11/20/06, pjungwir <ma...@9stmaryrd.com> wrote:
>>
>> Hi Larry,
>>
>> I believe the descriptorId is required. You must also reference
>> assembly.xml
>> from your POM by giving the assembly plugin a configuration like this:
>>
>>   <configuration>
>>     <descriptor>assembly.xml</descriptor>
>>   </configuration>
>>
>> But the "4 files" result is correct, I think. What's in them? The jar
>> should
>> contain only your current project's classes. That is not the result of
>> the
>> assembly plugin, but of the jar plugin (probably running automatically on
>> account of jar packaging). The other three files are coming from the
>> assembly plugin. What's in them? You should see your jar plus your
>> dependency jars. That's what you wanted, right?
>>
>> Paul
>>
>>
>>
>> Larry Meadors-2 wrote:
>> >
>> > Thanks, Paul - I added that as a file named assembly.xml in the
>> > directory with my pom.xml in it.
>> >
>> > I then added this to my pom (in the build/plugins section):
>> > ===
>> >             <plugin>
>> >                 <artifactId>maven-assembly-plugin</artifactId>
>> >                 <version>2.0-beta-1</version>
>> >                 <configuration>
>> >                     <descriptorId>bin</descriptorId>
>> >                     <descriptors>
>> >                         <descriptor>./assembly.xml</descriptor>
>> >                     </descriptors>
>> >                     <finalName>marcdelivery</finalName>
>> >                     <outputDirectory>target/assembly</outputDirectory>
>> >                     <workDirectory>target/assembly/work</workDirectory>
>> >                 </configuration>
>> >             </plugin>
>> > ===
>> >
>> > But it still only creates 4 files:
>> >  - target/marc-delivery-1.0-SNAPSHOT.jar
>> >  - target/assembly/marcdelivery-bin.tar.gz
>> >  - target/assembly/marcdelivery-bin.tar.bz2
>> >  - target/assembly/marcdelivery-bin.zip
>> >
>> > If I remove the <descriptorId>bin</descriptorId> line from the pom, I
>> > get only one file (target/marc-delivery-1.0-SNAPSHOT.jar) and an
>> > error. :(
>> >
>> > How do you have this in your project?
>> >
>> > Larry
>> >
>> >
>> > On 11/20/06, pjungwir <ma...@9stmaryrd.com> wrote:
>> >>
>> >> Hi Larry,
>> >>
>> >> I'm doing this, too. I think you'll need to create your own assembly
>> >> descriptor. Here is mine:
>> >>
>> >> <assembly>
>> >>     <id>bin</id>
>> >>     <formats>
>> >>         <format>tar.gz</format>
>> >>         <format>zip</format>
>> >>     </formats>
>> >>     <fileSets>
>> >>         <fileSet>
>> >>             <directory>target</directory>
>> >>             <outputDirectory></outputDirectory>
>> >>             <includes>
>> >>                 <include>*.jar</include>  <!-- the jar of this
>> project's
>> >> classes -->
>> >>             </includes>
>> >>         </fileSet>
>> >>         <fileSet>
>> >>             <directory>target/scripts</directory>
>> >>             <outputDirectory></outputDirectory>
>> >>             <includes>
>> >>                 <include>*</include>  <!-- clui scripts to launch the
>> >> main
>> >> java class -->
>> >>             </includes>
>> >>             <fileMode>755</fileMode>
>> >>         </fileSet>
>> >>         <fileSet>
>> >>             <directory>target/doc</directory>
>> >>             <outputDirectory></outputDirectory>
>> >>             <includes>
>> >>                 <include>*</include>
>> >>             </includes>
>> >>         </fileSet>
>> >>     </fileSets>
>> >>     <files>
>> >>         <file>
>> >>             <source>README</source>
>> >>             <outputDirectory>/</outputDirectory>
>> >>             <fileMode>644</fileMode>   <!-- broken. see
>> >> http://jira.codehaus.org/browse/MASSEMBLY-153 -->
>> >>         </file>
>> >>     </files>
>> >>     <dependencySets>
>> >>         <dependencySet>
>> >>         </dependencySet>
>> >>     </dependencySets>
>> >> </assembly>
>> >>
>> >> Paul
>> >>
>> >>
>> >> Larry Meadors-2 wrote:
>> >> >
>> >> > Hi, I am using maven for the first time, so I apologize if this is a
>> >> > retarded question, but I can't find it anywhere in the docs.
>> >> >
>> >> > I have an app that is a command line app. I want to create an
>> assembly
>> >> > that has my jar, along with the other jars that are listed as
>> >> > dependencies on it.
>> >> >
>> >> > I tried the "jar-with-dependencies" approach, and that *almost*
>> works,
>> >> > but one of the jars i am including has some added files in the
>> >> > META-INF directory, and they do not end up getting included, so the
>> >> > app fails. Bummer. :(
>> >> >
>> >> > So, I guess i am looking for one of two things:
>> >> >
>> >> > 1) how can I get *all* the files in the uber jar.
>> >> >
>> >> > -or-
>> >> >
>> >> > 2) how can I get the assembly to just put all the individual
>> dependent
>> >> > jars in a directory somewhere?
>> >> >
>> >> > I think I'd prefer #2, but at this point... I'll take what I can
>> get!
>> >> :-)
>> >> >
>> >> > TIA,
>> >> > Larry
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> > For additional commands, e-mail: users-help@maven.apache.org
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7448665
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7449750
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7451900
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Using the assembly plugin to build a stand-alone application

Posted by Larry Meadors <lm...@apache.org>.
Hmm, no, not really.

I have dependencies on oracle (ojdbc), spring, mail, activation,
commons-net, log4j, ibatis-common, and ibatis-sqlmap in my project.

I want to have my jar, and all of the jars required to run it
somewhere in the target directory.

Larry


On 11/20/06, pjungwir <ma...@9stmaryrd.com> wrote:
>
> Hi Larry,
>
> I believe the descriptorId is required. You must also reference assembly.xml
> from your POM by giving the assembly plugin a configuration like this:
>
>   <configuration>
>     <descriptor>assembly.xml</descriptor>
>   </configuration>
>
> But the "4 files" result is correct, I think. What's in them? The jar should
> contain only your current project's classes. That is not the result of the
> assembly plugin, but of the jar plugin (probably running automatically on
> account of jar packaging). The other three files are coming from the
> assembly plugin. What's in them? You should see your jar plus your
> dependency jars. That's what you wanted, right?
>
> Paul
>
>
>
> Larry Meadors-2 wrote:
> >
> > Thanks, Paul - I added that as a file named assembly.xml in the
> > directory with my pom.xml in it.
> >
> > I then added this to my pom (in the build/plugins section):
> > ===
> >             <plugin>
> >                 <artifactId>maven-assembly-plugin</artifactId>
> >                 <version>2.0-beta-1</version>
> >                 <configuration>
> >                     <descriptorId>bin</descriptorId>
> >                     <descriptors>
> >                         <descriptor>./assembly.xml</descriptor>
> >                     </descriptors>
> >                     <finalName>marcdelivery</finalName>
> >                     <outputDirectory>target/assembly</outputDirectory>
> >                     <workDirectory>target/assembly/work</workDirectory>
> >                 </configuration>
> >             </plugin>
> > ===
> >
> > But it still only creates 4 files:
> >  - target/marc-delivery-1.0-SNAPSHOT.jar
> >  - target/assembly/marcdelivery-bin.tar.gz
> >  - target/assembly/marcdelivery-bin.tar.bz2
> >  - target/assembly/marcdelivery-bin.zip
> >
> > If I remove the <descriptorId>bin</descriptorId> line from the pom, I
> > get only one file (target/marc-delivery-1.0-SNAPSHOT.jar) and an
> > error. :(
> >
> > How do you have this in your project?
> >
> > Larry
> >
> >
> > On 11/20/06, pjungwir <ma...@9stmaryrd.com> wrote:
> >>
> >> Hi Larry,
> >>
> >> I'm doing this, too. I think you'll need to create your own assembly
> >> descriptor. Here is mine:
> >>
> >> <assembly>
> >>     <id>bin</id>
> >>     <formats>
> >>         <format>tar.gz</format>
> >>         <format>zip</format>
> >>     </formats>
> >>     <fileSets>
> >>         <fileSet>
> >>             <directory>target</directory>
> >>             <outputDirectory></outputDirectory>
> >>             <includes>
> >>                 <include>*.jar</include>  <!-- the jar of this project's
> >> classes -->
> >>             </includes>
> >>         </fileSet>
> >>         <fileSet>
> >>             <directory>target/scripts</directory>
> >>             <outputDirectory></outputDirectory>
> >>             <includes>
> >>                 <include>*</include>  <!-- clui scripts to launch the
> >> main
> >> java class -->
> >>             </includes>
> >>             <fileMode>755</fileMode>
> >>         </fileSet>
> >>         <fileSet>
> >>             <directory>target/doc</directory>
> >>             <outputDirectory></outputDirectory>
> >>             <includes>
> >>                 <include>*</include>
> >>             </includes>
> >>         </fileSet>
> >>     </fileSets>
> >>     <files>
> >>         <file>
> >>             <source>README</source>
> >>             <outputDirectory>/</outputDirectory>
> >>             <fileMode>644</fileMode>   <!-- broken. see
> >> http://jira.codehaus.org/browse/MASSEMBLY-153 -->
> >>         </file>
> >>     </files>
> >>     <dependencySets>
> >>         <dependencySet>
> >>         </dependencySet>
> >>     </dependencySets>
> >> </assembly>
> >>
> >> Paul
> >>
> >>
> >> Larry Meadors-2 wrote:
> >> >
> >> > Hi, I am using maven for the first time, so I apologize if this is a
> >> > retarded question, but I can't find it anywhere in the docs.
> >> >
> >> > I have an app that is a command line app. I want to create an assembly
> >> > that has my jar, along with the other jars that are listed as
> >> > dependencies on it.
> >> >
> >> > I tried the "jar-with-dependencies" approach, and that *almost* works,
> >> > but one of the jars i am including has some added files in the
> >> > META-INF directory, and they do not end up getting included, so the
> >> > app fails. Bummer. :(
> >> >
> >> > So, I guess i am looking for one of two things:
> >> >
> >> > 1) how can I get *all* the files in the uber jar.
> >> >
> >> > -or-
> >> >
> >> > 2) how can I get the assembly to just put all the individual dependent
> >> > jars in a directory somewhere?
> >> >
> >> > I think I'd prefer #2, but at this point... I'll take what I can get!
> >> :-)
> >> >
> >> > TIA,
> >> > Larry
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> > For additional commands, e-mail: users-help@maven.apache.org
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7448665
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7449750
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Using the assembly plugin to build a stand-alone application

Posted by pjungwir <ma...@9stmaryrd.com>.
Hi Larry,

I believe the descriptorId is required. You must also reference assembly.xml
from your POM by giving the assembly plugin a configuration like this:

  <configuration>
    <descriptor>assembly.xml</descriptor>
  </configuration>

But the "4 files" result is correct, I think. What's in them? The jar should
contain only your current project's classes. That is not the result of the
assembly plugin, but of the jar plugin (probably running automatically on
account of jar packaging). The other three files are coming from the
assembly plugin. What's in them? You should see your jar plus your
dependency jars. That's what you wanted, right?

Paul



Larry Meadors-2 wrote:
> 
> Thanks, Paul - I added that as a file named assembly.xml in the
> directory with my pom.xml in it.
> 
> I then added this to my pom (in the build/plugins section):
> ===
>             <plugin>
>                 <artifactId>maven-assembly-plugin</artifactId>
>                 <version>2.0-beta-1</version>
>                 <configuration>
>                     <descriptorId>bin</descriptorId>
>                     <descriptors>
>                         <descriptor>./assembly.xml</descriptor>
>                     </descriptors>
>                     <finalName>marcdelivery</finalName>
>                     <outputDirectory>target/assembly</outputDirectory>
>                     <workDirectory>target/assembly/work</workDirectory>
>                 </configuration>
>             </plugin>
> ===
> 
> But it still only creates 4 files:
>  - target/marc-delivery-1.0-SNAPSHOT.jar
>  - target/assembly/marcdelivery-bin.tar.gz
>  - target/assembly/marcdelivery-bin.tar.bz2
>  - target/assembly/marcdelivery-bin.zip
> 
> If I remove the <descriptorId>bin</descriptorId> line from the pom, I
> get only one file (target/marc-delivery-1.0-SNAPSHOT.jar) and an
> error. :(
> 
> How do you have this in your project?
> 
> Larry
> 
> 
> On 11/20/06, pjungwir <ma...@9stmaryrd.com> wrote:
>>
>> Hi Larry,
>>
>> I'm doing this, too. I think you'll need to create your own assembly
>> descriptor. Here is mine:
>>
>> <assembly>
>>     <id>bin</id>
>>     <formats>
>>         <format>tar.gz</format>
>>         <format>zip</format>
>>     </formats>
>>     <fileSets>
>>         <fileSet>
>>             <directory>target</directory>
>>             <outputDirectory></outputDirectory>
>>             <includes>
>>                 <include>*.jar</include>  <!-- the jar of this project's
>> classes -->
>>             </includes>
>>         </fileSet>
>>         <fileSet>
>>             <directory>target/scripts</directory>
>>             <outputDirectory></outputDirectory>
>>             <includes>
>>                 <include>*</include>  <!-- clui scripts to launch the
>> main
>> java class -->
>>             </includes>
>>             <fileMode>755</fileMode>
>>         </fileSet>
>>         <fileSet>
>>             <directory>target/doc</directory>
>>             <outputDirectory></outputDirectory>
>>             <includes>
>>                 <include>*</include>
>>             </includes>
>>         </fileSet>
>>     </fileSets>
>>     <files>
>>         <file>
>>             <source>README</source>
>>             <outputDirectory>/</outputDirectory>
>>             <fileMode>644</fileMode>   <!-- broken. see
>> http://jira.codehaus.org/browse/MASSEMBLY-153 -->
>>         </file>
>>     </files>
>>     <dependencySets>
>>         <dependencySet>
>>         </dependencySet>
>>     </dependencySets>
>> </assembly>
>>
>> Paul
>>
>>
>> Larry Meadors-2 wrote:
>> >
>> > Hi, I am using maven for the first time, so I apologize if this is a
>> > retarded question, but I can't find it anywhere in the docs.
>> >
>> > I have an app that is a command line app. I want to create an assembly
>> > that has my jar, along with the other jars that are listed as
>> > dependencies on it.
>> >
>> > I tried the "jar-with-dependencies" approach, and that *almost* works,
>> > but one of the jars i am including has some added files in the
>> > META-INF directory, and they do not end up getting included, so the
>> > app fails. Bummer. :(
>> >
>> > So, I guess i am looking for one of two things:
>> >
>> > 1) how can I get *all* the files in the uber jar.
>> >
>> > -or-
>> >
>> > 2) how can I get the assembly to just put all the individual dependent
>> > jars in a directory somewhere?
>> >
>> > I think I'd prefer #2, but at this point... I'll take what I can get!
>> :-)
>> >
>> > TIA,
>> > Larry
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7448665
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7449750
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Using the assembly plugin to build a stand-alone application

Posted by Larry Meadors <lm...@apache.org>.
Thanks, Paul - I added that as a file named assembly.xml in the
directory with my pom.xml in it.

I then added this to my pom (in the build/plugins section):
===
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.0-beta-1</version>
                <configuration>
                    <descriptorId>bin</descriptorId>
                    <descriptors>
                        <descriptor>./assembly.xml</descriptor>
                    </descriptors>
                    <finalName>marcdelivery</finalName>
                    <outputDirectory>target/assembly</outputDirectory>
                    <workDirectory>target/assembly/work</workDirectory>
                </configuration>
            </plugin>
===

But it still only creates 4 files:
 - target/marc-delivery-1.0-SNAPSHOT.jar
 - target/assembly/marcdelivery-bin.tar.gz
 - target/assembly/marcdelivery-bin.tar.bz2
 - target/assembly/marcdelivery-bin.zip

If I remove the <descriptorId>bin</descriptorId> line from the pom, I
get only one file (target/marc-delivery-1.0-SNAPSHOT.jar) and an
error. :(

How do you have this in your project?

Larry


On 11/20/06, pjungwir <ma...@9stmaryrd.com> wrote:
>
> Hi Larry,
>
> I'm doing this, too. I think you'll need to create your own assembly
> descriptor. Here is mine:
>
> <assembly>
>     <id>bin</id>
>     <formats>
>         <format>tar.gz</format>
>         <format>zip</format>
>     </formats>
>     <fileSets>
>         <fileSet>
>             <directory>target</directory>
>             <outputDirectory></outputDirectory>
>             <includes>
>                 <include>*.jar</include>  <!-- the jar of this project's
> classes -->
>             </includes>
>         </fileSet>
>         <fileSet>
>             <directory>target/scripts</directory>
>             <outputDirectory></outputDirectory>
>             <includes>
>                 <include>*</include>  <!-- clui scripts to launch the main
> java class -->
>             </includes>
>             <fileMode>755</fileMode>
>         </fileSet>
>         <fileSet>
>             <directory>target/doc</directory>
>             <outputDirectory></outputDirectory>
>             <includes>
>                 <include>*</include>
>             </includes>
>         </fileSet>
>     </fileSets>
>     <files>
>         <file>
>             <source>README</source>
>             <outputDirectory>/</outputDirectory>
>             <fileMode>644</fileMode>   <!-- broken. see
> http://jira.codehaus.org/browse/MASSEMBLY-153 -->
>         </file>
>     </files>
>     <dependencySets>
>         <dependencySet>
>         </dependencySet>
>     </dependencySets>
> </assembly>
>
> Paul
>
>
> Larry Meadors-2 wrote:
> >
> > Hi, I am using maven for the first time, so I apologize if this is a
> > retarded question, but I can't find it anywhere in the docs.
> >
> > I have an app that is a command line app. I want to create an assembly
> > that has my jar, along with the other jars that are listed as
> > dependencies on it.
> >
> > I tried the "jar-with-dependencies" approach, and that *almost* works,
> > but one of the jars i am including has some added files in the
> > META-INF directory, and they do not end up getting included, so the
> > app fails. Bummer. :(
> >
> > So, I guess i am looking for one of two things:
> >
> > 1) how can I get *all* the files in the uber jar.
> >
> > -or-
> >
> > 2) how can I get the assembly to just put all the individual dependent
> > jars in a directory somewhere?
> >
> > I think I'd prefer #2, but at this point... I'll take what I can get! :-)
> >
> > TIA,
> > Larry
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7448665
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Using the assembly plugin to build a stand-alone application

Posted by pjungwir <ma...@9stmaryrd.com>.
Hi Larry,

I'm doing this, too. I think you'll need to create your own assembly
descriptor. Here is mine:

<assembly>
    <id>bin</id>
    <formats>
        <format>tar.gz</format>
        <format>zip</format>
    </formats>
    <fileSets>
        <fileSet>
            <directory>target</directory>
            <outputDirectory></outputDirectory>
            <includes>
                <include>*.jar</include>  <!-- the jar of this project's
classes -->
            </includes>
        </fileSet>
        <fileSet>
            <directory>target/scripts</directory>
            <outputDirectory></outputDirectory>
            <includes>
                <include>*</include>  <!-- clui scripts to launch the main
java class -->
            </includes>
            <fileMode>755</fileMode>
        </fileSet>
        <fileSet>
            <directory>target/doc</directory>
            <outputDirectory></outputDirectory>
            <includes>
                <include>*</include>
            </includes>
        </fileSet>
    </fileSets>
    <files>
        <file>
            <source>README</source>
            <outputDirectory>/</outputDirectory>
            <fileMode>644</fileMode>   <!-- broken. see
http://jira.codehaus.org/browse/MASSEMBLY-153 -->
        </file>
    </files>
    <dependencySets>
        <dependencySet>
        </dependencySet>
    </dependencySets>
</assembly>

Paul


Larry Meadors-2 wrote:
> 
> Hi, I am using maven for the first time, so I apologize if this is a
> retarded question, but I can't find it anywhere in the docs.
> 
> I have an app that is a command line app. I want to create an assembly
> that has my jar, along with the other jars that are listed as
> dependencies on it.
> 
> I tried the "jar-with-dependencies" approach, and that *almost* works,
> but one of the jars i am including has some added files in the
> META-INF directory, and they do not end up getting included, so the
> app fails. Bummer. :(
> 
> So, I guess i am looking for one of two things:
> 
> 1) how can I get *all* the files in the uber jar.
> 
> -or-
> 
> 2) how can I get the assembly to just put all the individual dependent
> jars in a directory somewhere?
> 
> I think I'd prefer #2, but at this point... I'll take what I can get! :-)
> 
> TIA,
> Larry
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-the-assembly-plugin-to-build-a-stand-alone-application-tf2670816s177.html#a7448665
Sent from the Maven - Users mailing list archive at Nabble.com.


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