Skip to content

Commit

Permalink
Use a custom, NAR-specific assembly descriptor
Browse files Browse the repository at this point in the history
This assembly descriptor is designed to incorporate all of the
platform-specific build projects available in the current target/nar/
directory.

The result is a .jar file with the -multi-platform.jar suffix that
includes all of the native libraries ready for use with the
native-lib-loader aware NarSystem class.

To use it, the project needs to be built from identical revisions for all
platforms that need to be supported. Then, the

	target/nar/<artifactId>-<version>-<aol>-jni/

directories need to be accumulated on one platform and a final `mvn` run
will produce the desired uber .jar file.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 30, 2014
1 parent aaa41f9 commit ee9fd35
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -36,9 +36,9 @@
<mainClass>c.hello</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<descriptors>
<descriptor>src/main/assembly/uber.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
Expand Down
15 changes: 15 additions & 0 deletions src/main/assembly/uber.xml
@@ -0,0 +1,15 @@
<assembly>
<id>multi-platform</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<useProjectAttachments>true</useProjectAttachments>
<useTransitiveFiltering>false</useTransitiveFiltering>
<outputDirectory>/</outputDirectory>
<unpack>true</unpack>
</dependencySet>
</dependencySets>
</assembly>

2 comments on commit ee9fd35

@hkmoon
Copy link
Owner

@hkmoon hkmoon commented on ee9fd35 Sep 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you have done magic on the project? That is actually I tried to make it with static programming in the nar-maven-plugin. I feel I am useless. Ahhhh..... I admit that you are cool. ^^b

@dscho
Copy link
Contributor Author

@dscho dscho commented on ee9fd35 Sep 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is the beauty of working together, Open Source style!

Please sign in to comment.