[jira] Updated: (MNG-3099) Profiles ignored when working with non-projects (such as archetype:create)

2008-06-12 Thread Brett Porter (JIRA)

 [ 
http://jira.codehaus.org/browse/MNG-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brett Porter updated MNG-3099:
--

Fix Version/s: (was: 2.1)

 Profiles ignored when working with non-projects (such as archetype:create)
 --

 Key: MNG-3099
 URL: http://jira.codehaus.org/browse/MNG-3099
 Project: Maven 2
  Issue Type: Bug
Reporter: Joakim Erdfelt
Assignee: John Casey
Priority: Blocker
 Fix For: 2.0.9

 Attachments: MNG-2261-2.patch, MNG-2261.patch, 
 Plugin-showing-MNG3099.zip


 Several conditions have to be met to show this bug.
 1) Be in an environment that does not have access to repo1.maven.org, (such 
 as a corporate environment)
 2) Have no content in your local repository (a fresh install of maven 2.0.4)
 3) Attempt to use a plugin that has no project requirement (such as 
 archetype:create)
 The plugin fails because access to repo1.maven.org cannot be accessed.
 Recommended solution:
 Create a settings.xml profile that changes the location of the 'central' 
 repository to point to an internal resource (such as a maven-proxy 
 installation).
 settings
   profiles
 profile
   iduse_internal/id
   repositories
 repository
   idcentral/id
   nameInternal Central Repository/name
   urlhttp://repo.internal.com/maven2/url
   releases
 enabledtrue/enabled
   /releases
   snapshots
 enabledtrue/enabled
   /snapshots
 /repository
   /repositories
   pluginRepositories
 pluginRepository
   idcentral/id
   nameInternal Central Repository/name
   urlhttp://repo.internal.com/maven2/url
   releases
 enabledtrue/enabled
   /releases
   snapshots
 enabledtrue/enabled
   /snapshots
 /pluginRepository
   /pluginRepositories
 /profile
   /profiles
   activeProfiles
 activeProfileuse_internal/activeProfile
   /activeProfiles
 /settings
 Try again.
 Still fails.
 The reason is that the default behaviour for non-project execution is to use 
 the maven super pom, however there is a bug with that flow that  does not 
 allow for the merging of the settings.xml profiles.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (MNG-3099) Profiles ignored when working with non-projects (such as archetype:create)

2007-09-12 Thread William Ferguson (JIRA)

 [ 
http://jira.codehaus.org/browse/MNG-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

William Ferguson updated MNG-3099:
--

Attachment: Plugin-showing-MNG3099.zip

Invoking a Mojo that doesn't require a project (ie [EMAIL PROTECTED] false* in 
your Mojo) doesn't load the Profiles defined in LOCAL_HOME settings or 
MAVEN_HOME settings.

In an effort to make this issue as explicit as possible, I have attached 
Plugin-showing-MNG3099.zip

It contains a plugin project (with a Mojo conigured with *requiresProject 
false*) and local and global settings files.

Put the local and global settings files in the normal place and build and 
install the plugin.

Then from the plugin project folder execute:
{code}
D:\Modules\maven-test-pluginmvn 
com.yarris.maven.plugins:maven-test-plugin:profile-props
[INFO] Scanning for projects...
[INFO] snapshot com.yarris.maven.plugins:maven-test-plugin:1.0-SNAPSHOT: 
checking for updates from snapshot
[INFO] 

[INFO] Building maven-test-plugin
[INFO]task-segment: 
[com.yarris.maven.plugins:maven-test-plugin:profile-props] (aggregator-style)
[INFO] 

[INFO] [test:profile-props]
[INFO] local-profile-prop=local-profile-prop-value
[INFO] global-profile-prop=global-profile-prop-value
[INFO] 
[INFO] BUILD SUCCESSFUL
[INFO] 
[INFO] Total time: 1 second
[INFO] Finished at: Thu Sep 13 15:47:18 EST 2007
[INFO] Final Memory: 2M/4M
[INFO] 
{code}

Note that the  local-profile-prop and global-profile-prop have resolved to the 
expected values.

Now execute:
{code}
D:\Modules\maven-test-pluginmvn 
com.yarris.maven.plugins:maven-test-plugin:profile-props -f no-pom.xml
[INFO] Scanning for projects...
[INFO] 

[INFO] Building Maven Default Project
[INFO]task-segment: 
[com.yarris.maven.plugins:maven-test-plugin:profile-props] (aggregator-style)
[INFO] 

