Maven-publish and authentication

I am trying the new maven-publish plugin described here (using gradle 1.4):

http://www.gradle.org/docs/current/userguide/userguide_single.html#publishing_maven

but I cannot find any info on setting the authentication for our internal artifactory repositoriy (where is this documented). I have tried:

apply plugin: 'java'
apply plugin: 'maven-publish'
  publishing {
  repositories {
      maven {
          url "http://internal.artifactory/libs-snapshot-local"
//
        credentials('admin', 'password')
//
        credentials(standardCredentials)
//
        credentials(userName: 'admin', password: 'password')
          authentication(userName: 'admin', password: 'password')
      }
  }
}

previously I did (using the maven plugin):

repositories {
    mavenDeployer {
     repository(url: "http://internal.artifactory/libs-snapshot-local") {
        authentication(userName: 'admin', password: 'password')
      }
    }
  }
}
1 Like

In the new publishing plugins, you use the same repository declarations as you do for resolving dependencies. The credentials syntax is documented here.

repositories {
    maven {
        credentials {
            username 'user'
            password 'password'
        }
        url "http://repo.mycompany.com/maven2"
    }
}
2 Likes

hm it still does not work:

apply plugin: 'java'
apply plugin: 'maven-publish'
  group='com.test'
version='1.0-SNAPSHOT'
    // For reading dependencies
repositories {
  maven {
    url "http://internal.artifactory/repo"
  }
}
  // For deployment
publishing {
  repositories {
    maven {
      credentials {
        username 'user'
        password 'password'
      }
      url "http://internal.artifactory/libs-snapshot-local"
    }
  }
}

when running:

gradle publish

I get:

Transferring 0K from remote
:publishMavenPublicationToMavenRepository FAILED
  FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':publishMavenPublicationToMavenRepository'.
> Failed to publish publication 'maven' to repository 'maven'
   > Error deploying artifact 'com.test:gradle-maven-publish:jar': Error deploying artifact: Failed to transfer
 ...
maven-publish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.164606-1.jar. Return code is: 401
  * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Maybe I misunderstood your post?

Nope that looks correct to me. Will probably need the debug logs to work out what’s going on.

18:38:06.755 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Adding reference: ant.PropertyHelper
18:38:06.774 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Detected Java version: 1.6 in: C:\Program Files\Java\jdk1.6.0_34\jre
18:38:06.792 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Detected OS: Windows 7
18:38:06.819 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Adding reference: ant.ComponentHelper
18:38:06.838 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Project base dir set to: C:\workspace\gradle-maven-publish
18:38:07.034 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Adding reference: org.codehaus.plexus.PlexusContainer
18:38:07.077 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] Maven Ant Tasks version: 2.1.3
18:38:07.091 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] Loading Maven settings file: C:\Users\uu\AppData\Local\Temp\gradle_empty_settings8501123870415661045.xml
18:38:07.181 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] Loading Maven settings file: C:\Users\uu\.m2\settings.xml
18:38:07.226 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] Deploying to http://artifactory.test-001.com:8081/artifactory/libs-snapshot-local
18:38:07.239 [INFO] [system.out] [INFO] Retrieving previous build number from remote
18:38:07.296 [INFO] [system.out] [INFO] repository metadata for: 'snapshot com.test-001:gradle-maven-publish:1.0-SNAPSHOT' could not be found on repository: remote, so will be created
18:38:07.335 [ERROR] [system.err] Uploading: com/test-001/gradle-maven-publish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.173807-1.jar to repository remote at http://artifactory.test-001.com:8081/artifactory/
libs-snapshot-local
18:38:07.370 [ERROR] [system.err] Transferring 0K from remote
18:38:08.024 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] An error has occurred while processing the Maven artifact tasks.
 Diagnosis:
  Error deploying artifact 'com.test-001:gradle-maven-publish:jar': Error deploying artifact: Failed to transfer file: http://artifactory.test-001.com:8081/artifactory/libs-snapshot-local/com/test-001/gradle-maven-p
ublish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.173807-1.jar. Return code is: 401
    18:38:08.072 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@2a9df354, org.gradle.logging.int
ernal.logback.LogbackLoggingConfigurer@67d225a7, org.gradle.logging.internal.JavaUtilLoggingConfigurer@15a62c31]
18:38:08.103 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@2a9df354, org.gradle.logging.int
ernal.logback.LogbackLoggingConfigurer@67d225a7, org.gradle.logging.internal.JavaUtilLoggingConfigurer@15a62c31]
18:38:08.133 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on task artifact state cache (C:\workspace\gradle-maven-publish\.gradle.4\task
Artifacts).
18:38:08.163 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
18:38:08.191 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':publishMavenPublicationToMavenRepository'
18:38:08.218 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :publishMavenPublicationToMavenRepository FAILED
18:38:08.261 [ERROR] [org.gradle.BuildExceptionReporter]
18:38:08.284 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
18:38:08.313 [ERROR] [org.gradle.BuildExceptionReporter]
18:38:08.335 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
18:38:08.356 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':publishMavenPublicationToMavenRepository'.
18:38:08.377 [ERROR] [org.gradle.BuildExceptionReporter] > Failed to publish publication 'maven' to repository 'maven'
18:38:08.403 [ERROR] [org.gradle.BuildExceptionReporter]
  > Error deploying artifact 'com.test-001:gradle-maven-publish:jar': Error deploying artifact: Failed to transfer file: http://artifactory.test-001.com:8
081/artifactory/libs-snapshot-local/com/test-001/gradle-maven-publish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.173807-1.jar. Return code is: 401
18:38:08.436 [ERROR] [org.gradle.BuildExceptionReporter]
18:38:08.457 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
18:38:08.480 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':publishMavenPublicationToMavenRepository'.
18:38:08.502 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:72)
18:38:08.523 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:49)
18:38:08.541 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
18:38:08.558 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
18:38:08.575 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.internal.Factories$1.create(Factories.java:22)
18:38:08.592 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
18:38:08.609 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
18:38:08.626 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
18:38:08.643 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
18:38:08.661 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
18:38:08.678 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
18:38:08.695 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
18:38:08.712 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
18:38:08.729 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
18:38:08.746 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
18:38:08.763 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
18:38:08.788 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:275)
18:38:08.806 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:52)
18:38:08.822 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:38)
18:38:08.840 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:30)
18:38:08.856 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:84)
18:38:08.873 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
18:38:08.890 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
18:38:08.907 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
18:38:08.924 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
18:38:08.941 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
18:38:08.958 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.internal.Factories$1.create(Factories.java:22)
18:38:08.975 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
18:38:08.992 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
18:38:09.009 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
18:38:09.026 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
18:38:09.044 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
18:38:09.061 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
18:38:09.078 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
18:38:09.095 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
18:38:09.110 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
18:38:09.124 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
18:38:09.139 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
18:38:09.154 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:165)
18:38:09.166 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
18:38:09.177 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
18:38:09.189 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
18:38:09.201 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
18:38:09.212 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
18:38:09.224 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
18:38:09.235 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
18:38:09.246 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
18:38:09.260 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
18:38:09.277 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
18:38:09.293 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
18:38:09.309 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
18:38:09.325 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
18:38:09.341 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.Main.doAction(Main.java:48)
18:38:09.357 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
18:38:09.373 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.Main.main(Main.java:39)
18:38:09.389 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
18:38:09.405 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
18:38:09.421 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
18:38:09.437 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.artifacts.PublishException: Failed to publish publication 'maven' to repository 'maven'
18:38:09.453 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.internal.PublishOperation.run(PublishOperation.java:39)
18:38:09.469 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository.doPublish(PublishToMavenRepository.java:151)
18:38:09.484 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository.publish(PublishToMavenRepository.java:147)
18:38:09.501 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
18:38:09.516 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
18:38:09.532 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
18:38:09.548 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository_Decorated.invokeMethod(Unknown Source)
18:38:09.564 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
18:38:09.580 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:161)
18:38:09.596 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:156)
18:38:09.613 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:510)
18:38:09.628 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:499)
18:38:09.644 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:64)
18:38:09.660 [ERROR] [org.gradle.BuildExceptionReporter]
      ... 57 more
18:38:09.676 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: Error deploying artifact 'com.test-001:gradle-maven-publish:jar': Error deploying artifact: Failed to transfer file: http://artifactory.test-001
.com:8081/artifactory/libs-snapshot-local/com/test-001/gradle-maven-publish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.173807-1.jar. Return code is: 401
18:38:09.693 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:144)
18:38:09.711 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publication.maven.internal.ant.CustomDeployTask.doExecute(CustomDeployTask.java:44)
18:38:09.727 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:751)
18:38:09.743 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publication.maven.internal.ant.AbstractMavenResolver.execute(AbstractMavenResolver.java:187)
18:38:09.759 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publication.maven.internal.ant.AbstractMavenResolver.commitPublishTransaction(AbstractMavenResolver.java:178)
18:38:09.775 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher$Publication.publishTo(DefaultIvyDependencyPublisher.java:95)
18:38:09.791 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher.publish(DefaultIvyDependencyPublisher.java:54)
18:38:09.807 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.internal.artifacts.ivyservice.IvyBackedArtifactPublisher.publish(IvyBackedArtifactPublisher.java:58)
18:38:09.822 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.maven.internal.MavenPublisher.doPublish(MavenPublisher.java:69)
18:38:09.838 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.maven.internal.MavenPublisher.publish(MavenPublisher.java:55)
18:38:09.854 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository$2.publish(PublishToMavenRepository.java:161)
18:38:09.869 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.gradle.api.publish.internal.PublishOperation.run(PublishOperation.java:37)
18:38:09.885 [ERROR] [org.gradle.BuildExceptionReporter]
      ... 69 more
18:38:09.900 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error deploying artifact: Failed to transfer file: http://artifactory.test-001.
com:8081/artifactory/libs-snapshot-local/com/test-001/gradle-maven-publish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.173807-1.jar. Return code is: 401
18:38:09.915 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:121)
18:38:09.933 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:125)
18:38:09.947 [ERROR] [org.gradle.BuildExceptionReporter]
      ... 80 more
18:38:09.962 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://artifactory.test-001.com:8081/artifactory/libs-snapshot-local/c
om/test-001/gradle-maven-publish/1.0-SNAPSHOT/gradle-maven-publish-1.0-20130320.173807-1.jar. Return code is: 401
18:38:09.978 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:205)
18:38:09.999 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:413)
18:38:10.013 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
18:38:10.029 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
18:38:10.044 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163)
18:38:10.060 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:317)
18:38:10.077 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:227)
18:38:10.092 [ERROR] [org.gradle.BuildExceptionReporter]
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
18:38:10.108 [ERROR] [org.gradle.BuildExceptionReporter]
      ... 81 more
18:38:10.119 [ERROR] [org.gradle.BuildExceptionReporter]
18:38:10.132 [LIFECYCLE] [org.gradle.BuildResultLogger]
18:38:10.144 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
18:38:10.157 [LIFECYCLE] [org.gradle.BuildResultLogger]
18:38:10.169 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 13.007 secs
18:38:10.181 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task artifact state cache (C:\workspace\gradle-maven-publish\.gradle.4\taskArtifacts).
18:38:10.196 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file 'C:\workspace\gradle-maven-publish\build.gradle' (C:\U
sers\uu\.gradle\caches.4\scripts\build_5i7j89amq6ekclp666b0l47lb7\ProjectScript\no_buildscript).
18:38:10.210 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file 'C:\workspace\gradle-maven-publish\build.gradle' (C:\User
s\uu\.gradle\caches.4\scripts\build_5i7j89amq6ekclp666b0l47lb7\ProjectScript\buildscript).
18:38:10.234 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@2a9df354, org.gradle.logging.int
ernal.logback.LogbackLoggingConfigurer@67d225a7, org.gradle.logging.internal.JavaUtilLoggingConfigurer@15a62c31]
  C:\workspace\gradle-maven-publish>

Log here:

http://pastebin.com/raw.php?i=zzC8SwuA

with gradle-1.5-rc-2 the output becomes:

gradle publish --info Starting Build Settings evaluated using empty settings script. Projects loaded. Root project using build file ‘C:\workspace\gradle-maven-publish\build.gradle’. Included projects: [root project ‘gradle-maven-publish’] Evaluating root project ‘gradle-maven-publish’ using build file ‘C:\workspace\gradle-maven-publish\build.gradle’. All projects evaluated. Selected primary task ‘publish’ Tasks to be executed: [task ‘:publish’] :publish Skipping task ‘:publish’ as it has no actions. :publish UP-TO-DATE

BUILD SUCCESSFUL

The way publications are defined has changed between Gradle 1.4 and Gradle 1.5. The important change is that Gradle configurations are no longer automatically mapped into publications. Check out the 1.5 release notes for details on what’s changed and how to configure.

Once you have your publications configured correctly in 1.5, let us know if you’re still experiencing problems with maven authentication.