Artifactory Remote Repository (Maven Central) - Unauthorized - repository

I try to configure Artifactory (2.6.4 rev. 13153) to use Maven Central as a remote repository. For this I configuered the remote repository (please see screenshots below). In gradle.build I configured:
repositories {
maven {
url artifactoryBaseUrl + 'build-libs'
}
maven {
url artifactoryBaseUrl + 'mcentral'
}
}
Using Artifactory's simple browser I can browse Maven Central using my remote repo "mcentral" but when running gradle I get an error:
D:\...\at.mic.all.hermes>gradle build
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.apache.myfaces.trinidad:trinidad-impl:1.0.13.
Required by:
at.mic.all.hermes:at.mic.all.hermes:20150924104503
> Could not GET 'http://mic-build2.mic.co.at:8082/artifactory/mcentral/org/apache/myfaces/trinidad/trinidad-impl/1.0.13/trinidad-impl-1.0.13.pom'. Received status code 401 from server: Unauthorized
BUILD FAILED
Any ideas what I made wrong? I would highly appreciate any help. Thanks!
Frank
The screensots:

Related

Could not find kotlin-gradle-plugin for Kotlin script Gradle

build fails, classpath error:
thufir#dur:~/NetBeansProjects/kotlinShadowJar$
thufir#dur:~/NetBeansProjects/kotlinShadowJar$ gradle clean
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'kotlinShadowJar'.
> Could not resolve all files for configuration ':classpath'.
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
Searched in the following locations:
file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom
file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar
https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom
https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
cat build.gradle.kts:
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
mavenCentral()
gradleScriptKotlin()
}
dependencies {
classpath(kotlinModule("gradle-plugin"))
classpath("com.github.jengelman.gradle.plugins:shadow:1.2.3")
}
}
apply {
plugin("kotlin")
plugin("com.github.johnrengelman.shadow")
}
repositories {
mavenCentral()
}
val shadowJar: ShadowJar by tasks
shadowJar.apply {
manifest.attributes.apply {
put("Implementation-Title", "Gradle Jar File Example")
put("Implementation-Version" version)
put("Main-Class", "com.mkyong.DateUtils")
}
baseName = project.name + "-all"
}
The buildfile was a direct copy of a working build. The context is getting started with Kotlin script Gradle. So far as I can tell the script should be good.
Note that I'm not using intelli-J, this is strictly from the CLI with Kotlin script Gradle.
perhaps it's something quite simple, like "plugin" versus "plugins"...
Looking at the error logs, you can see the plugin version request:
Searched in the following locations:
file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom
file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar
https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom
https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar
You can see that a version is not requested on each plugin request because they are looking for kotlin-gradle-plugin-.jar.
If you look at the source, you will also see that kotlinModule is deprecated.
I would recommend a few different changes to improve the build script:
Using the Gradle wrapper (./gradlew
Specify a version for your kotlinModule until you upgrade your Gradle version - kotlinModule("gradle-plugin", "1.1.51")
Use the plugins {} block instead of buildscript for plugins

springfox 2.2.3 snapshot dependencies adding failed because of missing nexus-maven-repository-index.properties

I setup my project with springfox 2.2.3 snapshot version in IDEA 14 with gradle. I follow instruction 2.1.1. Gradle Snapshot. I failed with error that maven repository cannot be indexed and see exception in IDEA's log:
WARN - #org.jetbrains.idea.maven - Failed to update Maven indices for: [com.intellij.util.CachedValueImpl#a1d13c] http://oss.jfrog.org/simple/oss-snapshot-local/io/springfox
org.jetbrains.idea.maven.server.MavenServerIndexerException: java.lang.RuntimeException: java.io.FileNotFoundException: Resource nexus-maven-repository-index.properties does not exist
I tried both repositories and both failed:
http://oss.jfrog.org/simple/oss-snapshot-local/io/springfox/
http://oss.jfrog.org/oss-snapshot-local/io/springfox/
Could anyone have any idea how to fix the issue?
I tried to download dependencies manually and put them in my local .m2 directory and setup in gradle mavenLocal() instead of maven {url ...} but my attempt failed with IDEA's warning on Gradle refresh operation:
Warning:<i><b>project ':data-service': Web Facets/Artifacts will not be configured</b>
Details: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':data-service:runtime'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find io.springfox:springfox-swagger2:2.2.3-SNAPSHOT.
Required by:
parseq:data-service:2.4.0 alpha</i>
Now I think that should also manually add transitive dependencies for springfox package. But it looks ugly and I think I should not go this way.
Does anyone has idea what should I do?
I found issues with dependency donwloading:
* when I work from corporate network I have SSL certificate issue
* initially I added maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' } into buildscript {...} section, I changed it to repositories {...} and fixed the issue
* also I updated my gradle to 2.4 version (but it didn't help)
Now my starting issue is fixed.

Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5

I am new to Maven,
I want to install all the artifacts to my local maven, when i tried to run my script.Got bellow error.
[INFO] Scanning for projects...Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or on
e of its dependencies could not be resolved: Failed to read artifact descriptorfor org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Please help in resolving this issue. What do i need to do in my setting.xml, which proxy ip i need to give as my poxy is been disabled on my system.

Unable to deploy artifacts

I get the following when trying to deploy artifcats from within my job:
[ERROR] uniqueVersion == false is not anymore supported in maven 3
[INFO] Deployment in dav:https://repository-xinco.forge.cloudbees.com/snapshot (id=cloudbees-private-repository,uniqueVersion=false)
Deploying the main artifact Card-Game-Extension-1.0-SNAPSHOT.pom
Downloading: dav:https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/maven-metadata.xml
Uploading: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom
Uploading: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom
ERROR: Failed to deploy artifacts: Could not transfer artifact simple.server:Card-Game-Extension:pom:1.0-20120820.205113-1 from/to cloudbees-private-repository (dav:https://repository-xinco.forge.cloudbees.com/snapshot): Failed to transfer file: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom. Return code is: 401
org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact simple.server:Card-Game-Extension:pom:1.0-20120820.205113-1 from/to cloudbees-private-repository (dav:https://repository-xinco.forge.cloudbees.com/snapshot): Failed to transfer file: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom. Return code is: 401
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141)
at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:182)
at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:158)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:707)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:682)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:997)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:629)
at hudson.model.Run.run(Run.java:1433)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact simple.server:Card-Game-Extension:pom:1.0-20120820.205113-1 from/to cloudbees-private-repository (dav:https://repository-xinco.forge.cloudbees.com/snapshot): Failed to transfer file: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom. Return code is: 401
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:280)
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:211)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:443)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
... 11 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact simple.server:Card-Game-Extension:pom:1.0-20120820.205113-1 from/to cloudbees-private-repository (dav:https://repository-xinco.forge.cloudbees.com/snapshot): Failed to transfer file: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom. Return code is: 401
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:950)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:837)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:467)
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:274)
... 14 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://repository-xinco.forge.cloudbees.com/snapshot/simple/server/Card-Game-Extension/1.0-SNAPSHOT/Card-Game-Extension-1.0-20120820.205113-1.pom. Return code is: 401
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:379)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:287)
at org.apache.maven.wagon.providers.webdav.WebDavWagon.put(WebDavWagon.java:332)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:811)
... 16 more
[INFO] Deployment failed after 0.74 sec
Build step 'Deploy artifacts to my Private CloudBees Repository' changed build result to FAILURE
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
Is there anything to set up in the repository I'm unaware of?
You are using the Deploy artifacts to my Private CloudBees Repository publisher.
You need to enable the Assign unique versions to snapshots option on the Advanced options for that plugin.
Once you do that it should deploy just fine.
"uniqueVersion == false is not anymore supported in maven 3", even being reported as an ERROR, won't stop the deployment.
This seems to be a configuration issue in your account, will follow-up on https://cloudbees.zendesk.com/tickets/5055
It was a repository permission issue.