[INFO] [test:profile-props]
[INFO] local-profile-prop=null
[INFO] global-profile-prop=null
[INFO] 
[INFO] BUILD SUCCESSFUL
[INFO] 
[INFO] Total time: 1 second
[INFO] Finished at: Thu Sep 13 15:48:56 EST 2007
[INFO] Final Memory: 2M/4M
[INFO] 
{code}
Note how local-profile-prop and global-profile-prop no longer have values.

As has been noted the most common example of this is archetype:create which 
requires the remote repository to be explicitly provided on the command line 
via the remoteRepositories System property if you are pulling an archetype from 
somewhere other than central. Eg
{code}
mvn archetype:create -DgroupId=com.yarris -DartifactId=foo-project 
-DarchetypeGroupId=com.yarris.maven.archetype \
  -DarchetypeArtifactId=archetype-standard 
-DremoteRepositories=http://somewhere.com.au:8080/proximity/repository/release
{code}
It should be possible to define an active Profile in either local or global 
settings.xml that defines a remote repository, and have the archetype pulled 
from that repository.

It should also be possible to refer to a property provided by an active Profile
But it occurs for any Mojo that does not require a project.


 Profiles ignored when working with non-projects (such as archetype:create)
 --

 Key: MNG-3099
 URL: http://jira.codehaus.org/browse/MNG-3099
 Project: Maven 2
  Issue Type: Bug
Reporter: Joakim Erdfelt
Assignee: John Casey
Priority: Blocker
 Fix For: 2.1

 Attachments: MNG-2261-2.patch, MNG-2261.patch, 
 Plugin-showing-MNG3099.zip


 Several conditions have to be met to show this bug.
 1) Be in an environment that does not have access to repo1.maven.org, (such 
 as a corporate environment)
 2) Have no content in your local repository (a fresh install of maven 2.0.4)
 3) Attempt to use a plugin that has no project requirement (such as 
 archetype:create)
 The plugin fails because access to repo1.maven.org cannot be accessed.
 Recommended solution:
 Create a settings.xml profile that changes the location of the 'central' 
 repository to point to an internal resource (such as a maven-proxy 
 installation).
 settings
   profiles
 profile
   iduse_internal/id
   repositories
 repository
   idcentral/id
 

[jira] Updated: (MNG-3099) Profiles ignored when working with non-projects (such as archetype:create)

2007-09-06 Thread Brett Porter (JIRA)

 [ 
http://jira.codehaus.org/browse/MNG-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brett Porter updated MNG-3099:
--

Fix Version/s: 2.1

 Profiles ignored when working with non-projects (such as archetype:create)
 --

 Key: MNG-3099
 URL: http://jira.codehaus.org/browse/MNG-3099
 Project: Maven 2
  Issue Type: Bug
Reporter: Joakim Erdfelt
Assignee: John Casey
Priority: Blocker
 Fix For: 2.1

 Attachments: MNG-2261-2.patch, MNG-2261.patch


 Several conditions have to be met to show this bug.
 1) Be in an environment that does not have access to repo1.maven.org, (such 
 as a corporate environment)
 2) Have no content in your local repository (a fresh install of maven 2.0.4)
 3) Attempt to use a plugin that has no project requirement (such as 
 archetype:create)
 The plugin fails because access to repo1.maven.org cannot be accessed.
 Recommended solution:
 Create a settings.xml profile that changes the location of the 'central' 
 repository to point to an internal resource (such as a maven-proxy 
 installation).
 settings
   profiles
 profile
   iduse_internal/id
   repositories
 repository
   idcentral/id
   nameInternal Central Repository/name
   urlhttp://repo.internal.com/maven2/url
   releases
 enabledtrue/enabled
   /releases
   snapshots
 enabledtrue/enabled
   /snapshots
 /repository
   /repositories
   pluginRepositories
 pluginRepository
   idcentral/id
   nameInternal Central Repository/name
   urlhttp://repo.internal.com/maven2/url
   releases
 enabledtrue/enabled
   /releases
   snapshots
 enabledtrue/enabled
   /snapshots
 /pluginRepository
   /pluginRepositories
 /profile
   /profiles
   activeProfiles
 activeProfileuse_internal/activeProfile
   /activeProfiles
 /settings
 Try again.
 Still fails.
 The reason is that the default behaviour for non-project execution is to use 
 the maven super pom, however there is a bug with that flow that  does not 
 allow for the merging of the settings.xml profiles.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira