我有这个错误:
项目构建错误:不可解析的父POM:找不到工件com.playtech.simulator:net:pom:1.0-SNAPSHOT和'parent.relativePath'指向错误的本地POM
<?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">
<parent>
<groupId>com.playtech.simulator</groupId>
<artifactId>net</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.playtech.simulator.net</groupId>
<artifactId>server</artifactId>
<dependencies>
<dependency>
<groupId>com.ogp</groupId>
<artifactId>com.playtech.openapi.core</artifactId>
<version>${ogw.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.2.RELEASE</version>
</dependency>
<dependency>
<groupId>com.playtech.simulator</groupId>
<artifactId>simulator-app</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ogp</groupId>
<artifactId>com.playtech.openapi.core.hazelcast</artifactId>
<version>${ogw.version}</version>
</dependency>
<dependency>
<groupId>com.ogp</groupId>
<artifactId>com.playtech.openapi.core.frontend.http.socketio</artifactId>
<version>${ogw.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>attached</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.playtech.openapi.simulator.SimulatorServer</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
答案 0 :(得分:0)
通常,Parent部分中的项目pom具有此信息,如果您碰巧使用Eclipse,则可以轻松查看该信息:
相对路径表示路径尊重项目文件夹在表单中的位置,例如../main-project/parent
在你的pom中,<parent>
声明中应该有另一行:
<parent>
<groupId>com.playtech.simulator</groupId>
<artifactId>net</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>path-to-your-parent-project</relativePath>
</parent>
所以修改你的pom,注意项目的设置位置。
答案 1 :(得分:0)
安装:
<groupId>com.playtech.simulator</groupId>
<artifactId>net</artifactId>
<version>1.0-SNAPSHOT</version>
答案 2 :(得分:0)
您可以在项目中禁用Maven支持并手动提供这些依赖关系。这可能是因为pom.xml没有获得父pom。希望它有帮助