How to create yum proxy repository with nexus OSS complete example - nexus

I have some question:
How to write the url of remote repository while creating proxy repository in nexus OSS.What is the value of $releasever and $basearch
- http://path/to/repo/releases/$releasever/server/$basearch/os/

There is a nexus alternative and more lightweight, named Repocache.

Related

Is it possible to make gradlew to work with nexus?

I have a build machine for Android app. This machine has no access to the Internet.
There is a local nexus repository. Application gradle set up to load dependencies from this nexus repository and it works fine.
But I also need gradlew to load from that nexus repository too.
I've tried to set distributionUrl to local nexus url and it works - distribution is installed and daemon is started.
But next it fails to load https://dl.google.com/android/repository/addons_list-5.xml with timeout
Is there a way to redirect all gradle requests to nexus repositories?
To redirect all Gradle requests to your Nexus repository, you can add the following to your gradle.properties file:
systemProp.http.proxyHost=<hostname>
systemProp.http.proxyPort=<port>
systemProp.http.nonProxyHosts=localhost|127.0.0.1
Replace and with the hostname and port of your Nexus repository. This will tell Gradle to use your local Nexus repository for all dependencies, including the addons_list-5.xml file that you are currently having trouble loading.
It's also a good idea to make sure that your Nexus repository is properly configured and has all the necessary dependencies. You can check the logs of your Nexus repository to see if there are any errors or issues that might be preventing Gradle from accessing the dependencies it needs.

Creating a full replica/offline copy of the public pypi repository

Nexus Repository Manager OSS 3.9.0-01.
I wish to create a 'proxy' Nexus repository that will a replica of the public pypi repository. The other machines can then be configured to point to this Nexus repo. so that a 'pip install' on these machines works even if there is no Internet connection. Accordingly, I created a proxy repository of type 'pypi(proxy)'.
When I browse this repo, there aren't any components/assets but whenever someone does a 'pip install' by pointing to this repo, the package shows up in the interface e.g: pip install --user pyspark --verbose
What I am looking for is to clone/copy all the packages in the PyPI repository at once so that the future 'pip install' refers to this local copy and doesn't go to the Internet every time. Once a day, the local copy should be updated.
Is it possible to do so in Nexus OSS?
What you are trying to achieve is a PyPI mirror repository, not a proxy.
The PyPI proxy repository behaviour you described is correct, because it is a proxy, not a mirror. Nexus Repository Manager does not provide functionality to to create a mirror of another repository.
However, you could try to use a PyPI mirror client (e.g. bandersnatch) to obtain a copy of all packages, then move those files over to your PyPI hosted repository and ask Nexus to reindex the files. Later you would have to periodically repeat the process to keep your mirror up to date.

Smart remote repositories on Artifactory OSS

I am trying to set up some Maven smart remote repositories on an Artifactory OSS instance (version is 5.4.5).
I am following the guide at https://www.jfrog.com/confluence/display/RTF/Smart+Remote+Repositories and configuring the remote repository as follows:
Package type: Maven
Repository key: foo-repo
URL: http://artifactory.mycompany.com/artifactory/api/foo-repo
All I get when I input that and click on "Test" to test the connection is a message telling me that there was a 404.
If I test the same values on an Artifactory Pro instance (also version 5.4.5), I get the expected "Artifact Remote Repository Detected" dialog, as described in the documentation.
So can anyone confirm that smart remote repositories are a "Pro" only feature? The tutorial page at https://www.jfrog.com/confluence/display/RTF/Smart+Remote+Repositories doesn't make this clear at all...
Yes, the "Smart Remote Repository" is a PRO version feature.

How to solve 405 error on maven build to Nexus 3?

I have created proxy repos in Nexus 3 pointing to Nexus 2 hosted repositories. This is to snapshot and release repositories on Nexus 2. Now, on distributionManagement tag, I am using the proxy URLs and trying do a mvn clean deploy. I am getting the following error:
[INFO] Error deploying artifact: Failed to transfer file: http://nexus3url/repository/m2-snapshots/path/abc-1.1.4-SNAPSHOT.pom. Return code is: 405
Has anyone tried this?
As indicated in the comments, you can only deploy to Maven Hosted Repositories, not Proxies. This is by design.
I faced same issue when I try to deploy application into nexus 3 repository.
In my case the url is not proxy but path was wrong.
If you are trying to deploy snapshot version make sure url pointing to nexus snapshot repository location.
if it is release version url should point to release repository.
Your Nexus folder type should be host and try
mvn deploy
command by using pipeline.
configFileProvider([configFile(fileId: '1880060f-32be-4888-a77d-eb046cab6981', variable: 'MAVEN_SETTINGS')]) {
sh "/jenkins_new/jenkins/home/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.5.0/bin/mvn -s $MAVEN_SETTINGS deploy:deploy-file -DgroupId=net.cyc -DartifactId=${pom.artifactId} -Dversion=${pom.version} -DgeneratePom=true -Dpackaging=jar -DrepositoryId=nbtnexus -Durl=https://dexus.connectcare.net/repository/maven-snapshots/ -DpomFile=pom.xml -Dfile=target/${pom.artifactId}-${pom.version}.${pom.packaging}"
}

Uploading an artifact to Nexus from Jenkins on Cloudbees

I want to upload an artifact from Jenkins running on Cloudbees to Nexus central, since my one is an OSS project stored in Maven Central. To do so, I need to install gpg keys locally. How can I do this on Cloudbees. I've done it on my local Linux box but I'd need access to some sort of Linux environment on Cloudbees.
Regards,
Marco
You can upload your gpg key to your private repository on cloudbees forge, and set maven job to use -Dgpg.homedir=/private/

Resources