4

我尝试使用 build-helper-maven 插件附加由 jaxb 或 cxf 生成的源目录。不幸的是,即使我在 mvn generate-sources 中取得了成功,我的 eclipse 也没有将目标目录添加为源文件夹。

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>${project.build.directory}/generated/cxf</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

日志 :

    [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ coucou-services ---
[INFO] Deleting D:\004_Development\coucou\Workspace\coucou-bom\coucou-services\target
[INFO] 
[INFO] --- cxf-codegen-plugin:2.4.6:wsdl2java (generate-sources) @ coucou-services ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (add-source) @ coucou-services ---
[INFO] Source directory: D:\004_Development\coucou\Workspace\coucou-bom\coucou-services\target\generated\cxf added.
[INFO] 
[INFO] -

你有什么主意吗 ?

此致

4

1 回答 1

2

Eclipse 的 M2 插件将更好地解释该build部分中的声明。尝试这个:

<build>
    <sourceDirectory>${project.build.directory}/generated/cxf</sourceDirectory>
</build>
于 2017-08-29T12:11:28.920 回答