Maven 子项目找不到具有relativePath的父项目

Maven 子项目找不到具有relativePath的父项目,maven,docker,build,dependencies,gitlab-ci,Maven,Docker,Build,Dependencies,Gitlab Ci,我已经创建了一个项目父项目,用于管理子项目中的依赖项和版本,请参见pom.xml <groupId>myCompany</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> 这就是我在建立firstChild之后犯的错误 imag

我已经创建了一个项目父项目,用于管理子项目中的依赖项和版本,请参见pom.xml

<groupId>myCompany</groupId>
    <artifactId>parent</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
这就是我在建立firstChild之后犯的错误

image: appinair/jdk11-maven

variables:
  MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
  MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"

cache:
  paths:
    - target/

build:
  stage: build
  script:
    - mvn $MAVEN_CLI_OPTS clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
  artifacts:
      paths:
        - target/
        - .m2/repository/
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for myCompany:firstChild:[unknown-version]: Could not find artifact myCompany:parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 10
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project myCompany:firstChild:[unknown-version] (/builds/compiere-ws/firstChild/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for myCompany:firstChild:[unknown-version]: Could not find artifact myCompany:parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
ERROR: Job failed: exit code 1
你知道吗

附言:


请注意,第一个子目录在我的本地服务器或jenkins中正确生成,而不是仅在gitlab ci中生成

将组位置用作父目录,而不是将同级目录用作父目录。这不是逻辑。。。您所需的顺序是不可能的,也没有意义…父级不包含任何代码,因此父级是在生成子级之后生成的第一个。请使用组位置作为父级,而不是同级目录作为父级。这不是逻辑。。。您所需的顺序是不可能的,也没有意义…父级不包含任何代码,因此父级是第一个正在生成的,然后将生成子级。
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for myCompany:firstChild:[unknown-version]: Could not find artifact myCompany:parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 10
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project myCompany:firstChild:[unknown-version] (/builds/compiere-ws/firstChild/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for myCompany:firstChild:[unknown-version]: Could not find artifact myCompany:parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
ERROR: Job failed: exit code 1