??? Maven插件均配置在pom.xml中的<project>/<build>/<plugins>下。
1. maven-compiler-plugin:用于指定Java编译时的JDK版本
??? <plugin>
? ??? ??? <groupId>org.apache.maven.plugins</groupId>
? ??? ??? <artifactId>maven-compiler-plugin</artifactId>
? ??? ??? <configuration>
? ??? ????? <source>1.6</source>
? ??? ????? <target>1.6</target>
? ??? ??? </configuration>
? ?? </plugin>
2. maven-shade-plugin:用于指定打包后生成的JAR文件可运行的Main-Class, 即在MANIFEST.MF文件中
??? 指定Main-Class属性。
??? <plugin>
? ??? ??? <groupId>org.apache.maven.plugins</groupId>
? ??? ??? <artifactId>maven-shade-plugin</artifactId>
? ??? ??? <version>1.2.1</version>
? ??? ??? <executions>
? ??? ??????? <execution>
? ??? ????????????? <phase>package</phase>
? ??? ????????????? <goals>
? ??? ???????????????? <goal>shade</goal>
? ??? ????????????? </goals>
? ??? ????????????? <configuration>
? ??? ????????????????? <transformers>
? ??? ???????????????????? <transformer implementation="org.apache.maven.plugins.shade
?????????????????????????????????? .resource.ManifestResourceTransformer">
? ??? ?????????????????????????? <mainClass>com.juvenxu.mvnbook.helloworld.HelloWorld</mainClass>
? ??? ???????????????????? </transformer>
? ??? ????????????????? </transformers>
? ??? ????????????? </configuration>
? ??? ???????? </execution>
? ??? ??? </executions>
? ? </plugin>
3. M2Eclipse
??? 下载地址:http://m2eclipse.sonatype.org/sites/m2e/
??? 额外组件:http://m2eclipse.sonatype.org/sites/m2e-extras/