Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Sonatype nexus in local network [closed]

I've successfully created a small software engineering environment (SEE) for Java applications that is - amongst other tools - based on maven and nexus. My actual problem is - not a real surprise - that nexus usually requires access to the internet to to get the requested artifacts from the central repositories. But the SEE has to be strictly off-line and there's no way to change it (.. security reasons).

My first quick solution was to mirror the nexus/maven installation on machine, that was connected to the internet, run some standard pom's to populate the mirrored nexus and migrate the cache via CD-ROM to the target system. Pretty ugly. I'm not really looking forward to adapt that process to get updates for artifacts or new ones. In fact, we now usually just import the libraries we need and create new artifacts (with nexus) instead using the official ones from central and others.

Has anybody faced the same challenge and found a more clever and efficient approach?

Edit

Thanks for all the answers, I think I have to be more precise on the actual problem and the solution I'm thinking of at the moment: I think I have to create, populate and synchronize a private 'central' repository, based on central and other repos on the internet, or exactly: two identical repositories. One connected to the internet the other on the local network. Then I can keep the internet connected repository 'up-to-date' and copy the changes via DVD to the local repository - which is visible for Nexus.

Would it work? Is there documentation available on how to setup something like 'central' on a private server, is there a mechanism to synchronize selected artifacts?

(didn't want to post my thoughts at the beginning because I hoped to get totally different ideas)

Edit 2 - "best practice" - added on request

Our "best practice" for using maven in an environment which is totally disconnected from the internet:

  • We installed nexus on a central server, so that the software development workstations had a server to talk to (and it was our own artefact repository)
  • We exported the POM files to a workstation with internet access, cleared the local repository on that machine and did a dependency:go-offline (plugin). This populated the local repository with all required artedfacts
  • We imported this local repository to the secure environment and added all plugins to nexus (just copied the files - the structure is identical)

Do this once a week with all POM files (can be automated) and you have a quite stable and usable local repository.

like image 682
Andreas Dolk Avatar asked Nov 16 '09 11:11

Andreas Dolk


People also ask

How do I run nexus Sonatype?

To use the user interface, fire up a web browser and type in the URL http://localhost:8081/nexus . You should see the user interface as displayed in Figure 3.5, “Application Window”. While we use localhost throughout this book, you may need to use the IP Loopback Address of 127.0.

What happens when the repository Manager is unable to reach a remote repository?

If the repository manager fails to locate a component, it will cache this result for a given number of minutes. In other words, if the repository manager can't find a component in a remote repository, it will not perform repeated attempts to resolve this component until the Not Found Cache TTL time has been exceeded.

What port does nexus listen on?

By default, the repository manager listens on port 8081. You can change this port, by changing the value in the $NEXUS_HOME/conf/nexus. properties file shown in "Contents of conf/nexus.


1 Answers

Would it work? Is there documentation available on how to setup something like 'central' on a private server, is there a mechanism to synchronize selected artifacts?

Well, you could become a mirror of central but, what's the point of grabbing ~10 GB of artifacts? You won't need all of them and the usual recommendation is to use a repository manager.

Actually my initial thoughts was:

  1. Use a Nexus connected to the internet outside the SEE
  2. rsync the content of this Nexus to a DVD.
  3. Copy the content to the Nexus of the SEE via a DVD.
  4. Repeat periodically.

I found this solution ugly but, now that we have more details on your situation, it might be an acceptable.

like image 174
Pascal Thivent Avatar answered Sep 19 '22 09:09

Pascal Thivent