Profile - activeByDefault in Maven 3.0
Hi All, I am currently upgrading to maven 3 from 2. I have a settings.xml that I have been using for a couple of years now. It has a profile in it called "dev" it looks something like this: dev true When I run "mvn clean install" in 2.0 it used this profile and all was well. Now when I run against Maven 3.0 this profile is not active. I have to run "mvn clean install -Pdev" to activate it. I have searched online and tried several things, the only thing that seemed to work was . Does this setting no longer work??? Thanks, Todd -- View this message in context: http://maven.40175.n5.nabble.com/Profile-activeByDefault-in-Maven-3-0-tp5043324p5043324.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Profile - activeByDefault in Maven 3.0
Hi Todd, tpatch wrote: > Hi All, > > I am currently upgrading to maven 3 from 2. I have a settings.xml that I > have been using for a couple of years now. It has a profile in it called > "dev" it looks something like this: > > > > dev > > true > > > When I run "mvn clean install" in 2.0 it used this profile and all was > well. > Now when I run against Maven 3.0 this profile is not active. I have to > run > "mvn clean install -Pdev" to activate it. I have searched online and > tried several things, the only thing that seemed to work was > . > > Does this setting no longer work??? activeByDefault always meant that this profile is only active if none other is. If you e.g. have added a profile for M3's site plugin to use the POM for M2 or M3, well, then you have now an active one ;-) So, what does this print on console: mvn help:active-profiles Cheers, Jörg BTW: I used therefore activeProfiles even in M2 ... - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Profile - activeByDefault in Maven 3.0
Jorg, Thanks for the reply. Thanks for the tip on help:activeprofiles - it shows "dev" - so maybe I have a different problem. I created a simple set of projects using archetype:generate - a parent project and a child project for a multimodule project, parent builds child. I ran some tests with and without the -Pdev setting. It seems to only work if I specify the -Pdev setting, what am I missing here? Thanks, Todd In the parent pom I have com.test parent pom 1.0-SNAPSHOT parent http://maven.apache.org dev child In the child I have parent com.test 1.0-SNAPSHOT com.loftware.test child 1.0-SNAPSHOT childparent http://maven.apache.org junit junit 3.8.1 test When I run "mvn clean install" - I get the following C:\dev\maven3test\parent>mvn clean install [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building parent 1.0-SNAPSHOT [INFO] [INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ parent --- [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ parent --- [INFO] Installing C:\dev\maven3test\parent\pom.xml to C:\dev\maven\repo\com\test\parent\1.0-SNAPSHOT\parent-1.0-SNAPSHOT .pom [INFO] [INFO] BUILD SUCCESS [INFO] When, I run "mvn clean install -Pdev" i get C:\dev\maven3test\parent>mvn clean install -Pdev [INFO] Scanning for projects... [INFO] [INFO] Reactor Build Order: [INFO] [INFO] parent [INFO] childparent [INFO] [INFO] [INFO] Building parent 1.0-SNAPSHOT [INFO] [INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ parent --- [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ parent --- [INFO] Installing C:\dev\maven3test\parent\pom.xml to C:\dev\maven\repo\com\test\parent\1.0-SNAPSHOT\parent-1.0-SNAPSHOT .pom [INFO] [INFO] [INFO] Building childparent 1.0-SNAPSHOT [INFO] [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ childparent --- [INFO] Building jar: C:\dev\maven3test\parent\childparent\target\childparent-1.0-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ childparent --- [INFO] Installing C:\dev\maven3test\parent\childparent\target\childparent-1.0-SNAPSHOT.jar to C:\dev\maven\repo\com\loft ware\test\childparent\1.0-SNAPSHOT\childparent-1.0-SNAPSHOT.jar [INFO] Installing C:\dev\maven3test\parent\childparent\pom.xml to C:\dev\maven\repo\com\loftware\test\childparent\1.0-SN APSHOT\childparent-1.0-SNAPSHOT.pom [INFO] [INFO] Reactor Summary: [INFO] [INFO] parent SUCCESS [0.484s] [INFO] childparent ... SUCCESS [1.965s] [INFO] [INFO] BUILD SUCCESS [INFO] Running "mvn help:activeprofiles" gives me C:\dev\maven3test\parent>mvn help:active-profiles [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building parent 1.0-SNAPSHOT [INFO] [INFO] [INFO] --- maven-help-plugin:2.1.1:active-profiles (default-cli) @ parent --- [INFO] Active Profiles for Project 'com.test:parent:pom:1.0-SNAPSHOT': The following profiles are active: - dev (source: settings.xml) [INFO] [INFO] BUILD SUCCESS [INFO] running "mvn active-profile -Pdev" gives me C:\dev\maven3test\parent>mvn help:active-profiles -Pdev [INFO] Scanning for projects... [INFO] [INFO] Reactor Build Order: [INFO] [INFO] parent [INFO] childparent [INFO] [INFO] [INFO] Building parent 1.0-SNAPSHOT [INFO] [INFO] [INFO] --- maven-help-plugin:2.1.1:active-profiles (default-cli) @ parent --- [INFO] Active Profiles for Project 'com.test:parent:pom:1.0-SNAPSHOT': The following profil
Re: Profile - activeByDefault in Maven 3.0
Hi, activeByDefault always meant that this profile is only active if none other is. If you e.g. have added a profile for M3's site plugin to use the POM for M2 or M3, well, then you have now an active one ;-) This is sorry to say simply wrong, cause if that would be true using activeByDefault would prevent activating more than one profile... Based on mvn help:active-profiles i get the following output: The following profiles are active: - maven-3 (source: pom) - snapshots (source: settings.xml) - dev-1 (source: settings.xml) - dev-2 (source: settings.xml) whereas dev-1 and dev-2 are profiles which have been activated simply dev-1 true dev-2 true furthermore the maven-3 profile contradicts exactly your statements. Kind regards Karl Heinz Marbaise -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Profile - activeByDefault in Maven 3.0
Hi, to activate your dev-profile you need to it a little bit tricky... You need to define in the settings.xml a thing like the following: test-dev false yes you can activate that profile by using activation rules (via existing file or properties etc.). or by activating it via test-dev than you need to put a thing like this in your pom.xml: test-dev false test.dev yes sub-1 This will work as you expect it to work Kind regards Karl Heinz Marbaise -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org