当先锋百科网

首页 1 2 3 4 5 6 7
 <build>
  <!-- jar名称 -->
  <finalName>netty_client</finalName>
  <!-- 使用shade打包 可以把第三方依赖包都打包进jar 防止缺失依赖报错 -->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId> maven-shade-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>com.nqwl.netty.EchoClient</mainClass>  <!--这里运行类!也就是入口类 -->
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
  </build>