zoukankan      html  css  js  c++  java
  • Maven no main manifest attribute when generate jar for project

    pom.xml

    
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>zhou</groupId>
      <artifactId>execrise</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>execrise</name>
      <url>http://maven.apache.org</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
    <dependency> <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>19.0</version>
    </dependency>
      </dependencies>
      <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
      
      <build>
      <plugins>
        <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>zhou.execrise.App</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                </execution>
            </executions>
         </plugin>
      </plugins>
    </build>
     </project>
    
    
    

    attention

    plugin

            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.2.1</version>
    

    package route

    
     <mainClass>zhou.execrise.App</mainClass>
    
  • 相关阅读:
    easyui-datetimebox设置默认时分秒00:00:00
    分页工具类的封装
    关于查询排序DTO的封装
    android签名生成和发布
    android httpclient 设置超时
    Eclipse 模拟http 请求插件Rest Client
    volley 发送post请求
    mac book 华为C8815不能debug
    android一些小技巧
    PS相关技术
  • 原文地址:https://www.cnblogs.com/otfsenter/p/9224313.html
Copyright © 2011-2022 走看看