Gradle无法使用神器中的依赖项

时间:2017-04-05 07:07:47

标签: gradle artifactory

这是我编写的代码:当我启用flatDir部分(在代码中注释掉一部分)时,请通知代码正常工作,但是当我想使用Remote Artifactory存储库时,请不要工作(表示注释flatDir部分):

buildscript {
    repositories {
    jcenter()
  }
dependencies {
    classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
   }
  } 

subprojects {
   apply plugin: 'java'
   apply plugin: 'distribution'
   buildDir = new File("$buildPath", project.name)
   ext.distributionDir = new File(project.buildDir, 'distribution')
   sourceSets {
        //SourceSets
   }

   ext.sharedManifest = manifest {
        //Manifests
   }

   tasks.withType(Jar) {
        //Code to generate Jar Artifacts
   }

   //  repositories {
   //     flatDir {
   //          dirs file("$dependencyPath"),
   //      }
   //  }

   allprojects {
      artifactory {
         contextUrl = "${artifactory_contextUrl}"
       publish {
           repository {
               repoKey = 'gradle-dev-local'
               username = "${artifactory_user}"
               password = "${artifactory_password}"
               maven = true
            }
         }
       resolve {
           repository {
               repoKey = 'gradle-dev'
               username = "${artifactory_user}"
               password = "${artifactory_password}"
               maven = true
            }
         }
      }
   }
}
  project(':projectName:ProjectComponent') {
     sourceSets {
       main {
            java { include '/pathToCode/*' }
            }
       }
        dependencies { compile (group: 'jcifs', name: 'jcifs', version: '1.1.11')}

    //******* Publishing Component Jar (Build artifacts on Remote Repository) ********//

     publishing.publications {
        mavenJava(MavenPublication) {
        groupId 'GroupID'
        artifactId project.name
        version = projVersion
        from components.java
    }
 }
 artifactoryPublish {
     publications(publishing.publications.mavenJava)
   }
}

请建议解决方案。 谢谢! : - )

0 个答案:

没有答案