teamcity 5.1 maven proxy configuration

I created a new build configuration and tried to run the same. However I encounter errors saying the artifacts could not be found in the repository. If I run the maven build from command line for the same workspace, the build works well. The proxy configuration has been mentioned in ./m2/settings.xml and the settings file has been mentioned in the build configuration. I tried even placing the proxy configuration in TeamCity\buildAgent\plugins\maven\conf\settings.xml but it does not seem to help. Kindly let me know if you have any pointers.
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.apache.maven.plugins:maven-site-plugin': POM 'org.apache.maven.plugins:maven-site-plugin' not found in repository: Unable to download the artifact from any repository[16:59:48]: org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7[16:59:48]: from the specified remote repositories:[16:59:48]: central (http://repo1.maven.org/maven2)[16:59:48]: for project org.apache.maven.plugins:maven-site-plugin[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:293)[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:205)[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:184)[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)[16:59:48]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)[16:59:48]: ... 19 more[16:59:48]: Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.apache.maven.plugins:maven-site-plugin' not found in repository: Unable to download the artifact from any repository[16:59:48]: org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7[16:59:48]: from the specified remote repositories:[16:59:48]: central (http://repo1.maven.org/maven2)[16:59:48]: for project org.apache.maven.plugins:maven-site-plugin[16:59:48]: at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)[16:59:48]: at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:277)[16:59:48]: ... 23 more[16:59:48]: Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository[16:59:48]: org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7[16:59:48]: from the specified remote repositories:[16:59:48]: central (http://repo1.maven.org/maven2)[16:59:48]: at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)[16:59:48]: at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)[16:59:48]: at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)[16:59:48]: ... 25 more[16:59:48]: Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository[16:59:48]: at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)[16:59:48]: at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)[16:59:48]: ... 27 more
Have you tried setting the settings.xml within the Maven installation
e.g. for my TeamCity installation /usr/local/apache-maven/apache-maven-2.2.1/conf/settings.xml
Don't forget that TeamCity will probably be running as its own user, so ~/.m2/settings.xml may not be where you think it is.