Quantcast

Having trouble with maven-antrun-plugin lifecycle phase

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Joe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Having trouble with maven-antrun-plugin lifecycle phase

Joe
This post has NOT been accepted by the mailing list yet.
Used Maven version:
    $ mvn --version
    Apache Maven 3.0.4
    Maven home: /usr/share/maven
    Java version: 1.7.0_25, vendor: Oracle Corporation
    Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
    Default locale: de_DE, platform encoding: UTF-8
    OS name: "linux", version: "3.2.0-57-generic", arch: "i386", family: "unix"

Eclipse 4.2
    Eclipse IDE for Java Developers
    epp.package.java
    1.5.2.20130211-1820

    m2e - Maven Integration for Eclipse
    org.eclipse.m2e.feature.feature.group
    1.3.0.20130129-0926

    m2e - slf4j over logback logging (Optional)
    org.eclipse.m2e.logback.feature.feature.group
    1.3.0.20130129-0926

Releted fragment of my pom.xml:
    <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals><goal>run</goal></goals>
                <configuration>
                    <target>
                        <mkdir dir="${project.build.directory}/classes" />
                        <exec executable="bash" dir="." outputproperty="myversion" failonerror="true"> <arg line="-C InvokeVersion.sh --make-version-string"/> </exec>
                        <propertyfile file="${project.build.directory}/classes/eeo.ews.tts.Tts.buildinfo.properties"> <entry key="build.version" value="${myversion}"/> </propertyfile>
                    </target>
                </configuration>
            </execution>
        </executions>
    </plugin>

The problem is the value of the <phase>generate-sources</phase> tag.
Writing the »generate-sources« completely in lower case makes the build working (e.g. when I enter »mvn install« from commandline). But in eclipse I got an error:
    Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: default, phase: generate-sources)
I got this error message in different places like:
* Maven POM Editor
* Xml Editor
* Problems View

The error message disappears when I simply turn the value of <phase> to »Generate-sources« or »Generate-Sources«. But when doing this, my antrun will not longer called during the build. (No warnings or errors, just the same behaviour as I remove the complete plugin section (<plugin> <artifactId>maven-antrun-plugin</artifactId> ... </plugin>) from my pom.xml).

Could anybody provide help for this problem?

Currently, I use a ugly hack (pluginManagement, lifecycleMappingMetadata, ... like described in http://www.celinio.net/techblog/?p=1395) but that really wastes my pom.xml's.
Loading...