maven对项目编译时报错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project video: Error reading assemblies: No assembly descriptors found. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

因为pom.xml中缺少

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <configuration>
    <archive>
      <manifest>
        <mainClass>com.test.MainClassName</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>

添加上之后成功编译

相关文章:

  • 2021-09-20
  • 2022-01-01
  • 2021-08-06
  • 2021-07-13
  • 2018-02-02
  • 2021-07-07
  • 2021-12-13
  • 2021-09-15
猜你喜欢
  • 2021-10-19
  • 2021-08-16
  • 2021-04-03
  • 2021-08-28
  • 2021-08-28
  • 2021-07-31
  • 2018-02-02
  • 2021-12-13
相关资源
相似解决方案