When setting a dependency. Let's assume the following
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
Where does the
${plugin.testrunner.version}
variable get initialized? Is there a properties file or where does it gets it value?
To refer to environment variables from the pom. xml, we can use the ${env. VARIABLE_NAME} syntax. We should remember to pass the Java version information via environment variables.
What is a POM? A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects.
Properties can be defined in a POM or in a Profile. The properties set in a POM or in a Maven Profile can be referenced just like any other property available throughout Maven. User-defined properties can be referenced in a POM, or they can be used to filter resources via the Maven Resource plugin.
This should be intialised in a properties section, at the same level as your dependencies section, eg
<project>
<properties>
<plugin.testrunner.version>1.0</plugin.testrunner.version>
</properties>
...
<dependencies>
...
</dependencies>
</project>
If you have a multi project application with a parent pom.xml it's common to put all your properties in there so they can be used by all of the individual poms.
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