欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mvn插件

程序员文章站 2022-06-17 18:24:55
...
  1. spotbugs 代码检查
		 <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>3.1.11</version>
                <dependencies>
                    <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
                    <dependency>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs</artifactId>
                        <version>4.0.0-beta1</version>
                    </dependency>
                </dependencies>
            </plugin>
  1. ** versions 升级版本号**
 		<groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
        <version>2.3</version>
  1. ** assembly 打包并且可以运行main**
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <!--运行jar包时运行的主类,要求类全名-->
                            <mainClass>com.maven.mymavendemo.MyTest</mainClass>
                            <!-- 是否指定项目classpath下的依赖 -->
                            <addClasspath>true</addClasspath>
                            <!-- 指定依赖的时候声明前缀 -->
                            <classpathPrefix>./</classpathPrefix>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
  1. ** source 打包源代码**
	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-source-plugin</artifactId>
		<executions>
			<execution>
				<id>attach-sources</id>
					<goals>
						<goal>jar</goal>
					</goals>
			</execution>
		</executions>
	</plugin>