cxf-xjc로 webservice 아티팩트를 생성하고 build-helper 플러그인으로 소스에 추가하려고합니다. 이것은 하나의 Maven 프로젝트에서 사용되었을 때 제대로 작동했지만 다중 모듈 프로젝트로 옮겨 졌으므로 생성 된 클래스는 소스로 포함되지 않습니다.다중 모듈 프로젝트의 소스를 포함하지 않는 Maven 빌드 도우미 플러그인
클래스가 올바르게 생성되고 클래스가 생성 된 후 빌드 도우미 플러그인이 실행 중입니다. 빌드 도우미에 대한 출력은 클래스가있는 올바른 소스 디렉토리 경로를 보여주고 '추가됨'을 보여줍니다.
의 pom.xml
<!-- CXF -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<id>generate-xsd-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<sourceRoot>${basedir}/target/generated-sources/java</sourceRoot>
<xsdOptions>
<xsdOption>
<!-- <bindingFile>src/main/resources/request.xjb</bindingFile> -->
<xsd>src/main/resources/request.xsd</xsd>
<packagename>${services.package}.package.request</packagename>
</xsdOption>
<xsdOption>
<!-- <bindingFile>src/main/resources/response.xjb</bindingFile> -->
<xsd>src/main/resources/response.xsd</xsd>
<packagename>${services.package}.package.response</packagename>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
<!-- Move generated to source -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
콘솔
[INFO] --- **cxf-xjc-plugin:2.3.0:xsdtojava (generate-xsd-sources) @ aggregation-jaxrs-api** ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ aggregation-jaxrs-api ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ aggregation-jaxrs-api ---
[INFO] Compiling 55 source files to C:\workspace\aggregation-parent\aggregation-jaxrs-api\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ aggregation-jaxrs-api ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ aggregation-jaxrs-api ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ aggregation-jaxrs-api ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ aggregation-jaxrs-api ---
[INFO] Building jar: C:\workspace\aggregation-parent\aggregation-jaxrs-api\target\aggregation-jaxrs-api-1.0-SNAPSHOT.jar
[INFO]
**[INFO] --- build-helper-maven-plugin:1.12:add-source (add-source) @ aggregation-jaxrs-api ---
[INFO] Source directory: C:\workspace\aggregation-parent\aggregation-jaxrs-api\target\generated-sources\java added.**
이 구성 모듈로 이동하기 전에 나에게 좋은 일을 싹둑. 필자는 생성 소스와 프로세스 소스 단계 사이에 빌드 - 도우미 단계로 변경했습니다. Eclipse Neon 4.6.1을 기반으로하는 Spring Tool Suite 3.8을 사용하고 있습니다.
감사합니다.