Print all of the environment variables from a maven build


/ Published in: XML
Save to your folder(s)

Prints names and values of all the environment variables from a context of maven build using maven-antrun-plugin and echoproperties maven task


Copy this code and paste it in your HTML
  1. <project>
  2. <!--
  3. ...
  4. Put your project's GAV and dependencies here
  5. ...
  6. -->
  7. <build>
  8. <plugins>
  9. <plugin>
  10. <groupId>org.apache.maven.plugins</groupId>
  11. <artifactId>maven-antrun-plugin</artifactId>
  12. <version>1.6</version>
  13. <executions>
  14. <execution>
  15. <id>ini</id>
  16. <phase>initialize</phase>
  17. <goals>
  18. <goal>run</goal>
  19. </goals>
  20. <configuration>
  21. <!-- for plugin version < 1.5 <target> doesn't work - use <tasks> instead -->
  22. <target>
  23. <property environment="env" />
  24. <echoproperties prefix="env." />
  25. </target>
  26. </configuration>
  27. </execution>
  28. </executions>
  29. </plugin>
  30. </plugins>
  31. </build>
  32. </project>

URL: mvn-antrun-printenv

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.