【idea打完jar包后,在dos窗口里运行jar包 _maven 】 | IT修真院·坑乎
问题已收录 idea打完jar包后,在dos窗口里运行jar包
我也踩过这个坑( 1 )
已统计您的踩坑,无需重复点击
回答(1)
maven
详细描述
错误截图
编辑于2024-11-23
  • [郑州|荣耀师兄]JAVA-张亚强
    2

    打包需要用添加插件的,如下所示,再pom.xml中添加插件,并在</mainClass>节点处指定main方法位置即可。

      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.5.5<version>
          <configuration>
            <archive>
              <manifest>
                <mainClass>com.AppTest</mainClass>
              </manifest>
            </archive>
            <descriptorRefs>
              <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
          </configuration>
          <executions>
            <execution>
              <id>make-assembly</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins> 


    编辑于2018-10-12