本文介绍了带着手工艺的嫁接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立我自己的常春藤存储库,以用于我自己的库。我发现了artiFactory,并决定在我的Ubuntu服务器上使用它。我按照以下说明操作:

http://www.jfrog.com/video/artifactory-1-min-setup/

并创建此自动脚本:

buildscript {
    repositories {

        ivy {
            url 'http://picard:8080/artifactory/plugins-release'

        }
    }
    dependencies {
        //Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.3"
    }
}

allprojects {
    apply plugin: "com.jfrog.artifactory"
}

artifactory {
    contextUrl = "${artifactory_contextUrl}"   //The base Artifactory URL if not overridden by the publisher/resolver
    publish {
        repository {
            repoKey = 'libs-release-local'
            maven = false
            ivy {
                ivyLayout = '[organization]/[module]/[revision]/[type]s/ivy-[revision].xml'
                artifactLayout = '[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]'
                mavenCompatible = false
            }
        }
    }
    resolve {
        repository {
            repoKey = 'libs-release'
            maven = false
            ivy {
                ivyLayout = '[organization]/[module]/[revision]/[type]s/ivy-[revision].xml'
                artifactLayout = '[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]'
                mavenCompatible = false
            }
        }
    }
}

为此,我对我的build.gradle进行了如下修改:

buildscript {
    repositories {
        mavenLocal()
        ivy {
            url 'http://picard:8080/artifactory/plugins-release'
        }
    }
}

apply plugin: 'java'
apply plugin: "com.jfrog.artifactory"

archivesBaseName = 'heavyweight-software-util'

repositories {
    mavenCentral()
    ivy {
        url 'http://picard:8080/artifactory/plugins-release'
    }
}

dependencies {
    classpath("org.jfrog.buildinfo:build-info-extractor-gradle:3.0.3")
    testCompile("junit:junit:4.11")
}

task wrapper(type: Wrapper) {
    gradleVersion = '1.8'
}


artifactory {
    contextUrl = "${artifactory_contextUrl}"   //The base Artifactory URL if not overridden by the publisher/resolver
    publish {
        repository {
            repoKey = 'libs-release-local'
            maven = false
            ivy {
                ivyLayout = '[organization]/[module]/[revision]/[type]s/ivy-[revision].xml'
                artifactLayout = '[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]'
                mavenCompatible = false
            }
        }
    }
    resolve {
        repository {
            repoKey = 'libs-release'
            maven = false
            ivy {
                ivyLayout = '[organization]/[module]/[revision]/[type]s/ivy-[revision].xml'
                artifactLayout = '[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]'
                mavenCompatible = false
            }
        }
    }
}

当我执行生成时,我得到:

A problem occurred evaluating root project 'Utility'.
> Plugin with id 'com.jfrog.artifactory' not found.

我尝试在谷歌上搜索此错误,但没有找到任何有用的东西。有人能帮我改正这个错误吗?我是Gradle新手。

谢谢。

推荐答案

在此找到解决方案:http://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin

基本上,我用以下几行修改了构建脚本:

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0"
  }
}
apply plugin: "com.jfrog.artifactory"

,这与他们的构建脚本生成器生成的脚本有很大不同。希望这对其他人有帮助。

这篇关于带着手工艺的嫁接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 20:50