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>
    
  • 相关阅读:
    asp.net中session的原理及应用
    通过SessionID和用户名来保证同一个用户不能同时登录(单点登录)
    ASP.NET中application对象的用法
    Tornado Web 框架
    LinkCode 下一个排列、上一个排列
    python版本与编码的区别
    python基本数据类型——set
    python基本数据类型——int
    python基本数据类型——str
    python基本数据类型——list
  • 原文地址:https://www.cnblogs.com/otfsenter/p/9224313.html
Copyright © 2011-2022 走看看