Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Profiles</h1> <p>Profiles provide the conditional behaviours of the POM and allows for different builds depending on its properties. A couple of the usual properties used are the JDK, and the operating system. Furthermore, profiles can be activated depending on the existence of particular files.</p> <h2>Generic Property Activation</h2> <p>You can activate a profile when a specific system property is set. Note only properties set on the Maven command line can activate profiles. Properties set in the POM, the parent POM, or other profiles have no effect.</p> <p>To activate a profile when a certain property has a certain value (in this case myproperty=myvalue):</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <property> <name>myproperty</name> <value>myvalue</value> </property> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p>To activate a profile when a certain property exists (regardless of value):</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <property> <name>myproperty</name> </property> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p><br class="atl-forced-newline" /></p> <h2>JDK Activation</h2> <p><br class="atl-forced-newline" /></p> <h2>OS Activation</h2> <p>To configure the activation via the operating system, you can specify at least one out of four items - the project name, family, architecture, and version.</p> <p>The Profile OS activation part is shown below: <br class="atl-forced-newline" /></p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <os> <name>windows xp</name> <family>windows</family> <arch>x86</arch> <version>5.1</version> </os> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p>For the family, architecture, and version properties, these are checked by comparing these values against System.getProperties( "os.name" ), System.getProperties( "os.arch" ), System.getProperties( "os.version" ) respectively. The legal values for these tags are limited to those held by the System properties.</p> <p>However, for the family property, a range of possible values can be used:</p> <table class="confluenceTable"><tbody> <tr> <th class="confluenceTh"><p> Family Value </p></th> <th class="confluenceTh"><p> Condition for Activation </p></th> </tr> <tr> <td class="confluenceTd"><p> windows </p></td> <td class="confluenceTd"><p> if OS name contains the word "windows" </p></td> </tr> <tr> <td class="confluenceTd"><p> os/2 </p></td> <td class="confluenceTd"><p> if OS name contains the word "os/2" </p></td> </tr> <tr> <td class="confluenceTd"><p> netware </p></td> <td class="confluenceTd"><p> if OS name contains the word "netware" </p></td> </tr> <tr> <td class="confluenceTd"><p> dos </p></td> <td class="confluenceTd"><p> if OS family is not "netware", and its path separator is ";" </p></td> </tr> <tr> <td class="confluenceTd"><p> mac </p></td> <td class="confluenceTd"><p> if OS name contains the word "mac" </p></td> </tr> <tr> <td class="confluenceTd"><p> tandem </p></td> <td class="confluenceTd"><p> if OS name contains the word "nonstop_kernel" </p></td> </tr> <tr> <td class="confluenceTd"><p> unix </p></td> <td class="confluenceTd"><p> if OS family is not "openvms" and not "mac" which names does not end with "X", and its path separator is ":" </p></td> </tr> <tr> <td class="confluenceTd"><p> win9x </p></td> <td class="confluenceTd"><p> is OS family is "windows" and OS name contains "95", "98", "me", or "ce" </p></td> </tr> <tr> <td class="confluenceTd"><p> z/os </p></td> <td class="confluenceTd"><p> if OS name contains the word "z/os" or "os/390" </p></td> </tr> <tr> <td class="confluenceTd"><p> os/400 </p></td> <td class="confluenceTd"><p> if OS name contains the word "os/400" </p></td> </tr> <tr> <td class="confluenceTd"><p> openvms </p></td> <td class="confluenceTd"><p> if OS name contains the word "openvms" </p></td> </tr> </tbody></table> <table class="wysiwyg-macro" data-macro-name="warning" data-macro-parameters="title=Warning" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3dhcm5pbmc6dGl0bGU9V2FybmluZ30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>For Maven versions prior to 2.0.6, you need to declare your OS family, name, arch and version all in lower case (see <a href="http://jira.codehaus.org/browse/MNG-2814">MNG-2814</a>).</p></td></tr></table> <h2>File Activation </h2> <p>Controlling activation upon the existence of specific files:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <file> <exists>myfile</exists> </file> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p>Controlling activation upon the absence of specific files:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <missing> <exists>myfile</exists> </missing> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p>The definition of the path <strong>does not support</strong> use of properties, settings or environment variables for Maven 2.0.4. Do not try anything of the form <exists>${user.home}/.m2/com/oracle/ojdbc</exists> instead you will need to hard code the complete path.</p> <h2>Others</h2> <h3>Negation</h3> <p>Prepend "!" on property name, os family, os name, os version and os arch to negate.</p> <p>Meaning</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <property> <name>!myproperty</name> </property> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p>gets executed when myproperty is not defined. And</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><profiles> <profile> <activation> <os> <name>!windows xp</name> <family>!windows</family> <arch>!x86</arch> <version>!5.1</version> </os> </activation> ... </profile> ... </profiles> </pre></td></tr></table> <p>gets evaluated as true when</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>name != "windows xp" AND family != "windows" AND arch != "x86" AND version != 5.1 </pre></td></tr></table> <h3>Active by Default </h3> <p>Set to true to activate by default</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced