Andreas Pinter schrieb:
> Doh.
>
> Hello Felix,
>
> Thank you very much! I knew it was something simple, but I just didn't
> think about this. Thanks again
Good to here it's working now. You could also make the 'mvn antrun:run'
working. You'll need to copy the configuration
part out of the executions and have it as pure plugin configuration. See also
attached pom.xml
Felix
>
> Greetings
> Andreas
>
>
> [email protected] wrote:
>> Hi Andreas
>>
>> You 'attached' the ant script call to the <phase> 'compile' of maven
>> lifecycle. See also [5] for maven lifecycles. Therefor it is enough to
>> run
>> 'mvn install'. This includes 'compile' as phase in its lifecycle and so
>> you're ant script is executed. See also log below (just copied attached
>> pom.xml and build.xml and trun 'mvn install'.
>>
>> [5]
>> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>>
>>
>>
>> HTH
>> Felix
>>
>> $ mvn install
>> [INFO] Scanning for projects...
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Unnamed - my-test-group:my-test-app:jar:1.0-SNAPSHOT
>> [INFO] task-segment: [install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [resources:resources]
>> [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
>> resources, i.e. build is platform dependent!
>> [INFO] skip non existing resourceDirectory /tmp/misc/src/main/resources
>> [INFO] [compiler:compile]
>> [INFO] No sources to compile
>> [INFO] [antrun:run {execution: compile}]
>> [INFO] Executing tasks
>>
>> test:
>> [echo] fooBar
>> [INFO] Executed tasks
>> [INFO] [resources:testResources]
>> [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
>> resources, i.e. build is platform dependent!
>> [INFO] skip non existing resourceDirectory /tmp/misc/src/test/resources
>> [INFO] [compiler:testCompile]
>> [INFO] No sources to compile
>> [INFO] [surefire:test]
>> [INFO] No tests to run.
>> [INFO] [jar:jar]
>> [WARNING] JAR will be empty - no content was marked for inclusion!
>> [INFO] Building jar: /tmp/misc/target/my-test-app-1.0-SNAPSHOT.jar
>> [INFO] [install:install]
>> [INFO] Installing /tmp/misc/target/my-test-app-1.0-SNAPSHOT.jar to
>> /home/felix/.m2/repository/my-test-group/my-test-app/1.0-SNAPSHOT/my-test-app-1.0-SNAPSHOT.jar
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] BUILD SUCCESSFUL
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 3 seconds
>> [INFO] Finished at: Mon Jun 01 22:16:02 CEST 2009
>> [INFO] Final Memory: 18M/74M
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> $ mvn --version
>> Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100)
>> Java version: 1.6.0_14
>> Java home: /opt/sun-jdk-1.6.0.14/jre
>> Default locale: de_CH, platform encoding: UTF-8
>> OS name: "linux" version: "2.6.29-gentoo-r5" arch: "amd64" Family: "unix"
>>
>>
>>> Hello there,
>>>
>>> I'm trying to build a XPI for our current state of the firebug plugin
>>> for the profiling project.
>>> It wouldn't be a real problem to do so by hand, but we want it do be
>>> done via maven.
>>>
>>> According to the link which was postet by Felix Knecht[1], this should
>>> be done very easy via maven-antrun-plugin.
>>> So i built an ant file to do the xpi and want to call it from maven like
>>> shown[2]. Unfortunately the plugin isn't doing anything. To make it
>>> easier to read, is reduced the ant script[3] to make a simple echo.
>>>
>>> The antscript itself runs by calling "ant test".
>>> I call maven with "mvn antrun:run".
>>>
>>> mvn --version profides the following informations for me:
>>>
>>> Maven version: 2.0.10
>>> Java version: 1.6.0
>>> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>>>
>>> I also tried it on the following machine:
>>>
>>> Maven version: 2.0.9
>>> Java version: 1.6.0_0
>>> OS name: "linux" version: "2.6.28-11-generic" arch: "i386" Familiy:
>>> "unix"
>>>
>>> Because i also tried the examples provided on the plugin page[4], I
>>> guess i'm just missing some dependency or so and perhaps some of you
>>> knows where to look for it.
>>>
>>> Kind regards,
>>> Andreas
>>>
>>> [1] -
>>> http://johnjianfang.blogspot.com/2009/03/how-to-use-maven-generate-mozilla.html
>>>
>>> [2] -
>>> http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
>>>
>>> [3] - see attachment
>>> [4] - http://maven.apache.org/plugins/maven-antrun-plugin/index.html
>>>
>>
>>
>>
>
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>my-test-app</artifactId>
<groupId>my-test-group</groupId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<!-- Needed to make 'mvn antrun:run' working -->
<configuration>
<tasks>
<ant antfile="build.xml">
<target name="test"/>
</ant>
</tasks>
</configuration>
<executions>
<!-- execution attached to <phase>xxx</phase> of the maven lifecycle -->
<execution>
<id>compile</id>
<phase>compile</phase>
<configuration>
<tasks>
<ant antfile="build.xml">
<target name="test"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>