hzzc1987 / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Execution of maven-jnaerator-plugin inside the Maven lifecycle #74

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, the maven-jnaerator-plugin cannot be used inside the Maven 
lifecycle. In my particular case, have a header.h file and a jnaerator 
configuration file. When I invoke the jnaerate goal of the plugin directly, 
everything works fine. However, when I want to invoke it as a part of the main 
lifecycle, it does not work. I want to be able to do mvn clean package, instead 
of mvn clean jnaerator:jnaerate package, in order to build my project.

I have researched the problem, and found why it occurs. There are two reasons:
1. The @phase annotation of the com.jnaerator.JNAeratorMojo mojo is wrong. It 
should be @phase generate-sources
2. The plugin does not add its source output directories to the MavenProject 
object.

The sample configuration to demonstrate this is as follows:
<project>
    ...
    <build>
        ...
        <plugins>
            ...
            <plugin>
                <groupId>com.jnaerator</groupId>
                <artifactId>maven-jnaerator-plugin</artifactId>
                <version>0.9.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jnaerate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            ...
        </plugins>
        ...
    </build>
    ...
</project>

Original issue reported on code.google.com by peshev on 4 Nov 2010 at 12:00

Attachments:

GoogleCodeExporter commented 8 years ago
Hi peshev,

Thanks for your report :-)
While your fix proposal seems sound, I have to see how it impacts other 
NativeLibs4Java projects before performing the changes (in particular, the 
files generated for OpenCL4Java are always hand-tweaked, notably because 
they're generated differently on different plaforms - for instance there are 
OpenCL extensions on MacOS X - so I tend to see the manual source generation 
step as a safeguard... but I agree it should be fixed).
Cheers
--
Olivier

Original comment by olivier.chafik@gmail.com on 30 Nov 2010 at 5:17

GoogleCodeExporter commented 8 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/152

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:25