Tag Archives: maven

Maven, make a fat jar

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation=”org.apache.maven.plugins.shade.resource.ManifestResourceTransformer”> <mainClass>foo.bar.App</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin>

Add maven to project

After create a dynanic website, we hope to automatically add jar files by maven. How to turn on the maven feature? And go to the project directory, and run the following command: mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false It’s done! Refer: http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

Explanation for pom.xml

<project> <modelVersion>4.0.0</modelVersion> <!–shows pom.xml structure complies with 4.0.0 version. Normally, it is 4.0.0> <groupId>mvn.myapp.com</groupId>  <!–where the project locate>  <artifactId>MavenTestApp</artifactId>  <!–project name> <packaging>jar</packaging>  <!– the form of the compiled result, normally, it can be jar, war and ear.> <version>1.0-SNAPSHOT</version>  <!– version of the project, SNAPSHOT means it is still under development> <name>Maven Quick Start</name>   <!–name of… Read More »