No versions could be resolved for groupid.artifactid error when using Repository Connector - maven

I want to simply download a war file from a Nexus repo and deploy it on a remote tomcat server.
I found this plugin https://wiki.jenkins.io/display/JENKINS/Repository+Connector+Plugin, which seems to help me do the same.
I have the following configuration:
In hue-central, I have correctly configured the repo url.
If I open <repo url>/com/worksap/company/hue-interface-front in my browser, I can see all the versions along with maven-metadata.xml, which contains all the versions.
Am I missing something?

Try following: Go to Jenkins Administration / System configuration, find the Artifact Resolver section, and check Repo Type of your repository. If it is empty, set it to "default". It was causing the same problem in my case.
Example here.

Related

Receiving 404 for maven-metadata.xml from Artifactory remote repo of repo.grails.org

I am trying to setup the https://repo.grails.org/core repository as a remote repository on my artifactory instance. If I use that URL directly in the configuration, I can pull everything except the maven-metadata.xml. Maven will throw an error saying it got a 404 for it, and I can verify that by trying to manually pull it through my remote repo.
I have also tried setting up the remote as a smart remote, entering just https://repo.grails.org/artifactory. It will recognize it as an artifactory server, but if I hit Test I get a 500 error. Saving the settings the repo shows no artifacts.
I have also tried https://repo.grails.org/artifactory/core, /artifactory/api/core, /artifactory/api/maven/core, /grails/core as well as a few others and those that work for retrieving jar or pom files still give a 404 for the maven-metadata.xml.
What is the correct way to configure the repo.grails.org repo as a remote repository?
I have tried this is both the 7.29 and 7.3 versions of artifactory with the same result.
From our previous experience, it was understood that grails repository core that you are pointing to is a virtual repository. grails admins might have added all the remote and local repositories under this. But artifactory does not support virtual repositories for smart remote repositories. You may need to point to the correct path.
You may try to point to https://repo.grails.org/core and then can you share the full path of the file that you are trying to download and facing the issues right now.

Maven dependency not getting resolved in Intellij

I have Maven setup and updated settings.xml with proxy settings. While working on project it is unable to load any dependency in IntelliJ.
I verified all the config with one of my friend and its working in his machine correctly. Please help.
Ensure that you are pointing to correct settings.xml in the configuration of intellij
Go to-->File-->Settings-->Build,Execution,Deployment-->Mavan
and validate user settings file and local repository file, if its having different details update the path or replace the file.

how to do force deploy maven project via jenkins..?

when I do deploy of maven project via jenkins the output says success but i cant see changes on the server. what i can see is the target folder on the jenkins server contain all the required changes but dont know why it is unable to deploy those files on the test server, below are some details.
command to deploy
clean package jboss-as:deploy -DjbossUser=${jbossUser} -DjbossPass=${jbossPass} -DjbossServer=${jbossServer} -DjbossServerPort=${jbossServerPort}
file type that contain the changes : *.html & *.js
Any help is appreciated
Thanks
Kapil
I also faced similar issue. It seems there are some deploy mechanism exists in Jenkins where the version is configured. It should take the build(snapshot) version from pom.xml

Why do I get a 400 when attempting to use publish-plugin from the Grails Release plugin

I'm using Grails 2.4.1 & The Grails Release plugin version 3.0.1.
I have a Sonatype nexus repository (v2.3.1-01) setup that's in use by several other projects with no issues.
I'm attempting to create a new Plugin that I want to distribute through a SNAPSHOT repository in nexus (and later through our Releases repository).
In my ${projectName}GrailsPlugin.groovy file I have:
def groupId ="my-department-grails-plugins"
def version = "0.1-SNAPSHOT"
In my application.properties file I have:
app.name=MyPluginNameForGrails
In my BuildConfig.groovy I have:
grails.project.repos.newsnapshots.url = "http://internal.server.address/nexus/service/local/repositories/snapshots"
grails.project.repos.newsnapshots.username = "username"
grails.project.repos.newsnapshots.password = "password"
I'm trying to kick things off with the following command:
publish-plugin --snapshot --repository=newsnapshots --stacktrace
The build success everything looks good until it trys to push into nexus and I get:
Using configured username and password from
grails.project.repos.newsnapshots ....Error | Failed to publish
plugin: Error deploying artifact
'ald-grails-plugins:my-plugin-name-for-grails:zip': Error deploying
artifact: Failed to transfer file:
http://internal.server.address/nexus/content/groups/public/my-department-grails-plugins/my-plugin-name-for-grails/0.1-SNAPSHOT/my-plugin-name-for-grails-0.1-20140815.191240-1.zip.
Return code is: 400
I've found a related StackOverflow question which seems related but none of the conditions they describe as causing the 400 exist.
I also found the article by Sonatype Nexus which describes possible causes of 400's and those don't seem to be it either.
If you notice the repository that I'm pointing to, it is directly to a repository but then in the error message it lists a path to a group. I am thinking this may be somehow related but but if so... I am not sure how to fix it since this seems to be happening somehow internal to the Releases Plugin.
I should also add that I've removed the -SNAPSHOT from the GrailsPlugin.groovy file and changed the destination repository to be our RELEASES repository with the exact same result.
My problem was due to a mirror defined in my .m2/settings.xml file (thanks Jeff Beck for the comment that led to the resolution!). This was causing the POST to the repository to be redirected to the public GROUP which wasn't allowing the artifact to be uploaded.
There are a few other secondary causes that were contributing to my troubleshooting issues:
While uploading to a SNAPSHOT repository your version number must
be of the pattern x-SNAPSHOT where x can be anything(?).
You cannot upload to a SNAPSHOT repository when using the Nexus ReST
API. This didn't actually end up affecting my specific solution but
it's worth noting for others that may run into this issue.
While uploading to a NON-SNAPSHOT repository your version number must NOT
be of the pattern x-SNAPSHOT.
Given a mirror setting in the .m2 directory the grails release plugin will have issues trying to deploy xif the mirror matches where you are deploying to. You can remove the mirror setting or change it to not match your targeted repo. Check out these jiras for more info:
GPRELEASE-7
GPMAVENPUBLISHER-3

Maven Error: No plugin found for prefix ‘archetype’ in the current project using Nexus

I am trying to setup MAVEN in my company's local network which is not connected to the internet directly. Also I'm using sonatype nexus for my central repository.
Problem starts when I run the command mvn archetype:create. The result is always build failure.
error no plugin found for prefix 'archetype' in the current project.
How do I solve this issue?
Maven is trying to look up the full plugin artifact ID that corresponds the "archetype" prefix.
To do this it reads the available prefixes from this path: /org/apache/maven/plugins/maven-metadata.xml
Since you're using Nexus this is likely coming from a group repository, e.g.:
http://:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml
You'll need to look carefully at your maven configuration and your build log to see where exactly it is trying to retrieve this information. There will likely be additional information about the failure if you run Maven with the debug ("-X") flag.
If it's trying to retrieve it from your Nexus instance see here for information on how to diagnose the issue:
https://support.sonatype.com/entries/21437881

Resources