Reputation: 1846
I have a JAR file which I want to add to my maven 2 repository as an artifact. The JAR depends on system libraries specific for each platform, e.g. .dll on Windows, .so on Linux, etc.
How should I create the artifact so that users from different platforms can use the JAR?
Upvotes: 0
Views: 92
Reputation: 5578
If your JAR is a library
that you expect to be included into other projects, then you can create maven profiles that can be activated based on a system and add whatever required system dependencies there.
<profiles>
<profile>
<activation>
<os>
<name>Windows XP</name>
<family>Windows</family>
<arch>x86</arch>
<version>5.1.2600</version>
</os>
</activation>
...
</profile>
</profiles>
However, if you are making an executable
JAR then it's quite a different story.
There are many ways you can do this, not all are easy. If you know what you are looking for ( name of a DLL
or SO
lib ), then you could make a startup script to:
.config
file having the file locationSome apps do all all of these steps, some do a few or just one. I would like to know if there is a better way too :)
Upvotes: 1