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

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}"
}

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.

JFrog Pipelines - Artifactory not found error in build step

I am trying to setup JFrog Pipelines. I am new to this so starting small with a pipleline that just has a single npm build step. The source code is taken from github. When I run the pipeline, I get a 404 not found error in the artifactory_configure task. I double checked the Artifactory Integration but the error persists. Any ideas on how to solve it.
Please make sure that you include the Artifactory context as part of the URL when creating the Artifactory integration. For example:
https://xxx.jfrog.io/artifactory

Bitbucket pipelines: The type or namespace name could not be found

I'm hoping someone can help me out. Thanks!
I'm trying to deploy my dotnet core 2.0 API
When I try and build the project with bitbucket pipelines I get multiple errors finding references. It does restore the project successfully.
However the project builds successfully on my laptop.
folder structure:
/API
/Controllers
/Migrations
/Models
/Services
API.csproj
Program.cs
Startup.cs
bitbucket-pipelines.yml
pipelines:
default:
- step:
image: microsoft/dotnet
name: Check if it builds
script:
- cd API
- dotnet build
example error:
Services/MyService.cs(18,29): error CS0246: The type or namespace name 'IRepository<>' could not be found (are you missing a using directive or an assembly reference?) [/opt/atlassian/pipelines/agent/build/API/API.csproj]
Note I have the latest version of dotnet, same as I'm using in bitbucket pipelines. I have checked via running dotnet --info
Finally i've figured out what was the cause of this issue. I feel really silly for not figuring this out sooner.
My git repository was somehow setup with ignorecase = true.
I have switched it to false (which will prevent this issue in the future).
This means that I can have two of the same files or folders.
I had renamed a folder to a different case.
My repo had
API/
API.csproj
and
api/
api.csproj
My Mac couldn't allow for both so I only saw one folder and one project on my local machine.
To fix this, I had to git rm -r --cached api
This deleted the duplicate folder
I had the project file as a duplicate as well so used git rm -f api.csproj to remove the file from the repository.
Then git pull to bring those changes into my local master branch.

Get error 500 in gitlab's CI process

I installed gitlab with my own Nginx(I disabled the build-in nginx), Everything works fine before I tried to use CI in it.
After I commit the pipeline started, and give the message:
Running with gitlab-runner 10.1.0 (c1ecf97f)
on the runner for wxEditor (fccd792d)
Using Docker executor with image node:8.8.1 ...
Using docker image
sha256:c3a98397674933da01d4fc1e90dc880b1fb0760fedc43515e7660dcc58c6af28 for
predefined container...
Pulling docker image node:8.8.1 ...
Using docker image node:8.8.1
ID=sha256:d575940ea42b064ac3fa5b00c36ec099968ce2ae542488d1d8673f100dc0a622 for
build container...
Running on runner-fccd792d-project-2-concurrent-0 via vps143760...
Cloning repository...
Cloning into '/builds/zhaozhong/wxEditor'...
fatal: unable to access 'http://gitlab-ci-
token:xxxxxxxxxxxxxxxxxxxx#gitlab.dingshao.cc/zhaozhong/wxEditor.git/': The
requested URL returned error: 500
ERROR: Job failed: exit code 1
I've got stucked here for a hole day.
Gitlab EE: 10.1.0, ubuntu 16.04
Thanks
Problem solved!
I ran gitlab with my excisting nginx and use an old nginx config file, and there should be nginx + passenger which insure gitlab to get to work.
After read this anwer, I reinstalled Nginx together with passenger, and copy the bundled Nginx's config file gitlab-http.conf to the Nginx's sites-enable folder, every works perfect then.

Karaf cannot install war feature

Recently I need to deploy something on Karaf. I use Karaf 3.0.2 and event try 4.0.0M1. Both are not able to install war feature. Once I type feature:install war in console after Karaf start-up.
3.0.2 gives me:
Error executing command: Error resolving artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0: Could not find artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0
4.0.0M! gives me:
Erroe executing command: Error
I try to delete Maven and reinstall it. The issue is still there. It's not happened on other machine.
It's a strange issue. Could anyone meet it ever? Could anyone help me out?
As it works on the other machines, it's something on that certain machine.
Without much more details on the setup I'm using assumptions here.
1) No Network connection to the central repo
2) Using a Proxy wich isn't configured or configured wrong on the server
3) Using a nexus with credentials and those aren't configured or configured wrong
I encountered the same issue and it was because there were mirrors defined in my Maven settings.xml (due to usage in another project). After I commented them out I was able to install the karaf war deployer.

Resources