How to toggle between one maven profile and another?

If I have a maven profile activated by the presence of a property, how can I define another profile that is only activated when the other profile is not activated?

e.g.

    <profile>
        <activation>
            <property>
                <name>myproperty</name>
                <value>value</value>
            </property>
        </activation>
        ...
    </profile>


    <profile>
        <activation>
            <property>
                <name>myproperty</name>
                <value></value> <!-- Anything other than "value"  -->
            </property>
        </activation>
        ...
    </profile>


Asked by: Roman325 | Posted: 21-01-2022






Answer 1

It seems the answer is

<value>!value</value>

Answered by: Stuart845 | Posted: 22-02-2022



Similar questions

java - Using TPTP to profile an Eclipse Plugin

I’m currently trying to profile an Eclipse Plugin using the TPTP tools. However, I have run into issues when trying to profile an plugin. I can profile a Java application fine, however when I try to profile an plugin, the runtime workbench fails to load and the profiling terminates after a few seconds. I’m at a lost to what I’m doing wrong; I’m using Eclipse 3.4.0 and have the following TPTP features inst...


java - How can I profile tomcat on mac os X?

I am running an independent (I mean not inside any IDE) tomcat instance. I want to profile my application because it seams to respond really slow in a particular use case. So, I tried installing TPTP on my mac os x 10.4 (tiger) but it seams that there is no version available. Then I tried to just set "JAVA_OPTS="-Xmx512m -XrunpiAgent:server=enabled" in tomcat/bin/setenv.sh but it threw the following error:


java - Maven profile for single module

I have a multi module maven project, which builds successfully, I'd like to build just one of the modules I have. How would I do that with profiles ? I could do it from console in two ways, one way is go to the child module and mvn package or I could use reactor to build just one module.


profile java memory use on linux

i have a socket server written in java, and i believe there is a memory leak. The i could not find anything in Netbeans' profiler, so i want to test it when it in deployed on my ubuntu server. How do i do this? What is an easy to install and use java profiler for ubuntu?


java - How can I profile my Android app?

Closed. This question needs to be more focused. It ...


java - adding user to user groups based on user profile in LDAP using Liferay

I would like to add user to groups created in liferay based on user profile i got from the LDAP using Liferay framework. For example : If userX logging into liferay and if abc attribute set to Y i need to add him to UserGroup abc created in Liferay. If userY logged into liferay and if pqr attribute set to Y i need to add him to UserGroup pqr created in Liferay. to implement this feature wha...


java - How to profile server in Eclipse GWT project?

I created a standard GWT project in Eclipse and now I have a huge performance problem in the server side code. I can only find instructions on how to use Speedtracer to profile the actual GWT application, but I want to configure Eclipse to profile the server. I am using the server from the GWT SDK.


java - How to Profile JVM memory in the code?

I am writing a servlet that I can't test in Eclipse, I need to run on server. I want to do memory profiling and pinpoint any leaks. So, I think I need write debug statements that can tell me current memory usage. Can someone point me to good references on how to do this and/or which classes in the JDK do this ? Note that I can't use the "Eclipse MAT".


java - How do I profile the EDT in Swing?

I have an application that I'm building in Swing. It has a scrollable and zoomable chart component which I can pan and zoom in. The whole thing is smooth except that sometimes the UI will pause for about 750 ms and I don't know why. This doesn't always happen - but sometimes something happens in the application and it starts pausing like this once every 6-8 seconds. It seems pretty clear that there's some event ...


java - maven profile for OS version range

Is it not possible to define an OS version range in a maven profile? &lt;profile&gt; &lt;id&gt;mac lion&lt;/id&gt; &lt;activation&gt; &lt;os&gt; &lt;family&gt;mac&lt;/family&gt; &lt;version&gt;[10.7.0,)&lt;/version&gt; &lt;/os&gt; &lt;/activation&gt; &lt;/profile&gt;






Still can't find your answer? Check out these amazing Java communities for help...



Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)



top