Maven проект не строит в родительском - PullRequest
0 голосов
/ 17 июня 2019

Запуск $mvn clean install работает, когда я запускаю из папки, содержащей pom, но когда я поднимаюсь на уровень папки и запускаю ту же команду, я получаю следующую ошибку:

[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building xsdtools 4.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xsdtools ---
[INFO] Deleting /home/myUser/Development/gitRepo/xxx_project/project/xsdtoolFolder/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.1:enforce (enforce-versions) @ xsdtools ---
[INFO] 
[INFO] --- jaxb2-maven-plugin:2.1:xjc (xjc) @ xsdtools ---
[INFO] Adding 'extension' flag to XJC arguments, since the 'generateEpisode' argument is given. (XJCs 'episode' argument requires that the 'extension' argument is provided).
[INFO] Ignored given or default xjbSources [/home/myUser/Development/gitRepo/xxx_project/project/xsdtoolFolder/src/main/xjb], since it is not an existent file or directory.
[ERROR] null [-1,-1] 
java.io.FileNotFoundException: /home/myUser/Development/gitRepo/xxx_project/project/src/main/xsd/MyProjectV3.xsd (No such file or directory)
    at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:232)

Pomфайл имеет следующее:

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>jaxb2-maven-plugin</artifactId>
      <version>2.1</version>

      <executions>
        <execution>
          <id>xjc</id>
          <goals>
            <goal>xjc</goal>
          </goals>
        </execution>
      </executions>

      <configuration>
        <!-- The package of your generated sources -->
        <sources>
          <source>src/main/xsd/MyProjectV3.xsd</source>
        </sources>
      </configuration>
    </plugin>
  </plugins>
</build>

и моя структура файла

xxx_project
  |
  -pom.xml
  -project
    |
    -pom.xml
    -src
      |
      -main
         |
         -xsd
           |
           -MyProjectV3.xsd

Как сделать успешную сборку независимо от того, из какого каталога я запускаюсь?

...