Re: External repository always requires a repository manager?
On Mon, Aug 16, 2010 at 5:53 PM, Trevor Harmon wrote: > On Aug 16, 2010, at 12:29 PM, Justin Edelson wrote: > >>> 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 . >> >> I would use altDeploymentRepository instead of modifying the POM. >> >> http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#altDeploymentRepository > > ... >> >> * run mvn -DaltDeploymentRepository=foo::default::scp://myrepo/foo deploy > > I don't see the advantage of altDeploymentRepository. What's wrong with > modifying the POM? I'd prefer not to have to remember a command line > parameter and just do a simple "mvn deploy". To each his or her own :) Both have their uses. Justin > > Trevor > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: External repository always requires a repository manager?
>-Original Message- >From: Trevor Harmon [mailto:tre...@vocaro.com] > >I don't see the advantage of altDeploymentRepository. What's wrong >with modifying the POM? I'd prefer not to have to remember a command >line parameter and just do a simple "mvn deploy". That sounds useful if you want to do something like deploy a build of someone else's software to your own repository manager. That way you can minimize the number of changes you have to their files. eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: External repository always requires a repository manager?
>-Original Message- >From: Trevor Harmon [mailto:tre...@vocaro.com] >On Aug 16, 2010, at 1:20 AM, Stephen Connolly wrote: >> Your life would be much easier using a repository manager for your >> "internal" repository. Nexus is almost trivial to set up, for example. > >It is trivial to set up *if* you have the necessary permissions to set up >the service. In my case, I'm an independent contractor, and the only server >I personally have access to is from one of those shared hosting providers, >and it's simply not possible to run Jetty or Tanuki in that kind of >environment. My client does have their own servers, but I'd have to make a >special request to get one of their IT guys to set it up for me. So unless >you've got root access to your own server... not trivial. I'm not sure whether this helps you any, but you don't need to run Nexus as root. For instance, I run it under it's own userid, on a greater-than-1024 port that was arbitrarily chosen when we installed it. >Okay, but I'm just not understanding how to configure Maven for that. Sure, >I could set up a element like this: > > > >central >http://repo.myserver.com/repository/ > > Not quite. You're probably going to want everything going through the repository manager. I ended up modifying the settings.xml file across all the machines that I have maven installed. That is probably better handled through a ~/.m2/settings.xml file, but it works about the same. The things I added are: A mirror element, which forces all requests to go through nexus: nexus * http://repo.mysever.com:5678/nexus/content/groups/public That "/nexus/content/groups/public" path maps to a "repository group" that I setup in nexus. Each actual repository on the net (such as central) are created in nexus as proxy repositories, then added to the repository group. A profile element that lists an arbitrary repository: nexus central http://central true true ...same as repository element... nexus A server element with the username and password for deploying things: nexus ... ... >And that tells Maven to check the above URL for artifacts before going out >to repo1.maven.org. But it only knows how to download, not upload. How can >Maven put the newly downloaded artifacts into this repository? (I thought >that's what a repository manager is for...) Uploading happens through the distributionManagment url you put in your pom.xml file (or possibly a common, shared parent pom file). e.g.: ...other pom.xml stuff... nexus false Releases http://repo.myserver.com:5678/nexus/content/repositories/releases/< /url> nexus true Snapshots http://repo.myserver.com:5678/nexus/content/repositories/snapshots/ The "/nexus/content/repositories/snapshot" and .../releases paths are "hosted" repositories that were created within Nexus. Hope this helps. eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On Aug 16, 2010, at 12:29 PM, Justin Edelson wrote: 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 . I would use altDeploymentRepository instead of modifying the POM. http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#altDeploymentRepository ... * run mvn -DaltDeploymentRepository=foo::default::scp://myrepo/foo deploy I don't see the advantage of altDeploymentRepository. What's wrong with modifying the POM? I'd prefer not to have to remember a command line parameter and just do a simple "mvn deploy". Trevor - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
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 . 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 ? (This seems to be discouraged: "I have > yet to hear a convincing argument for doing so" [1]) Or should I add it > to ? 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: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
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? 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. 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 . 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 ? (This seems to be discouraged: "I have yet to hear a convincing argument for doing so" [1]) Or should I add it to ? Or somewhere else? Thanks, Trevor [1] http://maven.apache.org/pom.html#Plugin_Repositories - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On 8/16/10 12:23 PM, Trevor Harmon wrote: > On Aug 16, 2010, at 7:20 AM, Justin Edelson wrote: > >> But if you are a single developer, I'm not sure what value you are >> looking to get out of this. Your local Maven repository acts as a local >> cache, so unless you need to blow this away with some regularity, what's >> the point? > > Well, I'm a single developer now, but before long the project will grow, and > maybe spawn new projects. > I'd prefer to learn the ins and outs of repositories when the project is > small and manageable. If you want to have the infrastructure you'll need when the project *has* grown, then you should be using a repository manager. End of story. If you don't or can't use a repository manager now (and I totally understand why this is the case), then you're stuck with what you have. One "in and out" to learn is that your distinction of "internal" and "external" repositories isn't found in Maven. Maven has two types of repositories: local and remote. You have exactly one local repository (~/.m2/repository, although this is configurable) and any number of remote repositories. The concept of a "repository manager" is external to Maven. Maven doesn't know if you use a repository manager. Maven doesn't care. Don't get me wrong - everyone should use a repository manager. > I was also intrigued by the promise to "shave minutes off a build" [1] and > was wondering if this does in fact > require a repository manager or could be accomplished more simply. This requires a pre-populated cache. As a single developer, you will never have a pre-populated cache unless you either a) use a second computer or b) delete the contents of your local repository. > 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*. > > 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. Actually, you don't even need a remote repository for this. You just need to install fixed versions into your local repository. Justin > > Trevor > > [1] http://maven.apache.org/repository-management.html > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On 16/08/2010 12:23 PM, Trevor Harmon wrote: On Aug 16, 2010, at 7:20 AM, Justin Edelson wrote: But if you are a single developer, I'm not sure what value you are looking to get out of this. Your local Maven repository acts as a local cache, so unless you need to blow this away with some regularity, what's the point? Well, I'm a single developer now, but before long the project will grow, and maybe spawn new projects. I'd prefer to learn the ins and outs of repositories when the project is small and manageable. I was also intrigued by the promise to "shave minutes off a build" [1] and was wondering if this does in fact require a repository manager or could be accomplished more simply. Also, I just wanted to be a good Maven citizen and take a load off Central, if that wasn't too hard to do. A repo manager like Nexus is really worthwhile. It is one of my biggest regrets that we waited 2 years before setting it up. It has made working properly with Maven a much simpler thing to understand. It has got the whole team singing out of the same choir book and using the right versions for all the builds. It simplifies the use of software libraries that for licensing reasons are not available in Maven Central. Ron 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). Trevor [1] http://maven.apache.org/repository-management.html - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On 16/08/2010 12:07 PM, Trevor Harmon wrote: On Aug 16, 2010, at 4:48 AM, Ron Wheeler wrote: Find a provider that lets you run your own application. Put it on a cloud service. Yes, those are ways around the shared hosting problem, but as soon as I have to purchase and manage separate server space just to run a repository manager, it is no longer trivial. (At least, not as trivial as it is to set up site and artifact deployment, which only require an HTTP server and some way to upload the files.) Nexus is easier to install than an HTTP server and a lot less configuration. Once it is set up, you have a great tool for controlling maven artifacts. Doing it right sometimes takes more work up front but the rest of your life will be much simpler. It makes Maven a pleasure to work with on an everyday basis. Read the Nexus docs on how to set up a deployment. Is there a specific section I should be looking at? I can't seem to find anything about deployment without a repository manager. Everything I've read in the Nexus docs is in the context of a repository manager. Yes it is a repo system but the docs will tell you what you have to do. Thanks, Trevor - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On Aug 16, 2010, at 7:20 AM, Justin Edelson wrote: > But if you are a single developer, I'm not sure what value you are > looking to get out of this. Your local Maven repository acts as a local > cache, so unless you need to blow this away with some regularity, what's > the point? Well, I'm a single developer now, but before long the project will grow, and maybe spawn new projects. I'd prefer to learn the ins and outs of repositories when the project is small and manageable. I was also intrigued by the promise to "shave minutes off a build" [1] and was wondering if this does in fact require a repository manager or could be accomplished more simply. Also, I just wanted to be a good Maven citizen and take a load off Central, if that wasn't too hard to do. 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). Trevor [1] http://maven.apache.org/repository-management.html - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On Aug 16, 2010, at 4:48 AM, Ron Wheeler wrote: > Find a provider that lets you run your own application. > Put it on a cloud service. Yes, those are ways around the shared hosting problem, but as soon as I have to purchase and manage separate server space just to run a repository manager, it is no longer trivial. (At least, not as trivial as it is to set up site and artifact deployment, which only require an HTTP server and some way to upload the files.) > Read the Nexus docs on how to set up a deployment. Is there a specific section I should be looking at? I can't seem to find anything about deployment without a repository manager. Everything I've read in the Nexus docs is in the context of a repository manager. Thanks, Trevor - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
What you are referring to as a "external" repository is essentially a caching proxy. If the only repository you are proxying is central, then theoretically you could use any caching proxy server (including Apache). But if you are a single developer, I'm not sure what value you are looking to get out of this. Your local Maven repository acts as a local cache, so unless you need to blow this away with some regularity, what's the point? Justin On 8/16/10 4:16 AM, Trevor Harmon wrote: > Hi, > > I've set up an "internal" repository for deploying project artifacts. It was > remarkably easy to do. All I needed was some web space with SCP access. After > that it was only a matter of configuring my POM's to > point to the URL. No repository manager needed. > > Now I'd like to set up an "external" repository. (Not sure if that's the > right term.) The only purpose would be to cache artifacts so that Maven can > download them from my repository instead of making a trip out to Central. > > However, it appears that this type of repository is not so easy to set up. My > understanding is that it would require the use of a repository manager. I'm > hoping to avoid that, since repository managers have to run as a background > service (e.g., in a Java EE container). This would really complicate things, > mainly because I don't have root access to the server and would have to get > special permission to set up the service. > > Am I correct in thinking that an external repository necessarily requires > setting up a repository manager? Thanks, > > Trevor > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On 16/08/2010 4:56 AM, Trevor Harmon wrote: On Aug 16, 2010, at 1:20 AM, Stephen Connolly wrote: Your life would be much easier using a repository manager for your "internal" repository. Nexus is almost trivial to set up, for example. It is trivial to set up *if* you have the necessary permissions to set up the service. In my case, I'm an independent contractor, and the only server I personally have access to is from one of those shared hosting providers, and it's simply not possible to run Jetty or Tanuki in that kind of environment. My client does have their own servers, but I'd have to make a special request to get one of their IT guys to set it up for me. So unless you've got root access to your own server... not trivial. Find a provider that lets you run your own application. Put it on a cloud service. As for internal vs external, there is no difference, you don't need a repository manager... Okay, but I'm just not understanding how to configure Maven for that. Sure, I could set up a element like this: central http://repo.myserver.com/repository/ And that tells Maven to check the above URL for artifacts before going out to repo1.maven.org. But it only knows how to download, not upload. How can Maven put the newly downloaded artifacts into this repository? (I thought that's what a repository manager is for...) Trevor Read the Nexus docs on how to set up a deployment. In general, your individual settings.xml defines download location since it is usually the same for all your projects and the parent project pom defines the deployment since it might vary depending on the project. Ron - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
You should discuss this in the Nexus forum. Nexus is easy to st up and does not require a separate container. It does both internal and external with proper access control. Other repository solutions may also work but I use Nexus for my development team. Ron On 16/08/2010 4:16 AM, Trevor Harmon wrote: Hi, I've set up an "internal" repository for deploying project artifacts. It was remarkably easy to do. All I needed was some web space with SCP access. After that it was only a matter of configuring my POM's to point to the URL. No repository manager needed. Now I'd like to set up an "external" repository. (Not sure if that's the right term.) The only purpose would be to cache artifacts so that Maven can download them from my repository instead of making a trip out to Central. However, it appears that this type of repository is not so easy to set up. My understanding is that it would require the use of a repository manager. I'm hoping to avoid that, since repository managers have to run as a background service (e.g., in a Java EE container). This would really complicate things, mainly because I don't have root access to the server and would have to get special permission to set up the service. Am I correct in thinking that an external repository necessarily requires setting up a repository manager? Thanks, Trevor - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
On Aug 16, 2010, at 1:20 AM, Stephen Connolly wrote: > Your life would be much easier using a repository manager for your > "internal" repository. Nexus is almost trivial to set up, for example. It is trivial to set up *if* you have the necessary permissions to set up the service. In my case, I'm an independent contractor, and the only server I personally have access to is from one of those shared hosting providers, and it's simply not possible to run Jetty or Tanuki in that kind of environment. My client does have their own servers, but I'd have to make a special request to get one of their IT guys to set it up for me. So unless you've got root access to your own server... not trivial. > As for internal vs external, there is no difference, you don't need a > repository manager... Okay, but I'm just not understanding how to configure Maven for that. Sure, I could set up a element like this: central http://repo.myserver.com/repository/ And that tells Maven to check the above URL for artifacts before going out to repo1.maven.org. But it only knows how to download, not upload. How can Maven put the newly downloaded artifacts into this repository? (I thought that's what a repository manager is for...) Trevor - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: External repository always requires a repository manager?
Your life would be much easier using a repository manager for your "internal" repository. Nexus is almost trivial to set up, for example. As for internal vs external, there is no difference, you don't need a repository manager... but your life will always be easier if you use one. -Stephen P.S. I only mention Nexus because it is the repository manager I have had good experience with. On 16 August 2010 09:16, Trevor Harmon wrote: > Hi, > > I've set up an "internal" repository for deploying project artifacts. It > was remarkably easy to do. All I needed was some web space with SCP access. > After that it was only a matter of configuring my POM's > to point to the URL. No repository manager needed. > > Now I'd like to set up an "external" repository. (Not sure if that's the > right term.) The only purpose would be to cache artifacts so that Maven can > download them from my repository instead of making a trip out to Central. > > However, it appears that this type of repository is not so easy to set up. > My understanding is that it would require the use of a repository manager. > I'm hoping to avoid that, since repository managers have to run as a > background service (e.g., in a Java EE container). This would really > complicate things, mainly because I don't have root access to the server and > would have to get special permission to set up the service. > > Am I correct in thinking that an external repository necessarily requires > setting up a repository manager? Thanks, > > Trevor > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >