3 Replies Latest reply on Jul 27, 2012 4:14 AM by Lukáš Fryč

    Deactivation of Maven's property-activated profile fails

    Lukáš Fryč Master

      I have created sample project to reproduce the issue.

       

      This first sample works fine - you can activate/deactivate profiles as you want, dependencies will be resolved fine:

      https://github.com/lfryc/m2e-profile-activation-test/blob/master/pom.xml

       

      But with second sample, I have added property activation to both profiles.

      https://github.com/lfryc/m2e-profile-activation-test/blob/property-activation/pom.xml

       

      Command-line usage is then:

      $ mvn install (for JSF RI)

      or

      $ mvn install -Djsf_profile=myfaces (for MyFaces)

       

      But when used with M2E, property activation is not supported.

      Thus I activate myfaces profile and deactivate jsf_ri profile.

      Leading into following setup: "!jsf_ri, myfaces"

       

      I expect only myfaces profile dependencies imported, but both, jsf_ri and myfaces dependencies are imported in this case.

       

      ----

       

      Am I doing something wrong? Is this expected to work?

       

      Can be profile deactivated no matter what activation it defines in POM?

        • 1. Re: Deactivation of Maven's property-activated profile fails
          Lukáš Fryč Master

          I have found M2E works fine when used activeByDefault instead of activation property.

          https://github.com/lfryc/m2e-profile-activation-test/blob/default-activation/pom.xml#L12

           

          But this wouldn't work in bigger project, where several profiles must be activated together with default jsf_ri profile,

          as in case of project which consumes this feature:

          https://github.com/richfaces/build/blob/develop/parent/pom.xml#L725

          • 2. Re: Deactivation of Maven's property-activated profile fails
            Snjezana Peco Master

            It seems there is a bug in m2e 1.0 that is related to profiles activation.

            Try to upgrade to m2e 1.1. If you are using Eclipse 3.7/Indigo, you can update m2e using the http://download.eclipse.org/technology/m2e/releases update site. 

            The issue can't be reproduced in m2e 1.1.

            • 3. Re: Deactivation of Maven's property-activated profile fails
              Lukáš Fryč Master

              Thanks Snjezana,

               

              Works great with m2e 1.1 and JBoss Tools 3.3.

               

              Note that I couldn't use JBDS 5.0.1.GA because of m2e 1.1 dependency conflict with JBDS package:

               

              Your original request has been modified.
                "m2e - Maven Integration for Eclipse" is already installed, so an update will be performed instead.
              Cannot complete the install because of a conflicting dependency.
                Software being installed: m2e - Maven Integration for Eclipse 1.1.0.20120530-0009 (org.eclipse.m2e.feature.feature.group 1.1.0.20120530-0009)
                Software currently installed: JBoss Developer Studio (Branded Product) 5.0.1.v20120715-0533-H232-GA (com.jboss.jbds.all 5.0.1.v20120715-0533-H232-GA)
                Only one of the following can be installed at once: 
                  m2e Marketplace 1.0.0.20110607-2117 (org.eclipse.m2e.discovery 1.0.0.20110607-2117)
                  m2e Marketplace 1.0.200.20111228-1245 (org.eclipse.m2e.discovery 1.0.200.20111228-1245)
                  m2e Marketplace 1.1.0.20120530-0009 (org.eclipse.m2e.discovery 1.1.0.20120530-0009)
                  m2e Marketplace 1.0.100.20110804-1717 (org.eclipse.m2e.discovery 1.0.100.20110804-1717)
                Cannot satisfy dependency:
                  From: JBoss Developer Studio (Branded Product) 5.0.1.v20120715-0533-H232-GA (com.jboss.jbds.all 5.0.1.v20120715-0533-H232-GA)
                  To: com.jboss.jbds.product.feature.feature.group [5.0.1.v20120715-0533-H232-GA]
                Cannot satisfy dependency:
                  From: Maven Integration (Selected) 1.1.0.v20120715-0533-H232-GA (com.jboss.jbds.m2e.feature.feature.group 1.1.0.v20120715-0533-H232-GA)
                  To: org.eclipse.m2e.discovery [1.0.200.20111228-1245]
                Cannot satisfy dependency:
                  From: JBoss Developer Studio (Core Features) 5.0.1.v20120715-0533-H232-GA (com.jboss.jbds.product.feature.feature.group 5.0.1.v20120715-0533-H232-GA)
                  To: com.jboss.jbds.m2e.feature.feature.group [1.1.0.v20120715-0533-H232-GA]
                Cannot satisfy dependency:
                  From: m2e - Maven Integration for Eclipse 1.1.0.20120530-0009 (org.eclipse.m2e.feature.feature.group 1.1.0.20120530-0009)
                  To: org.eclipse.m2e.discovery [1.1.0.20120530-0009]