4

I'm trying to run mvn site but I keep getting this error message every time. I've tried googling, but have not found any solutions. I'm currently on a Windows machine running maven from git bash.

[WARNING] Unable to create Maven project for org.crashub:crash.shell:pom:1.3.1 from repository.
org.apache.maven.project.InvalidProjectModelException: Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/classes.jar @ line 98, column 19

My pom-file

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>primecheck</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.3.RELEASE</version>
    </parent>

    <packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>3.4.1</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.8</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
                <dependencies>
                    <dependency>
                        <groupId>lt.velykis.maven.skins</groupId>
                        <artifactId>reflow-velocity-tools</artifactId>
                        <version>1.1.1</version>
                    </dependency>
                    <!-- Reflow skin requires Velocity >= 1.7  -->
                    <dependency>
                        <groupId>org.apache.velocity</groupId>
                        <artifactId>velocity</artifactId>
                        <version>1.7</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </pluginRepository>
        <pluginRepository>
            <id>central</id>
            <name>Maven Plugin Repository</name>
            <url>http://repo1.maven.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

</project>

Running mvn dependency:tree


    [INFO] --- maven-dependency-plugin:2.9:tree (default-cli) @ primecheck ---
    [INFO] com.tomasruud:primecheck:war:1.0.0-SNAPSHOT
    [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.3.RELEASE:compile
    [INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.2.3.RELEASE:compile
    [INFO] |  |  +- org.springframework.boot:spring-boot:jar:1.2.3.RELEASE:compile
    [INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.3.RELEASE:compile
    [INFO] |  |  \- org.yaml:snakeyaml:jar:1.14:compile
    [INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.5:compile
    [INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.5:compile
    [INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.4.5:compile
    [INFO] |  +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
    [INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
    [INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
    [INFO] |  |  \- com.fasterxml:classmate:jar:1.0.0:compile
    [INFO] |  +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
    [INFO] |  +- org.springframework:spring-web:jar:4.1.6.RELEASE:compile
    [INFO] |  |  +- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile
    [INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
    [INFO] |  |  +- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile
    [INFO] |  |  \- org.springframework:spring-context:jar:4.1.6.RELEASE:compile
    [INFO] |  \- org.springframework:spring-webmvc:jar:4.1.6.RELEASE:compile
    [INFO] |     \- org.springframework:spring-expression:jar:4.1.6.RELEASE:compile
    [INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:1.2.3.RELEASE:compile
    [INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.11:compile
    [INFO] |  |  \- org.slf4j:slf4j-api:jar:1.7.11:compile
    [INFO] |  +- org.slf4j:jul-to-slf4j:jar:1.7.11:compile
    [INFO] |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.1:compile
    [INFO] |  +- org.apache.logging.log4j:log4j-api:jar:2.1:compile
    [INFO] |  \- org.apache.logging.log4j:log4j-core:jar:2.1:compile
    [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.2.3.RELEASE:compile
    [INFO] |  +- junit:junit:jar:4.12:compile
    [INFO] |  +- org.mockito:mockito-core:jar:1.10.19:compile
    [INFO] |  |  \- org.objenesis:objenesis:jar:2.1:runtime
    [INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:compile
    [INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:compile
    [INFO] |  \- org.springframework:spring-test:jar:4.1.6.RELEASE:compile
    [INFO] +- org.apache.commons:commons-math3:jar:3.4.1:compile
    [INFO] \- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.3.RELEASE:provided
    [INFO]    +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.20:provided
    [INFO]    +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.20:provided
    [INFO]    +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.20:provided
    [INFO]    \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.20:provided

Puce
  • 37,247
  • 13
  • 80
  • 152
tomas
  • 245
  • 2
  • 10
  • 2
    Side note: I recomment not to specify repositories in your POM files but to use a Maven Repository Manager such as Nexus and to configure the settings file accordingly: http://stackoverflow.com/questions/29821920/weird-issue-running-maven-site-problems-were-encountered-while-processing-the-p – Puce Apr 23 '15 at 11:33
  • Please provide the output (in the git bash) for `java -version`, `javac -version`, `echo $JAVA_HOME` and `echo $M2_HOME` – Puce Apr 23 '15 at 11:38
  • The link is: http://books.sonatype.com/nexus-book/reference/config-maven.html#ex-maven-nexus-simple – Puce Apr 23 '15 at 11:43
  • @Puce `java -version` shows `java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)`, `javac -version` shows `javac 1.8.0_25`, `echo $JAVA_HOME` shows `C:\Program Files\Java\jdk1.8.0_25` and `echo $M2_HOME` shows `C:\dev\apache-maven-3.3.1` – tomas Apr 23 '15 at 11:44
  • That looks fine, I think. What Maven command did you execute? Also please provide the output (in the question not as a comment) of `mvn dependency:tree` as it's not clear to me where crash.shell and the system dependency are coming from and if they are related. – Puce Apr 23 '15 at 11:50
  • I've just been running `mvn site`. Added the `mvn dependency:tree` output to the post. – tomas Apr 23 '15 at 11:56
  • Do you know how the crash.shell POM file is related to your project? Also please comment out the dependencies form the Site Plugin and rerun again. Do you still have the error then? – Puce Apr 23 '15 at 12:00
  • I have no idea to be honest. I still get the error even when I remove the entire site-plugin group. – tomas Apr 23 '15 at 12:08

1 Answers1

0

I have found these 2 related issues:

https://jira.exoplatform.org/browse/CRASH-225

https://jira.codehaus.org/browse/MSHADE-185

So the cause seems to be in the Maven Shade Plugin: the CRaSH POM seems to use the Shade Plugin and then has the wrong, hardcoded systemPath.

According to http://www.crashub.org/:

CRaSH is officially embedded as Spring Boot remote shell.

So org.crashub:crash.shell:pom:1.3.1 seems to be related to Spring Boot, but I don't know what is meant by the warning: "Unable to create Maven project for [...]"

EDIT

Try to add the following dependency to your POM:

<dependency>
    <groupId>com.sun</groupId>
    <artifactId>tools</artifactId>
    <version>1.8</version>
    <scope>system</scope>
    <systemPath>${java.home}/../lib/tools.jar</systemPath>
    <optional>true</optional>
</dependency>
Puce
  • 37,247
  • 13
  • 80
  • 152
  • From what I can see, is spring-boot-starter-parent using Shade [pom.xml](https://github.com/spring-projects/spring-boot/blob/master/spring-boot-starters/spring-boot-starter-parent/pom.xml) – tomas Apr 23 '15 at 12:32
  • @Tom it's the CRaSH POM which uses the Shade Plugin and has the wrong, hardcoded systemPath, I think: https://repo1.maven.org/maven2/org/crashub/crash.shell/1.3.1/crash.shell-1.3.1.pom – Puce Apr 23 '15 at 12:37
  • @Tomas See my edited answer. Not sure it works, though. – Puce Apr 23 '15 at 12:47
  • @Tomas I'm not sure if there is a work around. I suggest to join the discussions at the mentioned issues. – Puce Apr 23 '15 at 12:55