Sylla
Sylla

Reputation: 103

Failure: org.apache.maven plugins:maven-jar-plugin:2.6:test-jar

I'm trying to compile a project but I'm running into a Maven plugin error.

I use Apache Maven 3.3.9 and java-9-openjdk, with the command

mvn clean install -DskipTests=true

but that fails with the following message:

Error: Failed to execute goal org.apache.maven plugins:maven-jar-plugin:2.6:test-jar

Do I have to modify my pom file?

 <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <sourcepath>*/target/generated-sources/mdsal-binding/*</sourcepath>
          <excludePackageNames>*</excludePackageNames>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Upvotes: 0

Views: 289

Answers (2)

Vasanth Saminathan
Vasanth Saminathan

Reputation: 585

Since you are using -DskipTests=true it is trying to avoid test. That subsequently fails to generate the test-jar.

Either you could comment out the test jar goal. Else do not skip the tests.

Upvotes: 1

Stephen Kitt
Stephen Kitt

Reputation: 2881

Based on the mention of mdsal-binding in your POM, you’re trying to build an OpenDaylight project (I’m guessing either coretutorials or transportpce) with JDK 9. We don’t support that yet; you must build with JDK 8.

Upvotes: 2

Related Questions