maven编译生成的jar包运行出现 "Failed to load Main-Class manifest attribute from"

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app-simple</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
  <name>my-app-simple</name>
  <url>http://maven.apache.org</url>
    <build>
  <plugins>
   <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                                  <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                                  <mainClass>s.b.App</mainClass>
                        </manifest>
                    </archive>
              </configuration>
</plugin>
</plugins>
</build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

 

红色为增加的配置段

posted @ 2013-10-23 11:53  google4y  阅读(1185)  评论(0编辑  收藏  举报
不在家,就在公司,不在公司,就在去公司的路上,無家無根,如風如萍,只有漂