Dominik Reinert
Dominik Reinert

Reputation: 895

Why is maven running the same pom differently on two computers?

Me and my workmate are trying to call the same Maven command (mvn site) on exactly the same pom and getting totally different output.

The code of which we think is going wrong, is the javadoc-plugin we added lately:

    <!-- https://maven.apache.org/plugins/maven-javadoc-plugin/ -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.javadoc.plugin}</version>
        <configuration>
          <destDir>javadoc</destDir>
          <charset>UTF-8</charset>
          <docencoding>UTF-8</docencoding>
          <doctitle>${project.name} API Documentation
            ${project.version}.${svn_revision}</doctitle>
          <encoding>UTF-8</encoding>
          <failonerror>false</failonerror>
          <footer>Specification: ${specification.title}</footer>
          <header>${project.name} API Documentation
            ${project.version}.${svn_revision}</header>
          <source>1.8</source>
          <use>true</use>
          <version>true</version>
          <windowtitle>${project.name} API Documentation
            ${project.version}.${svn_revision}</windowtitle>
          <additionalparam>-Xdoclint:none</additionalparam>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>deploy</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Running this gets me the correct javadoc-generation in the targeted folder. When I pushed it to the svn repository and my mate downloaded, it was not working for him.

There is no Error and no warning, it just does not generate the javadoc.

Additional info:

  1. We are not using any local settings.xml.
  2. The output of mvn site -X (debug mode) does not make any difference regarding the javadoc-plugin.
  3. He already reinstalled jdk and re-set his $JAVA_HOME.
  4. Same Maven version

What could be the problem?

Thank you in advance

Upvotes: 1

Views: 238

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328624

Run mvn -v to make sure you're using the same Maven and Java versions. The command will print the paths to the Java runtime, make sure they are same and correct.

If that checks out, run mvn help:effective-pom to see what Maven will execute. Redirect the output on both machines to a file and compare them.

Next, try to invoke the plugin directly from the command line. If that works, attaching to the life cycle doesn't work for some reason. If it doesn't work, check for error messages and use -X to check the plugin configuration.

If everything else fails, delete your local Maven repository (or at least the involved plugins).

Upvotes: 2

Related Questions