I'm trying to deploy a project to Maven to bintray which is successfully uploads the pom file but returns an Error code 401 when uploading jar files.
I have gone through the bintray tutorial, set my settings.xml up properly, added the correct distributionManagement etc fields to my pom file, made sure the project is not a snapshot etc. but cannot seem to get the uploading of jar files working? I've been trying to figure out what might be going on but with no success.
Details on the stack trace pom.xml, settings.xml and eclipse configuration are below. The entire project can be found on github
Am I missing something obvious here? Any help much appreciated.
[DEBUG] (f) packaging = jar
[DEBUG] (f) pomFile = /Users/au671271/git/pytorch2java/PyTorch2Java/pom.xml
[DEBUG] (s) skip = false
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[INFO] Installing /Users/au671271/git/pytorch2java/PyTorch2Java/target/jtorch4pam-0.0.63.jar to /Users/au671271/.m2/repository/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar
[DEBUG] Writing tracking file /Users/au671271/.m2/repository/org/jamdev/jtorch4pam/0.0.63/_remote.repositories
[INFO] Installing /Users/au671271/git/pytorch2java/PyTorch2Java/pom.xml to /Users/au671271/.m2/repository/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.pom
[DEBUG] Writing tracking file /Users/au671271/.m2/repository/org/jamdev/jtorch4pam/0.0.63/_remote.repositories
[DEBUG] Installing org.jamdev:jtorch4pam/maven-metadata.xml to /Users/au671271/.m2/repository/org/jamdev/jtorch4pam/maven-metadata-local.xml
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ jtorch4pam ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=75304, ConflictMarker.markTime=31640, ConflictMarker.nodeCount=32, ConflictIdSorter.graphTime=78145, ConflictIdSorter.topsortTime=17029, ConflictIdSorter.conflictIdCount=14, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=349870, ConflictResolver.conflictItemCount=32, DefaultDependencyCollector.collectTime=7611621, DefaultDependencyCollector.transformTime=581161}
[DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-project:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG] org.apache.maven:maven-model:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-artifact:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.5.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@55054057]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy' with basic configurator -->
[DEBUG] (f) artifact = org.jamdev:jtorch4pam:jar:0.0.63
[DEBUG] (f) attachedArtifacts = []
[DEBUG] (s) localRepository = id: local
url: file:///Users/au671271/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) offline = false
[DEBUG] (f) packaging = jar
[DEBUG] (f) pomFile = /Users/au671271/git/pytorch2java/PyTorch2Java/pom.xml
[DEBUG] (f) project = MavenProject: org.jamdev:jtorch4pam:0.0.63 @ /Users/au671271/git/pytorch2java/PyTorch2Java/pom.xml
[DEBUG] (f) retryFailedDeploymentCount = 1
[DEBUG] (f) skip = false
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[DEBUG] Using connector AetherRepositoryConnector with priority 100.0 for https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1 with username=macster110, password=***
[INFO] Uploading to : https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.pom
[INFO] Uploading to : https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar
[INFO] Uploaded to : https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.pom (8.7 kB at 2.3 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.879 s
[INFO] Finished at: 2020-09-22T10:56:47+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project jtorch4pam: Failed to deploy artifacts: Could not transfer artifact org.jamdev:jtorch4pam:jar:0.0.63 from/to bintray-macster110-jtorch4pam (https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1): Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project jtorch4pam: Failed to deploy artifacts: Could not transfer artifact org.jamdev:jtorch4pam:jar:0.0.63 from/to bintray-macster110-jtorch4pam (https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1): Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact org.jamdev:jtorch4pam:jar:0.0.63 from/to bintray-macster110-jtorch4pam (https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1): Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
... 20 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact org.jamdev:jtorch4pam:jar:0.0.63 from/to bintray-macster110-jtorch4pam (https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1): Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:146)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
... 22 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact org.jamdev:jtorch4pam:jar:0.0.63 from/to bintray-macster110-jtorch4pam (https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1): Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:301)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:213)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:386)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:142)
... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.jamdev:jtorch4pam:jar:0.0.63 from/to bintray-macster110-jtorch4pam (https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1): Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:889)
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
at io.takari.aether.connector.AetherRepositoryConnector$PutTask.flush(AetherRepositoryConnector.java:732)
at io.takari.aether.connector.AetherRepositoryConnector.put(AetherRepositoryConnector.java:373)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:295)
... 27 more
Caused by: io.takari.aether.connector.AuthorizationException: Access denied to https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1/org/jamdev/jtorch4pam/0.0.63/jtorch4pam-0.0.63.jar. Error code 401, Unauthorized
at io.takari.aether.connector.AetherRepositoryConnector.handleResponseCode(AetherRepositoryConnector.java:397)
at io.takari.aether.connector.AetherRepositoryConnector.access$8(AetherRepositoryConnector.java:391)
at io.takari.aether.connector.AetherRepositoryConnector$PutTask.run(AetherRepositoryConnector.java:703)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The pom.xml file is
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jamdev</groupId>
<artifactId>jtorch4pam</artifactId>
<version>0.0.63</version>
<packaging>jar</packaging>
<name>jamdev</name>
<url>https://github.com/macster110/JTorch4PAM</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>spring-repo</id>
<url>https://repo.spring.io/libs-milestone/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.facebook.soloader</groupId>
<artifactId>nativeloader</artifactId>
<version>0.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.facebook.fbjni/fbjni-java-only -->
<dependency>
<groupId>com.facebook.fbjni</groupId>
<artifactId>fbjni-java-only</artifactId>
<version>0.0.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.pytorch/pytorch_java_only -->
<dependency>
<groupId>org.pytorch</groupId>
<artifactId>pytorch_java_only</artifactId>
<version>1.6.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jflac/jflac-codec -->
<dependency>
<groupId>org.jflac</groupId>
<artifactId>jflac-codec</artifactId>
<version>1.5.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<!-- filter library -->
<dependency>
<groupId>uk.me.berndporr</groupId>
<artifactId>iirj</artifactId>
<version>1.1</version>
</dependency>
<!-- MATLAB import and export library -->
<dependency>
<groupId>us.hebi.matlab.mat</groupId>
<artifactId>mfl-core</artifactId>
<version>0.5.6</version>
</dependency>
<!-- Deep Java Library -->
<dependency>
<groupId>ai.djl</groupId>
<artifactId>api</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>ai.djl.pytorch</groupId>
<artifactId>pytorch-model-zoo</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>ai.djl.pytorch</groupId>
<artifactId>pytorch-native-cpu</artifactId>
<classifier>osx-x86_64</classifier>
<version>1.6.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ai.djl.pytorch</groupId>
<artifactId>pytorch-native-auto</artifactId>
<version>1.6.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>14</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
</plugin>
</plugins>
</build>
<licenses>
<license>
<name>GPL-3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/macster110/JTorch4PAM.git</url>
</scm>
<developers>
<developer>
<id>macster110</id>
<name>Jamie Macaulay</name>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>
<description>Deep learning tools for passive acoustic monitoring</description>
<distributionManagement>
<repository>
<id>bintray-macster110-jtorch4pam</id>
<name>macster110-jtorch4pam</name>
<url>https://api.bintray.com/maven/macster110/jtorch4pam/dl4pam/;publish=1</url>
</repository>
</distributionManagement>
</project>
The settings.xml file (with password removed)
<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<servers>
<server>
<id>bintray-macster110-jtorch4pam</id>
<username>macster110</username>
<password>88888</password>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-macster110-jtorch4pam</id>
<name>bintray</name>
<url>https://dl.bintray.com/macster110/jtorch4pam</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-macster110-jtorch4pam</id>
<name>bintray-plugins</name>
<url>https://dl.bintray.com/macster110/jtorch4pam</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
</settings>
The configuration I am using in eclipse to deploy the project.
Update: Solution
The solution to this problem is to install maven externally and use that installation instead of the embedded version that comes with Eclipse. This completely solves the problem. Go to preferences->Maven->Installation to add a new Maven installation then make sure that version is selected in the run configuration.
Try to use an external Maven installation. I think maven embedded in eclipse (3.6.3 version of Maven) has an issue with big files (pom.xml is deployed correctly).
We tried with maven 3.5.1, 3.6.1 and 3.6.3 external installation and deploys correctly, but give us a 401 error with big files (jar or war) with embedded one (3.6.3). Same config and user.
There is a bug reported, related with this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=566513
And more StackOverflow problems reported: eclipse maven deploy war to nexus OSS Access denied Error code 401, Unauthorized
Edit: Some news about the bug reported. It seems to be related with okhttp component added to eclipse, and this library has this bug:
https://github.com/takari/aether-connector-okhttp/issues/29
These 2 workarounds are proposed until the bug will be fixed:
-Daether.connector.basic.threads=1
in the launch configuration.(you can see that in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=562847#c7)
Regards,