As I haven't been getting much of a response on the users list I thought I'd ask here. For whatever reason I can't get m2 to use repositories defined in a profile (see the thread below)
Any ideas? If I was going to debug this in the maven code where would I start? MAR -----Original Message----- From: Russell, Mark [mailto:[EMAIL PROTECTED] Sent: Thursday, October 13, 2005 1:45 PM To: Maven Users List Subject: RE: Using repositories defined in a profile... question/problem [m2] Anyone have an idea on this? I really do need this for a project I'm working on. MAR -----Original Message----- From: Russell, Mark [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 11:41 AM To: Maven Users List Subject: RE: Using repositories defined in a profile... question/problem [m2] Ok those help a little in the trouble shooting. Still no solution but here is what I'm seeing. Behavior when doing a "m2 projecthelp:effective-pom": - If the profile is in the parent and not the child, then the effective pom *does not* show any profiles. - If the profile is in the child then the effective pom *does* show the profile. - Aren't profiles suppose to be inherited? (I can work around this, just curious) Behavior when doing "m2 projecthelp:active-profiles": - If the profile is defined in the parent, then no active profiles will ever be displayed, regardless of what I do up to and including passing "-P profilename" to m2 - After changing "<activeByDefault/>" to "<activeByDefault>true</activeByDefault>" in the profile in the child pom the profile will show up as active. However the repositories defined in the profile seem to be completely ignored. Note that I even tried commenting out the main (ie not in a profile) <repositories> section, in both the parent & child poms, just to make sure that wasn't screwing with things, even so the repositories in the profile seem to be ignored. I did take a look through the open bugs and the only bug that looks somewhat related is http://jira.codehaus.org/browse/MNG-1169 though it looks more like this applies to the ant tasks rather than m2 itself. I'm pretty much stumped here so does anyone else have any further ideas? If anyone thought it worth it, I'd be willing to pull the beta-4 code down and try. MAR -----Original Message----- From: John Casey [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 10:59 AM To: Maven Users List Subject: Re: Using repositories defined in a profile... question/problem [m2] -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 You should be able to specify a profile in a pom and NOT have to use <activeProfiles/> in the settings.xml - that section is only for profiles defined in the settings file. Since you have activeByDefault specified, you should be able to run the following: m2 projecthelp:active-profiles and see your profile listed. (If you didn't have activeByDefault, you might have to add a system property or some other trigger for the profile.) Another note about activeByDefault is that when any other profile is activated, this one will not be. It's meant to work more like a default choice rather than an activeAlways sort of semantic. If you want to see what the POM looks like when Maven is done mashing it together with parents, profiles, etc. you can use: m2 projecthelp:effective-pom or m2 projecthelp:effective-pom -Doutput=/path/to/file I know these aren't solutions, but maybe they will help give you a clearer view into the problem. Hope that helps, john Russell, Mark wrote: | I have a pom with a profile defined in that specifies a local | repository, and disables the central repo. How can I get m2 to honor | the profile? No matter what I try it seems to ignore the profile and | goes and uses the central repo and ignores the local repository. | | I have even tried passing "-P master_build" to m2 at the command line | and it still ignores it. | | Am I just doing something wrong here? | | Side note, not sure it matters... I'm making use of the multi-projects | support of m2. I have tried this profiles section in both the parent | and child pom's and it seems to make no difference what so ever. No | matter what I do the profile isn't used. | | | MAR | | | | The profiles section of my pom: | <profiles> | <profile> | <id>master_build</id> | <activation> | <activeByDefault>true</activeByDefault> (also tried just | <activeByDefault> ) | </activation> | <repositories> | <repository> | <id>local</id> | <name>Local repository</name> | <url>http://localhost:8080/maven2</url> | <layout>default</layout> | <snapshots> | <enabled>true</enabled> | </snapshots> | <releases> | <enabled>true</enabled> | </releases> | </repository> | <repository> | <id>central</id> | <name>Maven Repository Switchboard</name> | <url>http://repo1.maven.org/maven2</url> | <layout>default</layout> | <snapshots> | <enabled>false</enabled> | </snapshots> | <releases> | <enabled>false</enabled> | </releases> | </repository> | </repositories> | </profile> | </profiles> | | | --------------------------------------------------------------------- | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | | | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDTUDGK3h2CZwO/4URAswMAKCoqShaYZ2nOGXnBe0r8eb2zFUQ1ACfaxyv YuBGslYvPaS2kDEhuoPDIPs= =yhQf -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]