Strange issue starting maven site (problems occurred while processing POM)

I am trying to run the mvn site but every time I get this error message. I tried googling but didn't find any solutions. I am 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

+3


source to share


1 answer


I found these 2 related problems:

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

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

So the reason seems to be in the Maven Shade Plugin: CRaSH POM seems to use the Shade plugin and then has the wrong hard-coded systemPath.

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



CRaSH is officially built 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 adding 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>

      

0


source







All Articles