maven工程 打包jar 須要的配置

<plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-jar-plugin</artifactId>  
                <configuration>  
                    <archive>  
                        <manifest>  
                            <addClasspath>true</addClasspath>  
                            <classpathPrefix>lib/</classpathPrefix>  
                            <!--你的主方法-->
                <mainClass>com.aliyun.openservices.lmq.example.MQTTSendMessage</mainClass>  
                        </manifest>  
                        <manifestEntries>  
                            <Class-Path>.</Class-Path>  
                        </manifestEntries>  
                    </archive>  
  
                    <finalName>eventprocessor</finalName>  
                    <!-- <excludes>  
                        <exclude>**/*.properties</exclude>  
                        <exclude>**/*.xml</exclude>  
                    </excludes> -->  
                </configuration>  
            </plugin>  
  
            <plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-dependency-plugin</artifactId>  
                <executions>  
                    <execution>  
                        <id>copy-dependencies</id>  
                        <phase>prepare-package</phase>  
                        <goals>  
                            <goal>copy-dependencies</goal>  
                        </goals>  
                        <configuration>  
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>  
                            <overWriteReleases>false</overWriteReleases>  
                            <overWriteSnapshots>false</overWriteSnapshots>  
                            <overWriteIfNewer>true</overWriteIfNewer>  
                        </configuration>  
                    </execution>  
                </executions>  
            </plugin>
相關文章
相關標籤/搜索