I'm using Maven 3.0.3 with JUnit 4.8.1. In my JUnit test, how do I read the project.artifactId defined in my Maven pom.xml file? In my pom, I have
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myco.pplus2</groupId>
<artifactId>pplus2</artifactId>
But this isn't working within my JUnit test to gete the artifact id ...
@Before
public void setUp() {
...
System.out.println( "artifactId:" + System.getProperty("project.build.sourceEncoding") );
} // setUp
The above outputs "artifactId:null". Anyway, appreciate any help, - Dave