Reputation: 51
I'm working on a project that uses Maven and Eclipse. In this project I have some artifacts (like jar's, war's and so on) and want to add some features (or 'attributes') to those artifacts. (simple string fields)
Some of these attributes could be something like a "problem-description" tag. I'm wondering about the possibility of adding these attributes into their own pom.xml associated files.
So, here is my question: there's a way to add customized tags at pom.xml?
If not, could I modify the maven configuration to point to other XML Schema modified by me (to add the validation of the attribute created by me)?
I'm using Maven 3.0.5
Thanks in advance
Upvotes: 5
Views: 6520
Reputation: 8160
you can define properties in pom.xml like this:
<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.domain.example</groupId>
<artifactId>example-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.compiler.version>1.6</project.build.compiler.version>
<myProperty>myValue</myProperty>
</properties>
</project>
so within pom.xml or a filtered file you can use ${myProperty} to have maven fill in "myValue"
if you want to use a plugin this guide may help: http://maven.apache.org/guides/mini/guide-configuring-plugins.html - within the configuration section you can do almost anything.
Upvotes: 8