我有这个错误:
Project build error: Non-resolvable parent POM: Could not find artifact com.playtech.simulator:net:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local 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>
最佳答案
通常一个项目的pom在Parent部分有这样的信息,如果你碰巧使用了Eclipse,你可以很容易地看到:
- 组号
- Artifact ID
- 版本
- 相对路径
相对路径是指相对于你的项目文件夹在表单中的位置的路径,例如../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,注意项目设置的位置。
关于java - 不可解析的父 POM : Could not find artifact,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33096948/