maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalle Korhonen" <kalle.o.korho...@gmail.com>
Subject Re: assemble a huge JAR
Date Wed, 06 Jun 2007 05:36:51 GMT
Try <outputDirectory>/..</outputDirectory> inside dependencySet.

Kalle

On 6/5/07, Ben Rohlfs <ben.rohlfs@gmx.de> wrote:
>
> Hi,
>
> I want to build an unsual JAR with the maven-assembly-plugin und after
> hours of trying I cannot figure out how to do it.
>
> I have a Maven project "myproject" which is dependent on a library
> "mylibrary". I want to build a JAR file containing both the class
> files of the project and the class files of the library. What I get
> with the following configuration is a JAR containing two directories
> "myproject" and "mylibrary", each of which contains the unpacked class
> files. All I want is to get rid of the directory layer, because class
> files in a JAR only make sense, if they reside in the root directory.
> Who knows how to achieve this?
>
> Thanks for any hints, Ben
>
>
> pom.xml:
>
> ...
> <plugin>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-assembly-plugin</artifactId>
>   <version>2.2-beta-1</version>
>   <configuration>
>     <descriptors>
>       <descriptor>src/main/build-resources/assembly.xml</descriptor>
>     </descriptors>
>     <finalName>myproject</finalName>
>     <outputDirectory>target/assemblies</outputDirectory>
>     <workDirectory>target/assemblies/work</workDirectory>
>   </configuration>
> </plugin>
> ...
>
>
> assembly.xml:
>
> <assembly>
>         <id>myjar</id>
>         <formats>
>                 <format>jar</format>
>         </formats>
>         <includeBaseDirectory>false</includeBaseDirectory>
>         <moduleSets>
>                 <moduleSet>
>                         <includes>
>                                 <include>myproject</include>
>                         </includes>
>                         <binaries>
>
>                                 <includeDependencies>true</includeDependencies>
>                                 <dependencySets>
>                                         <dependencySet>
>                                         <unpack>true</unpack>
>                                         <scope>compile</scope>
>                                         </dependencySet>
>                                 </dependencySets>
>                                 <unpack>true</unpack>
>                         </binaries>
>                 </moduleSet>
>         </moduleSets>
> </assembly>
>
> ---------------------------------------------------------------------
> 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