使用build-helper-maven

时间:2017-08-28 08:51:52

标签: eclipse maven build-helper-maven-plugin

我尝试使用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] -
你知道吗?

祝你好运

1 个答案:

答案 0 :(得分:2)

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

<build>
    <sourceDirectory>${project.build.directory}/generated/cxf</sourceDirectory>
</build>