Hi Todd,
Regarding why it's not working, I'm betting on a bug in the maven
embedder used by M2e since it should work.

Regarding putting repos into poms...this is a longer debate. The
recommended practice is as igor stated, to use settings.xml instead of
the pom. Particularly in a corp scenario, you will most likely want to
declare a corp repo in your corp pom. The trouble is however is how does
a fresh install find that corp pom without already knowing about the
corp repo? It leads you to a chicken or egg issue in the beginning.
Futher, specifying the urls in the poms makes it much harder to migrate
over time as machine names or ips change. All previously released poms
would no longer work.

If you're using a repo manager like Nexus, we recommend you specify
Nexus as a mirror in the settings and then control all other repos in
Nexus. This lets you control the entire environment from a single
location and there's minimal change to settings over time (really no
change unless you move Nexus).

-----Original Message-----
From: Todd Thiessen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 11, 2008 4:26 PM
To: [email protected]
Subject: RE: [m2eclipse-user] Using an internal central repository
without changing settings.xml

If adding repository information to a pom is not recommend, how is one
supposed to get access to artifacts that are not in central?  It either
has to go in the pom or central needs to be mirrored to something in the
settings.xml file which actually does contain all the artifacts that
your project may need.

Settings.xml though is no better since all developers on your team must
share the same mirror definitions. This makes build environments very
unportable.  You can at least store poms in source control and other
members of your team will automatically have the new repository
definition.

On a side note, I will look into creating a bug report. Let me know
if/when you have duplicated the problem.


---
Todd Thiessen

-----Original Message-----
From: Igor Fedorenko [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 11, 2008 3:55 PM
To: [email protected]
Subject: Re: [m2eclipse-user] Using an internal central repository
without changing settings.xml

There is a chance version of maven embedder used by m2e does not
properly handle project-specific repository definitions. I will try to
reproduce this problem myself, but if you could create a bugreport in
JIRA [1] with sample project and steps to reproduce, this would
certainly help.

Also, adding repository definition to pom.xml files is generally not
recommended. This makes projects harder to move from one build
environment to another.

--
Regards,
Igor

Todd Thiessen wrote:
> I've overridden the central repo in my pom.  ie:
> 
>   <repositories>
>     <repository>
>       <id>central</id>
>       <url>http://localhost:8081/nexus/content/groups/public</url>
>     </repository>
>   </repositories>
>   <pluginRepositories>
>     <pluginRepository>
>       <id>central</id>
>       <url>http://localhost:8081/nexus/content/groups/public</url>
>     </pluginRepository>
>   </pluginRepositories>
> 
> But for some reason, m2e still downloads some of the artifacts from 
> the maven central repo.  Not all of them however.  When running the 
> project from m2e within eclipse I get as output (partial).
> 
> url = _http://localhost:8081/nexus/content/groups/public_
> Downloading: 
> _http://localhost:8081/nexus/content/groups/public/org/apache/maven/pl
> ugins/maven-resources-plugin/2.2/maven-resources-plugin-2.2.pom_
> 
> url = _http://repo1.maven.org/maven2_
> Downloading: 
> _http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/
> 1/maven-plugins-1.pom_
> 
> 
> However, if I execute the same build from the command line, all 
> downloads go to my central repo, which is what I would expect.  ie:
> 
> Downloading: 
> _http://localhost:8081/nexus/content/groups/public/org/apache/maven/pl
> ugins/maven-resources-plugin/2.2/maven-resources-plugin-2.2.pom_
> 
> Downloading: 
> _http://localhost:8081/nexus/content/groups/public/org/apache/maven/pl
> ugins/maven-plugins/1/maven-plugins-1.pom_
> 
> ---
> /Todd Thiessen/
> 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to