Error when configuring TeamCity's Artifactory plugin - teamcity

I have installed the Teamcity Artifactory plugin on my Teamcity 10 but when I configure the artifactory by providing the server URL and doing the Test Connection it gives below error:
Error occurred while requesting version information: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (javax.net.ssl.SSLHandshakeException)

It seems that the TeamCity instance is unable to reach your Artifactory instance.
Can you do a ping call from the TeamCity to Artifactory? Even better will be to run the Artifactory REST API call for the system ping, using your defined URL of Artifactory in TeamCity.
The REST should look like that:
curl -u user:password "https://{artifactoryURL}:{port}/artifactory/api/system/ping"
After running this from TeamCity instance see if you are able to reach the Artifactory instance.
Also, do you have any proxy server between TeamCity to Artifactory? From the error it seems like there is a proxy server in the middle, if so please follow the instructions on how to configure the TeamCity Artifactory plugin to go via the proxy server here.

Related

Authentication failes with 401 while intelij maven downloading specific pom from nexus but is opened from url

getting below error while running mvn install on intelij project:
"Could not transfer artifact ... from... public < nexus repository url which define in setting.xml correctly under mirror with correct id configuration and server etc >
Authentication failed for <.pom inside previous url that mentioned > 401 Unauthorized"
I can login to mirror url that provide in settings.xml with the username/pass provided under server definition and access that .pom etc.
any idea what I am missing inside intelij to get it fixed?

Skip ssl certificates check for Maven in Jenkins

I am trying to integrate Jenkins maven plugin to pull dependencies from a local nexus server. When the build starts I end up with the following Error
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I have tried to disable it by suppling the following wagon ssl properties as MAVEN_OPTS:
-Dmaven.wagon.http.ssl.insecure=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.ignore.validity.dates=true
I have also tried to add the certificate to the
javahome/lib/security/cacerts of the JVM.
using the key tool
are there any additional things I should try to disable the self-signed certificate check.

How to connect remote repository in JFrog Artifactory to repo.manento.com?

Is possible to add repo.magento.com as a remote repository to Jfrog Artifactory?
I added repo.magento.com as remote php repo but when I try to require a module like "magento/product-community-edition" in the Artifactory logs I see the error
Error occurred while parsing the response of a remote composer package JSON query on 'https://repo.magento.com/p/magento.json': Expected a file but found a folder, at: php-magento:.composer/p/magento.json
This occurs because repo.magento.com doesn't use lazy url but explicit all packages in https://repo.magento.com/packages.json.
There is any way to customize Artifactory packages.json to prevent lazy url?
I asked to jFrog support and they answer me
Currently Artifactory does not support repo.magento.com.
I created and issue on JFrog Jira https://www.jfrog.com/jira/browse/RTFACT-18169

Forbidden (404?) to download yarn artifact using Artifactory and Github

I have an issue with Jfrog Artifactory and Yarn. I'm not able to download an artifact when I run mvn clean install ...
I have added an artifact yarnpkg-releases inside my Artifactory.
It refers to https://github.com/yarnpkg/yarn/releases/download/.
This URL on its own returns a 404. I don't know if this is a problem?
My maven install tries to download https://my-url/artifactory/yarnpkg-releases/v0.28.4/yarn-v0.28.4.tar.gz and it returns a 404:forbidden. (Yes not 404 not found or 403 forbidden).
In my mindset, this URL will resolve to https://github.com/yarnpkg/yarn/releases/download/v0.28.4/yarn-v0.28.4.tar.gz which returns the right tar.gz.
I have a .yarn file in which I configure the URL to my registry and I ignore SSL. What can cause this issue?
Also with a curl (using user:passwd) I got the same error.
I have the same set up for a node artifact. The node artifact points to this URL
When I try curl -uuser:passwd -O "https://my-url/artifactory/nodejs-dist/v0.1.104/node-v0.1.104.tar.gz" it works so I don't understand why this is not working for my yarn artifact.
I think the issue is with your URL.
Actual artifactory is available in the below location
https://codeload.github.com/yarnpkg/yarn/tar.gz/v0.28.3/yarn-0.28.3.tar.gz

Maven error: Unable to get resource / Server redirected too many times

Our proxy went down and I tried to update dependencies with Maven while it was off.
Since then I can't download anything with Maven.
I get this error for everything.
I tried -U option, deleting my local repository and tried different Maven version (2.0.9, 2.2.1) but it doesn't work.
Any idea how to solve this?
Earlier it also said 'repository will be blacklisted' to all of them.
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.1/maven-compiler-plugin-2.1.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-compiler-plugin:pom:2.1' from repository central (http://repo1.maven.org/maven2): Error transferring file: Server redirected too many times (20)
org.apache.maven.plugins:maven-compiler-plugin:pom:2.1
from the specified remote repositories:
jboss-snapshot (http://snapshots.jboss.org/maven2),
central (http://repo1.maven.org/maven2),
JBoss Repo (http://repository.jboss.com/maven2),
spring-maven-snapshot (http://maven.springframework.org/snapshot),
com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external),
com.springsource.repository.bundles.snapshot (http://repository.springsource.com/maven/bundles/snapshot),
jboss (http://repository.jboss.com/maven2),
com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release),
jboss-snapshot-plugins (http://snapshots.jboss.org/maven2),
com.springsource.repository.bundles.milestone (http://repository.springsource.com/maven/bundles/milestone),
jboss-plugins (http://repository.jboss.com/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
... 25 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
... 27 more
I got the same error with Windows ISA proxy.
I had to put my Windows domain name and username in ~/.m2/settings.xml like this:
<username>DOMAIN\USERNAME</username>
I don't know how this solved it but I changed my password (domain/proxy) and now it works.
I had same problem.
The problem is 'domain' in file settings.xml
<proxy>
...
<username>DOMAIN\user</username>
...
</proxy>
DOMAIN is optional if you launch maven in Microsoft Systems but it is mandatory if you launch maven in UNIX systems with domain authentication and remapped user (user home is in /home/DOMAIN/user), I found this trick in empiric way.
Something that happened to me was that when I installed Maven, it added proxy information in ~/.m2/settings.xml. I don't have a proxy, so I'm not sure where it came from, but that prevented me from being able to download anything. After removing the proxy info, downloads were successful.
If you need a proxy server section, but want to connect to a repository on the intranet you can add an exclusion list: <nonProxyHosts>localhost|repoHost<nonProxyHosts>

Resources