Comments (4)
In shell it looks like this, with a project that's currently using maven assembly to spit out a typical jar with dependencies:
cd project
mvn clean
mvn -DskipTests package
tar -xf target/project-SNAPSHOT-jar-with-dependencies.jar -C target/classes
rm target/classes/META-INF/MANIFEST.MF
mvn capsule:build
As an aside, the rm command is necessary because capsule maven does not skip existing manifest files, resulting in a build error when the generated manifest is added.
from capsule-maven-plugin.
Perhaps you can provide an example project containing an assembly build. And from that describe how you want the eventual capsule to look like. Just so I am sure I understand what exactly you want.
from capsule-maven-plugin.
I am distributing JARs that can be run from command line on a user machine, using Capsule to download dependencies, but run as normal on the target environment, where some dependencies are already present, and the JAR is loaded through a class loader. Think Hadoop or Tomcat, where something else is loading the JAR, but the JAR (or war) does contain a subset of dependencies.
I don't know that the feature is worth it, given that it's a one-off feature. That said, here's the other bug I encountered (needing the rm command):
https://github.com/chrischristo/capsule-maven-plugin/blob/b9ebc64089c82cfe08cbaba48ec3c72addf6b6d6/src/main/java/capsule/CapsuleMojo.java#L329
This addToJar command will throw an uncaught exception if a MANIFEST.MF file already exists in target/classes.
from capsule-maven-plugin.
Actually there was a recent addition to the plugin where you can specify <fileSets>
. See here for more info. But essentially you don't need to add the jar to target manually. Just include it in a fileSet and the plugin will add it to the capsule:
<fileSets>
<fileSet>
<directory>target/</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>project-SNAPSHOT-jar-with-dependencies.jar</include>
</includes>
</fileSet>
</fileSets>
So any jar, zip, war, or whatever you create with an assembly plugin, you can use the <fileSets>
tag to add those to the capsule. Hopefully this is sufficient for your needs?
I also fixed the MANIFEST.MF issue (which will be for the next release).
from capsule-maven-plugin.
Related Issues (20)
- Could we exclude optional dependencies from a fat jar? HOT 5
- Implement unpack and wildchars in dependencySet HOT 3
- Support for mirrors HOT 3
- Add classifier support HOT 1
- Dependencies missing for subprojects HOT 12
- Capsule maven latest plugin build fail HOT 6
- Capsule silently not overwritten if already exists HOT 5
- How to control LD_LIBRARY_PATH HOT 11
- Document specifying separately `capsule`'s and `capsule-maven`'s versions HOT 3
- Maven dependencies with type "test-jar" are not correctly resolved to the test jar file. HOT 3
- Do not includes Repositories attribute by default HOT 4
- How to start Push-Server-0.12.0-capsule-fat.jar HOT 2
- Large size difference between shaded JAR and Capsule JAR HOT 5
- Feature sets should allow for standard Maven wildcard specifications HOT 1
- Allow capsule to be included by maven assembly HOT 4
- Make capsule name completely overridable HOT 2
- Include plugin dependencies when building capsule HOT 1
- Add capsule as pom dependency HOT 2
- Warning with JDK11 HOT 1
- How to use some other input jar?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capsule-maven-plugin.