On 8/16/10 3:04 PM, Trevor Harmon wrote: > On Aug 16, 2010, at 10:18 AM, Justin Edelson wrote: > >> One "in and out" to learn is that your distinction of "internal" and >> "external" repositories isn't found in Maven. > > I found it here: > > http://docs.codehaus.org/display/MAVENUSER/Maven+Concepts+Repositories > > Is the term "external repository" not valid?
You'll note that this page is under "Proposed Documentation" and says "I expect to have it done no later than 2006-11-05" :) There is a valid distinction here, but it isn't one that Maven makes... What I was trying to say is that all Maven knows about is local and remote repositories. The "external" vs. "internal" is a useful distinction from a management/support/administrative context (Nexus refers to these as "proxy" vs. "hosted"), but they're both just remote repositories to Maven. > >>> Also, I just wanted to be a good Maven citizen and take a load off >>> Central, if that wasn't too hard to do. >> Again, as a single developer, it isn't possible to take load off Central >> (or mirrors) because you always need to download artifacts at least >> once. And unless you do the things I said above, you never need to >> download artifacts *more than once*. > > I guess I was thinking of SNAPSHOT dependencies, in which case Central > would be queried on every build, right? But then, I never depend on > SNAPSHOT versions of external artifacts, so yeah, it wouldn't make much > difference. Central doesn't store SNAPSHOT, so if you're querying central for SNAPSHOTs, that's a configuration problem. > >>> But perhaps the most important reason is that I need to deploy >>> customized versions of some Maven plugins. >>> There are a couple I'm using on Central that are buggy, and might not >>> be updated for awhile, so I need to >>> deploy and use versions that have the bugs fixed. It's not clear to >>> me if I need a repository manager for that, >>> or if I can get away with the non-managed repository I have now for >>> deploying project artifacts (and the site). >> You don't need a repository manager for this. You can deploy these >> artifacts to your own remote repository. > > Okay, let me make sure I understand this. Say I've got a main artifact > and a customized plugin that it depends on. I can configure the plugin > to deploy to my own remote repository by adding the repository info to > the plugin POM's <distributionManagement>. I would use altDeploymentRepository instead of modifying the POM. http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#altDeploymentRepository So the full workflow is: * Fork the plugin's source into a new git repository. * Change the version number to illustrate that this is your patched version * Modify code to fix bugs * Submit patches upstream (to be nice) * run mvn -DaltDeploymentRepository=foo::default::scp://myrepo/foo deploy > So now the plugin is > available in my repository. But here's where I get a little confused... > How does the main artifact know how to retrieve the deployed plugin from > my remote repository? Do I simply add the remote repository URL to the > main POM's <pluginRepositories>? (This seems to be discouraged: "I have > yet to hear a convincing argument for doing so" [1]) Or should I add it > to <repositories>? Or somewhere else? The repository to which you've deployed the plugin should be configured in your settings.xml as a pluginRepository AND a repository. You should *also* configure the version number to explicitly be the modified version number. HTH, Justin > > Thanks, > > Trevor > > [1] http://maven.apache.org/pom.html#Plugin_Repositories > > > --------------------------------------------------------------------- > 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]
