I am new to maven. I have written build scripts using ant. I am trying to display all the evn properties, user defined properties, system properties etc. in maven. In ant i could do the following .
I tried to do the same with maven with the maven-antrun-plugin
But get the following error.
Embedded error: Could not create task or type of type: echoproperties.
Ant could not find the task or a class this task relies upon.
How can i see all properties in maven with or without using echoproperties. This is my configuration in maven
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.plugin.antrun.version}</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Displaying value of properties</echo>
<echo>[org.junit.version] ${org.junit.version}</echo>
<echoproperties prefix="org" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Works fine for me with maven 2.2.1 and 3.0.1. Snippet of the run...
[INFO] --- maven-antrun-plugin:1.6:run (default) @ myproject ---
[INFO] Executing tasks
main:
[echoproperties] #Ant properties
[echoproperties] #Sun Dec 26 20:08:02 IST 2010
[echoproperties] org.aspectj\:aspectjrt\:jar=D\:\\maven\\.m2\\repository\\org\\a
spectj\\aspectjrt\\1.6.8\\aspectjrt-1.6.8.jar
[echoproperties] org.aspectj\:aspectjweaver\:jar=D\:\\maven\\.m2\\repository\\or
g\\aspectj\\aspectjweaver\\1.6.8\\aspectjweaver-1.6.8.jar
...
Which version of maven are you using (latest is 3.0.1)? Which version of maven-antrun-plugin (latest is 1.6)?
The latest version of maven-antrun-plugin gives a deprecated warning for <tasks> tag. <target> should be used instead.
<configuration>
<target>
<echoproperties prefix="org" />
</target>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With