0

I'm trying to enable a maven profile following example from maven site. It works fine in this way, with this code in pom.xml:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.myco.plugins</groupId>
        <artifactId>spiffy-integrationTest-plugin</artifactId>
        <version>1.0</version>
        <configuration>
          <appserverHome>${appserver.home}</appserverHome>
        </configuration>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

and this code in local ~/.m2/settings.xml:

<settings>
  ...
  <profiles>
    <profile>
      <id>appserverConfig</id>
      <properties>
        <appserver.home>/path/to/appserver</appserver.home>
      </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>appserverConfig</activeProfile>
  </activeProfiles>
  ...
</settings>

The problem is if I try to change the activation way: if I try to activate profiles on settings.xml using a property or also the activeByDefault tag it does nothing. If I try to activate the profile in the same way on pom it works but the property is not override.

How can I proceed?

gvlasov
  • 18,638
  • 21
  • 74
  • 110
Mikyjpeg
  • 1,179
  • 1
  • 13
  • 39
  • What do you mean by "if I try to activate profiles on settings.xml using a property or also the activeByDefault tag it does nothing" ? Can you post what your different attempts were ? – Tunaki Feb 25 '15 at 19:55
  • First attempt: remove `activeProfiles` tag and add `activationByDefault` tag inside the profile on setting.xml. In this case it seems that maven active the profile but only the part configured in settings.xml, the part on pom.xml has been ignored. Second attempt: add `activationByDefault` tag inside the profile on pom.xml. In this case maven active the profile correctly but does not substitute the property (as if profile on settings.xml is not been read). – Mikyjpeg Mar 11 '15 at 11:11
  • I finally resolve creating 2 different profile, one in pom.xml with the configuration and actived by property and another on settings.xml actived by the same property that set the appserver.home property. But it seems more a workaround than a solution. – Mikyjpeg Mar 11 '15 at 11:13

0 Answers0