maven把项目打包成可运行的jar包

来源:互联网 发布:q版自画像软件 编辑:程序博客网 时间:2024/04/20 12:05

<distributionManagement><repository><id>Snapshots</id><name>local</name><url>file://${project.build.directory}/deploys</url></repository></distributionManagement>

指定打包成的jar包路径


<build>        <plugins>            <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>com.wanhang.sendmessage.App</mainClass>                                </transformer>                            </transformers>                        </configuration>                    </execution>                </executions>            </plugin>        </plugins>    </build>

在mainClass中指定main方法所在的类路径




0 0