简体   繁体   中英

How to add resources created by idlj-maven-plugin to the generate-sources phase

I am trying to generate source files by using the idlj-maven-plugin. I have configured the plugin in the following way:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>idlj-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <compiler>idlj</compiler>
                    <includeDirs>
                        <includeDir>/additionalIdlFiles</includeDir>
                    </includeDirs>
                </configuration>
            </plugin>
            </plugins>
    </pluginManagement>
</build>

It works fine (it generates source files) when I'm using the following command in terminal:

mvn idlj:generate

However I would like to make this plugin work during the generate-sources phase. How can I do that? I have tried to specify the phase like below:

<phase>generate-sources</phase>

But it does not work. The: mvn generate-resources does not create any source files from idl files.

This is from a POM I use, and "mvn generate-sources" invokes the IDL compiler just fine.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>idlj-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <debug>true</debug>
            </configuration>
        </execution>
    </executions>
</plugin>

要执行该插件,您的插件必须驻留在<build><plugins>而不是在<build><pluginManagement><plugins>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM