에서 Artifactory 내 build.gradle
:출판 단지 모두와 소스 항아리는 여기 Gradle을
- 내가
gradle clean build groovydoc sourcesJar dist
을 실행해야 내 JAR를 빌드하려면 다음 이 현재 설정을 바탕으로
buildscript {
repositories {
maven {
url 'http://localhost:8081/artifactory/plugins-release'
credentials {
username = "admin"
password = "password"
}
name = "maven-main-cache"
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'codenarc'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"
version="0.0.2"
group = "mylib"
repositories {
mavenCentral()
add buildscript.repositories.getByName("maven-main-cache")
maven {
url "http://localhost:8081/artifactory/myapp-snapshots"
}
}
dependencies {
compile 'commons-validator:commons-validator:1.4.0'
testCompile 'junit:junit:4.11'
}
artifactory {
contextUrl = "http://localhost:8081/artifactory"
publish {
repository {
repoKey = 'myorg-snapshots'
username = "admin"
password = "password"
maven = true
}
defaults {
publications ('mavenJava')
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
task dist(type: Zip, dependsOn: build) {
classifier = 'buildreport'
from('build/test-results') {
include '*.xml'
into 'tests'
}
from('build/reports/codenarc') {
into 'reports'
}
from('build/docs') {
into 'api'
}
from(sourcesJar) {
into 'source'
}
from('build/libs') {
exclude '*-sources.jar'
into 'bin'
}
}
gradle artifactoryPublish
두 가지 :
gradle artifactoryPublish
는 단지 내 건설 JAR와 Artifactory하는 동적으로 생성 된 POM을 게시합니다. 내 빌드가 만드는 소스 JAR도 게시하고 싶습니다. 어떻게?; 그리고- 이상적으로 나는 2 개의 명령을 순차적으로 실행하지 않고
gradle publish
을 호출함으로써 위의 모든 작업을 수행 할 수 있습니다. 이것이 가능합니까? 그렇다면 어떻게?
내 대답을 확인하고 작동하는지 확인하십시오. – Opal