Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assembly of uber .jar #1

Merged
merged 4 commits into from Sep 30, 2014
Merged

Fix assembly of uber .jar #1

merged 4 commits into from Sep 30, 2014

Conversation

dscho
Copy link
Contributor

@dscho dscho commented Sep 30, 2014

With this topic branch, the following strategy will produce the uber .jar:

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

The helloTest class is actually a JUnit test, not a native one.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This will be expanded: we want to generate an uber .jar including the
available native libraries.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Contributor Author

dscho commented Sep 30, 2014

I have to admit that I am still not too much of a fan of bundling the libraries... I really think the better way would be to put the different .nar files on the class path and let the native-lib-loader do its job...

@dscho
Copy link
Contributor Author

dscho commented Sep 30, 2014

@ctrueden I have a hunch that you disagree and think that there is merit to producing these uber .jar files, so I invite you to chime in...

@ctrueden
Copy link

Now that the native-lib-loader can load native libraries from .nar files, I think that distribution mechanism is superior to uber JARs with multiple platforms, for all the reasons @dscho cited elsewhere (in particular: separation of concerns and avoiding library bloat). However, my architectural bias is to generalize things, so my preference would be for native-lib-loader to support both.

@dscho
Copy link
Contributor Author

dscho commented Sep 30, 2014

However, my architectural bias is to generalize things, so my preference would be for native-lib-loader to support both.

And it does already, because it looks anywhere in the class path, not just in the same .jar file.

@ctrueden
Copy link

And it does already

👍

@hkmoon
Copy link
Owner

hkmoon commented Sep 30, 2014

It is SO beautiful. Thank you so much, @dscho and @ctrueden. Sooner or later, I would like to have nar's mechanism in Fiji in order to load nar packages. So, whenever some specific plugin needs FFT--natvie.nar, Fiji can import it on-the-fly and load it. Maybe, you guys already made it?

hkmoon added a commit that referenced this pull request Sep 30, 2014
Fix assembly of uber .jar
@hkmoon hkmoon merged commit dfc4eb2 into hkmoon:master Sep 30, 2014
@ctrueden
Copy link

I would like to have nar's mechanism in Fiji in order to load nar packages.

@hkmoon It should be as simple as releasing a new native-lib-loader and uploading it to the Fiji update site, right @dscho?

@dscho dscho deleted the fix-assembly branch September 30, 2014 15:55
@dscho
Copy link
Contributor Author

dscho commented Sep 30, 2014

Wehelll... In Fiji, what you should do, really, is to use the lib// mechanism to distribute unpacked libraries. Remember, there are problems with rpath that are not addressed by the native-lib-loader (and AFAICT cannot be, either).

Sooner or later, I would like to have nar's mechanism in Fiji in order to load nar packages.

Actually, the method I recommend is to address imagej/imagej-maven-plugin#4 and then use either the install-artifact or copy-jar goals of the imagej-maven-plugin to install the libraries correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants