我试图运行mvn网站,但每次都会收到此错误消息。我试过谷歌搜索,但没有找到任何解决方案。我目前在使用git bash运行maven的Windows机器上。
[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
我的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>
正在运行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
答案 0 :(得分:0)
我发现了这两个相关的问题:
https://jira.exoplatform.org/browse/CRASH-225
https://jira.codehaus.org/browse/MSHADE-185
所以原因似乎是在Maven Shade插件中:CRaSH POM似乎使用Shade插件然后有错误的,硬编码的systemPath。
CRaSH正式嵌入Spring Boot远程shell。
所以org.crashub:crash.shell:pom:1.3.1似乎与Spring Boot有关,但我不知道警告的意思是什么:“无法为[...]创建Maven项目“
修改强>
尝试将以下依赖项添加到您的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>