Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Possible Solution</h2> <p>Try this extension: <a href="https://github.com/kpiwko/el-profile-activator-extension" rel="nofollow">https://github.com/kpiwko/el-profile-activator-extension</a></p> <p>This allows to have such syntax:</p> <pre><code>&lt;profile&gt; &lt;id&gt;NOrth Pole DEV&lt;/id&gt; &lt;activation&gt; &lt;property&gt; &lt;!-- mvel property name is obligatory --&gt; &lt;name&gt;mvel&lt;/name&gt; &lt;value&gt;isdef location &amp;amp;&amp;amp; location=="NorthPole" &amp;amp;&amp;amp; isdef environment &amp;amp;&amp;amp; environment=="DEV"&lt;/value&gt; &lt;/property&gt; &lt;/activation&gt; &lt;/profile&gt; </code></pre> <p>I did not try it myself, but seems to be a nice project.</p> <h2>How to avoid manual configuration of Maven</h2> <p>You need to put the needed two jars of the project into $MAVEN_HOME/lib/ext. You can however automize configuring them. Like this:</p> <ul> <li>You can add a profile which is <a href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html" rel="nofollow">activated on absense</a> of $MAVEN_HOME/lib/ext/el-profile-activator-extension.jar file</li> <li>This profile can download the jars from maven using <a href="http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html" rel="nofollow">dependency plugin</a> into the $MAVEN_HOME/lib/ext folder in init phase</li> <li>Then you can write out a message, that the build configured the maven folder, and the next build will be successful.</li> </ul> <p>Tested profile:</p> <pre><code>&lt;profile&gt; &lt;id&gt;prepare-maven-extended-libs&lt;/id&gt; &lt;activation&gt; &lt;file&gt; &lt;missing&gt;${maven.home}/lib/ext/el-profile-activator-extension.jar&lt;/missing&gt; &lt;/file&gt; &lt;/activation&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;2.8&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;copy&lt;/id&gt; &lt;phase&gt;validate&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;copy&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;com.redhat.jboss.maven&lt;/groupId&gt; &lt;artifactId&gt;el-profile-activator-extension&lt;/artifactId&gt; &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;overWrite&gt;true&lt;/overWrite&gt; &lt;outputDirectory&gt;${maven.home}/lib/ext&lt;/outputDirectory&gt; &lt;destFileName&gt;el-profile-activator-extension.jar&lt;/destFileName&gt; &lt;/artifactItem&gt; &lt;artifactItem&gt; &lt;groupId&gt;org.mvel&lt;/groupId&gt; &lt;artifactId&gt;mvel2&lt;/artifactId&gt; &lt;version&gt;2.1.3.Final&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;overWrite&gt;true&lt;/overWrite&gt; &lt;outputDirectory&gt;${maven.home}/lib/ext&lt;/outputDirectory&gt; &lt;destFileName&gt;mvel2.jar&lt;/destFileName&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;outputDirectory&gt;${project.build.directory}/wars&lt;/outputDirectory&gt; &lt;overWriteReleases&gt;true&lt;/overWriteReleases&gt; &lt;overWriteSnapshots&gt;true&lt;/overWriteSnapshots&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.gmaven&lt;/groupId&gt; &lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt; &lt;version&gt;1.4&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;validate&lt;/phase&gt; &lt;goals&gt;&lt;goal&gt;execute&lt;/goal&gt;&lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;source&gt; fail("For profile activation we use an extension jar. It is now in your ${maven.home}/lib/ext folder. Please restart the build, and then it will be successful.") &lt;/source&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload