Uploaded image for project: 'Gradle Artifactory Plug-in'
  1. Gradle Artifactory Plug-in
  2. GAP-261

Artifactory plugin do not add resolve repo if java or groovy plugin is applied

    XMLWordPrintable

    Details

      Description

      Artifactory plugin as well as Jnekins Artifavctory plugin fails to add resolve repository if Gradle project has applied java or groovy plugin and has sourceSets.main.java.srcDirs or sourceSets.main.groovy.srcDirs defined.
      If project with java or groovy plugin doesnt not contain defaults src/main/java dirs when it runs ok. As i gathered from debug log Gradle dependency resolver takes in place before artifactory plugoin tires to apply its configuration for example:

      [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver] Resolving configuration ':compile'
      09:29:54.231 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting configuration com.virtustream.xstream:sap-function-executor:1.0.16(compile).
      09:29:54.231 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency com.virtustream.xstream:sap-function-executor:1.0.16(compile) -> org.springframework:spring-aspects:(aspects)
      09:29:53.329 [DEBUG] [org.jfrog.gradle.plugin.artifactory.ArtifactoryPluginBase] Configuring buildInfo task for project :: is root? true
      09:29:53.365 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.artifactoryPublish' (hidden = false)
      09:29:53.379 [DEBUG] [org.jfrog.gradle.plugin.artifactory.ArtifactoryPluginBase] Using Artifactory Plugin for :
      09:29:53.418 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.clean' (hidden = false)
      09:29:53.419 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.assemble' (hidden = false)
      09:29:53.420 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.check' (hidden = false)
      09:29:53.420 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.build' (hidden = false)
      ...
      ...
      ....
      09:29:54.232 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency com.virtustream.xstream:sap-function-executor:1.0.16(compile) -> org.aspectj:aspectjweaver:1.8.9(aspects)
      09:29:54.232 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency com.virtustream.xstream:sap-function-executor:1.0.16(.....
      ...
      ....
      Flushing resolved configuration data in Binary store in C:\Users\tomas_z\AppData\Local\Temp\1\gradle7771193842218646192.bin. Wrote root com.virtustream.xstream:sap-function-executor:1.0.16:compile.
      09:29:54.256 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 4.85 secs
      09:29:54.318 [LIFECYCLE] [org.gradle.api.Project] [buildinfo] Not using buildInfo properties file for this build.
      09:29:54.340 [DEBUG] [org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener] No repository resolution defined for :
      09:29:54.345 [ERROR] [org.gradle.configuration.project.LifecycleProjectEvaluator] Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
      

      In project where java plugin is applied but has no src dir everything runs fine:

       Releasing lock on proj remapped class cache for 7i1fo4upmi2nlqffr2b13vo9y (C:\Users\tomas_z\.gradle\caches\2.14\scripts-remapped\build_443yck4hvyfj10pi5m7z1jopv\7i1fo4upmi2nlqffr2b13vo9y\proj7714019048368597060).
      09:31:10.213 [DEBUG] [org.jfrog.gradle.plugin.artifactory.ArtifactoryPluginBase] Configuring buildInfo task for project :: is root? true
      09:31:10.247 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.artifactoryPublish' (hidden = false)
      09:31:10.261 [DEBUG] [org.jfrog.gradle.plugin.artifactory.ArtifactoryPluginBase] Using Artifactory Plugin for :
      09:31:10.298 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.clean' (hidden = false)
      09:31:10.299 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.assemble' (hidden = false)
      ...
      ...
      ...
      y] Project : - Registering model element 'tasks.distTar' (hidden = false)
      09:31:10.889 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.assembleDist' (hidden = false)
      09:31:10.894 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.installDist' (hidden = false)
      09:31:10.935 [DEBUG] [org.gradle.api.Project] Artifactory plugin: configured
      09:31:11.023 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.validateRegistry' (hidden = false)
      09:31:11.033 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.generateMetadata' (hidden = false)
      ...
      ....
      r] Setting SCRIPT_TRIGGERPOSTUN to 262144 onto task ':abapRpm'
      09:31:11.196 [DEBUG] [com.netflix.gradle.plugins.packaging.AliasHelper] Setting SCRIPT_TRIGGERPREIN to 33554432 onto task ':abapRpm'
      09:31:11.196 [DEBUG] [com.netflix.gradle.plugins.packaging.AliasHelper] Setting RPMLIB to 16777280 onto task ':abapRpm'
      09:31:11.252 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.signing' (hidden = false)
      09:31:11.254 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 2.442 secs
      09:31:11.315 [LIFECYCLE] [org.gradle.api.Project] [buildinfo] Not using buildInfo properties file for this build.
      09:31:11.320 [DEBUG] [org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener] Artifactory URL:<hidden>
      09:31:11.360 [INFO] [org.gradle.BuildLogger] All projects evaluated.
      

      I think this is really a critical bug.

      UPDATE
      After more investigating it i found out that this happens only when in task configuration phase i want to get some dependency or i use dependency management plugin from spring. I think Artifactory should apply it's resolve repository first in evaluation phase.

        Attachments

          Activity

            People

            Assignee:
            eyalbe Eyal Ben David
            Reporter:
            tomaxsas Tomas Zaleniakas (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: