Дочерний проект не находит родителя с родственником - PullRequest
0 голосов
/ 16 апреля 2019

Я создал родительский проект, используемый для управления зависимостями и версией в дочерних проектах, см. Pom.xml

<groupId>myCompany</groupId>
    <artifactId>parent</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

Чем я создал дочерний проект, унаследованный от родителя, см. Pom.xml

<parent>
<groupId>myCompany</groupId>
    <artifactId>parent</artifactId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>filrstChild</artifactId>
<name>filrst Child</name>

Обратите внимание, что два проекта находятся в одной папке

  • группа:
    • родитель
    • FirstChild

PS:

дочерние проекты уже существуют до родительских, поэтому архитектура не с нуля, поэтому я не использовал стандартный способ создания родительских и модулей

с gitlab-ci я пытаюсь построить firstChild, после создания родительского

Итак, родительская сборка корректна, но firstChild не строит

это мой gitlab-ci на 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/

И это ошибка, которую я получил после сборки firstChild

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

Итак, есть идеи?

PS:

Обратите внимание, что firstChild правильно собирается на моем локальном сервере или с jenkins, он не собирается только с помощью gitlab-ci

...