Having trouble with maven-antrun-plugin lifecycle phase

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

Having trouble with maven-antrun-plugin lifecycle phase

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

    m2e - Maven Integration for Eclipse

    m2e - slf4j over logback logging (Optional)

Releted fragment of my pom.xml:
                        <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>

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.