Guidance on simple Nexus setup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Guidance on simple Nexus setup

Richard Mixon
We have are getting started using Nexus OSS. Our organization is really small - one developer behind our firewall and one that works mostly remote. The first item we need to do is host our snapshot and release artifacts.

We have the basic setup working but have decided, at least for now, we really don't need or want to cache public repositories. With two developers the bandwidth and caching issues are just not important to us (yet). And we don't really want to complicate our developer ~/.m2/settings.xml files any more than necessary.

I've gotten snapshot and release deploy working fine. But not it looks like our requests for artifacts from Central and other public repositories are proxying through our release repository.

After a good bit of reading I'm still confused how to achieve two things:
  1. Store and retrieve our snapshots and releases (anything that is in group (com.acmeinc) on our Nexus server.
  2. Make sure all other retrieval requests do not use our snapshot or release repositories.
Other than the Maven and Nexus reference documents is there a more specific document/discussion that might help?

Thank you

--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: (480) 577-6834 office: (480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.
Reply | Threaded
Open this post in threaded view
|

Re: Guidance on simple Nexus setup

Rich Seddon

Hi Richard,

Is there some downside to using a single group repository in Nexus that you're trying to avoid?

Because in my experience there are only upsides.  You never have to change your settings.xml, you get faster builds, and if you find you need to get dependencies from another repository than central you can add it in seamlessly.  See here for our recommended setup:


If you're really determined to do this you'll need to have multiple repositories in your settings.xml.  See these resources for details on how to set this up:


Basically, you either have no mirrorOf section, or you have one that mirrors to nexus for everything but central.

But I think you'll find that Maven is not as efficient at dealing with multiple repositories as Nexus is.  And I'm sure you'll find the multiple repository setup much harder to maintain in Maven than it is in Nexus.

Regards,

Rich





On Jan 9, 2014, at 3:42 PM, Richard Mixon <[hidden email]> wrote:

We have are getting started using Nexus OSS. Our organization is really small - one developer behind our firewall and one that works mostly remote. The first item we need to do is host our snapshot and release artifacts.

We have the basic setup working but have decided, at least for now, we really don't need or want to cache public repositories. With two developers the bandwidth and caching issues are just not important to us (yet). And we don't really want to complicate our developer ~/.m2/settings.xml files any more than necessary.

I've gotten snapshot and release deploy working fine. But not it looks like our requests for artifacts from Central and other public repositories are proxying through our release repository.

After a good bit of reading I'm still confused how to achieve two things:
  1. Store and retrieve our snapshots and releases (anything that is in group (com.acmeinc) on our Nexus server.
  2. Make sure all other retrieval requests do not use our snapshot or release repositories.
Other than the Maven and Nexus reference documents is there a more specific document/discussion that might help?

Thank you

--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: (480) 577-6834 office: (480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.

Reply | Threaded
Open this post in threaded view
|

Re: Guidance on simple Nexus setup

Richard Mixon
Rich,

My take was exactly as yours - what could the downside be. The rub came down to two reasons:
  1. Our lead developer needed to get a project out quickly and I was not around to add a new repository to Nexus - this slowed him down;
  2. If someone is working offsite, things need to keep working (obviously request for internal artifacts will fail). 

Six months from now, our answer may be different, but for now we want to keep it a bit simpler (hopefully).

I took a quick look at the references you mentioned. I can see how using the advanced mirror configuration you end up with two logical repositories one for "com.acme" and the other for everything else. Looking at the Maven settings I don't see a way to say that everything that is not group id "com.acmeinc" does not go to a particular location. Or am I just not seeing it?

Thanks - Richard



On Thu, Jan 9, 2014 at 3:27 PM, Richard Seddon <[hidden email]> wrote:

Hi Richard,

Is there some downside to using a single group repository in Nexus that you're trying to avoid?

Because in my experience there are only upsides.  You never have to change your settings.xml, you get faster builds, and if you find you need to get dependencies from another repository than central you can add it in seamlessly.  See here for our recommended setup:


If you're really determined to do this you'll need to have multiple repositories in your settings.xml.  See these resources for details on how to set this up:


Basically, you either have no mirrorOf section, or you have one that mirrors to nexus for everything but central.

But I think you'll find that Maven is not as efficient at dealing with multiple repositories as Nexus is.  And I'm sure you'll find the multiple repository setup much harder to maintain in Maven than it is in Nexus.

Regards,

Rich





On Jan 9, 2014, at 3:42 PM, Richard Mixon <[hidden email]> wrote:

We have are getting started using Nexus OSS. Our organization is really small - one developer behind our firewall and one that works mostly remote. The first item we need to do is host our snapshot and release artifacts.

We have the basic setup working but have decided, at least for now, we really don't need or want to cache public repositories. With two developers the bandwidth and caching issues are just not important to us (yet). And we don't really want to complicate our developer ~/.m2/settings.xml files any more than necessary.

I've gotten snapshot and release deploy working fine. But not it looks like our requests for artifacts from Central and other public repositories are proxying through our release repository.

After a good bit of reading I'm still confused how to achieve two things:
  1. Store and retrieve our snapshots and releases (anything that is in group (com.acmeinc) on our Nexus server.
  2. Make sure all other retrieval requests do not use our snapshot or release repositories.
Other than the Maven and Nexus reference documents is there a more specific document/discussion that might help?

Thank you

--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: <a href="tel:%28480%29%20577-6834" value="+14805776834" target="_blank">(480) 577-6834 office: <a href="tel:%28480%29%20614-3442" value="+14806143442" target="_blank">(480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.




--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: (480) 577-6834 office: (480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.
Reply | Threaded
Open this post in threaded view
|

Re: Guidance on simple Nexus setup

Rich Seddon
Well, we'll have to disagree about point #2, I think it's so easy to get a Nexus instance up that off site developers should go ahead and do it, and create a proxy repo to your Nexus instance.  :-)

Anyhow, as for point #1, sure, if he needs a repository before you can get it into your nexus instance then changing the settings.xml provides a workaround.

But it doesn't work on group ID's, it works on repository ID's.

So you can do this:

    <mirror>
      <id>nexus</id>
      <mirrorOf>external:*,!foo</mirrorOf>
    </mirror>

And then in the repositories section have:

        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
        <repository>
          <id>foo</id>
          <url>http://some.new.repository</url>
          <releases>
            <enabled>true</enabled>
          </releases>
       </repository>

This will provide a temporary workaround for the situation you've described. If snapshots are needed from it you'll need to enable those in the new repository definition.

Rich


On Jan 9, 2014, at 4:52 PM, Richard Mixon <[hidden email]> wrote:

Rich,

My take was exactly as yours - what could the downside be. The rub came down to two reasons:
  1. Our lead developer needed to get a project out quickly and I was not around to add a new repository to Nexus - this slowed him down;
  2. If someone is working offsite, things need to keep working (obviously request for internal artifacts will fail). 

Six months from now, our answer may be different, but for now we want to keep it a bit simpler (hopefully).

I took a quick look at the references you mentioned. I can see how using the advanced mirror configuration you end up with two logical repositories one for "com.acme" and the other for everything else. Looking at the Maven settings I don't see a way to say that everything that is not group id "com.acmeinc" does not go to a particular location. Or am I just not seeing it?

Thanks - Richard



On Thu, Jan 9, 2014 at 3:27 PM, Richard Seddon <[hidden email]> wrote:

Hi Richard,

Is there some downside to using a single group repository in Nexus that you're trying to avoid?

Because in my experience there are only upsides.  You never have to change your settings.xml, you get faster builds, and if you find you need to get dependencies from another repository than central you can add it in seamlessly.  See here for our recommended setup:


If you're really determined to do this you'll need to have multiple repositories in your settings.xml.  See these resources for details on how to set this up:


Basically, you either have no mirrorOf section, or you have one that mirrors to nexus for everything but central.

But I think you'll find that Maven is not as efficient at dealing with multiple repositories as Nexus is.  And I'm sure you'll find the multiple repository setup much harder to maintain in Maven than it is in Nexus.

Regards,

Rich





On Jan 9, 2014, at 3:42 PM, Richard Mixon <[hidden email]> wrote:

We have are getting started using Nexus OSS. Our organization is really small - one developer behind our firewall and one that works mostly remote. The first item we need to do is host our snapshot and release artifacts.

We have the basic setup working but have decided, at least for now, we really don't need or want to cache public repositories. With two developers the bandwidth and caching issues are just not important to us (yet). And we don't really want to complicate our developer ~/.m2/settings.xml files any more than necessary.

I've gotten snapshot and release deploy working fine. But not it looks like our requests for artifacts from Central and other public repositories are proxying through our release repository.

After a good bit of reading I'm still confused how to achieve two things:
  1. Store and retrieve our snapshots and releases (anything that is in group (com.acmeinc) on our Nexus server.
  2. Make sure all other retrieval requests do not use our snapshot or release repositories.
Other than the Maven and Nexus reference documents is there a more specific document/discussion that might help?

Thank you

--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: <a href="tel:%28480%29%20577-6834" value="+14805776834" target="_blank">(480) 577-6834 office: <a href="tel:%28480%29%20614-3442" value="+14806143442" target="_blank">(480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.




--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: (480) 577-6834 office: (480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.

Reply | Threaded
Open this post in threaded view
|

Re: Guidance on simple Nexus setup

Richard Mixon
Richard,

Thank's great - I see how that can work. The changes to the settings.xml don't look that hard.

Still, after thinking a bit I wonder if something like this might be simpler in our situation, in that it requires a bit less settings.xml configuration:

1. Setup Nexus in the recommended single group, including our release and snapshot repositories.

2. Create three profiles in ~/.m2/settings.xml (our hostnames are different inside and outside due to a router/port-forwarding problem):
     - behindFirewallWithNexus
     - outsideFirewallWithNexus
     - defaultMavenSettings

3. Add the following "<activeProfiles>" at the bottom of the settings.xml:
  <activeProfiles>
    <!-- Update the activeProfile tag to be either:
            behindFirewallWithNexus
            outsideFirewallWithNexus
            defaultMavenSettings
    -->
    <activeProfile>behindFirewallWithNexus</activeProfile>
  </activeProfiles>
 
4. Under "normal circumstances, depending on if you are in the office or out of the office you update a single "<activeProfile>" tag in settings.xml to choose the appropriate *FirewallWithNexus profile.

5. In a short-term emergency where you need to access a new external repository, you just change the "<activeProfile>" tag to point to the default settings which know nothing about the Nexus server. It will prevent you from getting updated internal release or snapshot artifacts for the time being, but I'm thinking that will not be much of an issue.

Is there anything I'm not considering here?

Thank you again - Richard



On Thu, Jan 9, 2014 at 4:06 PM, Richard Seddon <[hidden email]> wrote:
Well, we'll have to disagree about point #2, I think it's so easy to get a Nexus instance up that off site developers should go ahead and do it, and create a proxy repo to your Nexus instance.  :-)

Anyhow, as for point #1, sure, if he needs a repository before you can get it into your nexus instance then changing the settings.xml provides a workaround.

But it doesn't work on group ID's, it works on repository ID's.

So you can do this:

    <mirror>
      <id>nexus</id>
      <mirrorOf>external:*,!foo</mirrorOf>
    </mirror>

And then in the repositories section have:

        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
        <repository>
          <id>foo</id>
          <url>http://some.new.repository</url>
          <releases>
            <enabled>true</enabled>
          </releases>
       </repository>

This will provide a temporary workaround for the situation you've described. If snapshots are needed from it you'll need to enable those in the new repository definition.

Rich


On Jan 9, 2014, at 4:52 PM, Richard Mixon <[hidden email]> wrote:

Rich,

My take was exactly as yours - what could the downside be. The rub came down to two reasons:
  1. Our lead developer needed to get a project out quickly and I was not around to add a new repository to Nexus - this slowed him down;
  2. If someone is working offsite, things need to keep working (obviously request for internal artifacts will fail). 

Six months from now, our answer may be different, but for now we want to keep it a bit simpler (hopefully).

I took a quick look at the references you mentioned. I can see how using the advanced mirror configuration you end up with two logical repositories one for "com.acme" and the other for everything else. Looking at the Maven settings I don't see a way to say that everything that is not group id "com.acmeinc" does not go to a particular location. Or am I just not seeing it?

Thanks - Richard



On Thu, Jan 9, 2014 at 3:27 PM, Richard Seddon <[hidden email]> wrote:

Hi Richard,

Is there some downside to using a single group repository in Nexus that you're trying to avoid?

Because in my experience there are only upsides.  You never have to change your settings.xml, you get faster builds, and if you find you need to get dependencies from another repository than central you can add it in seamlessly.  See here for our recommended setup:


If you're really determined to do this you'll need to have multiple repositories in your settings.xml.  See these resources for details on how to set this up:


Basically, you either have no mirrorOf section, or you have one that mirrors to nexus for everything but central.

But I think you'll find that Maven is not as efficient at dealing with multiple repositories as Nexus is.  And I'm sure you'll find the multiple repository setup much harder to maintain in Maven than it is in Nexus.

Regards,

Rich





On Jan 9, 2014, at 3:42 PM, Richard Mixon <[hidden email]> wrote:

We have are getting started using Nexus OSS. Our organization is really small - one developer behind our firewall and one that works mostly remote. The first item we need to do is host our snapshot and release artifacts.

We have the basic setup working but have decided, at least for now, we really don't need or want to cache public repositories. With two developers the bandwidth and caching issues are just not important to us (yet). And we don't really want to complicate our developer ~/.m2/settings.xml files any more than necessary.

I've gotten snapshot and release deploy working fine. But not it looks like our requests for artifacts from Central and other public repositories are proxying through our release repository.

After a good bit of reading I'm still confused how to achieve two things:
  1. Store and retrieve our snapshots and releases (anything that is in group (com.acmeinc) on our Nexus server.
  2. Make sure all other retrieval requests do not use our snapshot or release repositories.
Other than the Maven and Nexus reference documents is there a more specific document/discussion that might help?

Thank you

--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: <a href="tel:%28480%29%20577-6834" value="+14805776834" target="_blank">(480) 577-6834 office: <a href="tel:%28480%29%20614-3442" value="+14806143442" target="_blank">(480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.




--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: <a href="tel:%28480%29%20577-6834" value="+14805776834" target="_blank">(480) 577-6834 office: <a href="tel:%28480%29%20614-3442" value="+14806143442" target="_blank">(480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.




--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: (480) 577-6834 office: (480) 614-3442
email: [hidden email] <mailto:[hidden email]>
Microsoft Partner ID: 1263725 
The messages and documents transmitted with this notice contain confidential information belonging to the sender. If you are not the intended recipient of this information, you are hereby notified that any disclosure, copying, distribution or use of the information is strictly prohibited. If you have received this transmission in error, please notify the sender immediately.