一些maven指令筆記

New Empty Project

mvn archetype:create -DgroupId=com.ericsson -DartifactId=dp

Run main

mvn exec:java -Dexec.mainClass=com.ericsson.dp.App

手動 install jar到repository

mvn install:install-file -Dfile=C:\cwz\company\springsource\sts-3.1.0.RELEASE\workspace_dp\lib\DiameterBaseApi.jar -Dpackaging=jar -DgroupId=com.ericsson -DartifactId=DiameterBaseApi -Dversion=1.0

install jar and self pom to repository

mvn install:install-file -Dfile=vsmt-core-1.4.jar -Dpackaging=jar -DgroupId=com.ericsson.vsmt -DartifactId=vsmt-core -Dversion=1.4 -DpomFile=vsmt-core-1.4.pom

Maven Shade Plugin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>