We've specified a bunch of system properties in our maven compiler plugin definition within pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>${project.build.sourceEncoding}</encoding>
<systemProperties>
<systemProperty>
<key>aKey</key>
<value>aValue</value>
</systemProperty>
</systemProperties>
<!-- ....etcetera.... -->
These are automatically loaded when the jar is executed
How does Maven create this auto-load behaviour for system properties? I'd like to understand the practical implementation of this behaviour.
This is not behaviour I would expect (unless I am misunderstanding you). Compile-time system properties should not be persisted at runtime.
I created a basic maven project that just prints out the system properties and it did not contain the system property specified in plugin configuration.
System.getProperties().getProperty("aKey")returnednullat runtime even with compiler plugin configured the same as yours.Any other plugins running that might have an effect? How are you accessing the system properties?