[ 
http://jira.codehaus.org/browse/MNG-2261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90033
 ] 

Wendy Smoak commented on MNG-2261:
----------------------------------

Workaround:  mvn ... -f /path/to/simple.pom

and "simple.pom" contains the following:

<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.example</groupId>
   <artifactId>MNG-2261-workaround</artifactId>
   <packaging>pom</packaging>
   <version>1</version>
</project>

If there is "a project" involved, Maven will use the profiles and repositories 
in settings.xml

For archetype:create, you don't want a pom.xml in the current directory or the 
plugin will add a <module> to it and hook it up as the newly created project's 
parent, so use the -f switch to point it at a file somewhere else.

For other things such as deploy:deploy-file, having a pom.xml file in the 
current directory works fine.  (If you're actually deploying a pom with 
-DpomFile=..., then name that one something else, or just use -f as above.)

Related thread:  
http://www.nabble.com/Maven-ignoring-Artifactory-proxy-settings--t3397576s177.html

> Profiles ignored when working with non-projects (such as archetype:create)
> --------------------------------------------------------------------------
>
>                 Key: MNG-2261
>                 URL: http://jira.codehaus.org/browse/MNG-2261
>             Project: Maven 2
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.4
>            Reporter: Joakim Erdfelt
>         Assigned To: John Casey
>            Priority: Blocker
>             Fix For: 2.0.6
>
>         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>
>       <id>use_internal</id>
>       <repositories>
>         <repository>
>           <id>central</id>
>           <name>Internal Central Repository</name>
>           <url>http://repo.internal.com/maven2</url>
>           <releases>
>             <enabled>true</enabled>
>           </releases>
>           <snapshots>
>             <enabled>true</enabled>
>           </snapshots>
>         </repository>
>       </repositories>
>       <pluginRepositories>
>         <pluginRepository>
>           <id>central</id>
>           <name>Internal Central Repository</name>
>           <url>http://repo.internal.com/maven2</url>
>           <releases>
>             <enabled>true</enabled>
>           </releases>
>           <snapshots>
>             <enabled>true</enabled>
>           </snapshots>
>         </pluginRepository>
>       </pluginRepositories>
>     </profile>
>   </profiles>
>   <activeProfiles>
>     <activeProfile>use_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

        

Reply via email to