Hello, I just started a few days ago, and im trying to publish a war file using the artifactory plugin. So far my gradle script will create a build in artifactory but with no publish modules to speak of. Im at a loss for examples and feeling really stuck, please help.
buildscript {
repositories {
//maven {
//url ‘http://prdapp07:8081/artifactory/plugins-release’
//url ‘http://repo.jfrog.org/artifactory/gradle-plugins-snapshots’
//credentials {
//username = “${artifactory_user}”
//password = “${artifactory_password}”
//}
mavenCentral()
maven { url ‘http://repo1.maven.org/maven2/’ }
flatDir { dirs “lib” }
jcenter {url ‘http://jcenter.bintray.com’}
}
dependencies {
classpath “org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1”
} }
allprojects {
apply plugin: “com.jfrog.artifactory”
apply plugin: ‘maven-publish’
apply plugin: ‘jetty’
apply plugin: ‘war’
apply plugin: ‘java’
}
configurations {
moreLibs }
group = ‘com.company’ version=‘1.0-SNAPSHOT’
publishing {
publications {
main(MavenPublication) {
artifact file(‘build/libs/GradleWarExample.war’)
}
} }
def warArchives = ‘build/libs/GradleWarExample.war’
artifactory {
contextUrl = “${artifactory_contextUrl}”
//The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = ‘libs-release-local’
username = “${artifactory_user}”
password = “${artifactory_password}”
maven = true
}
defalts {publications (warArchives) }
}
resolve {
repository {
repoKey = ‘libs-release’
username = “${artifactory_user}”
password = “${artifactory_password}”
maven = true
}
} }
dependencies {
compile module(":compile:1.0") {
dependency “:compile-transitive-1.0@jar”
dependency “:providedCompile-transitive:1.0@jar”
}
providedCompile “javax.servlet:servlet-api:2.5”
providedCompile module(":providedCompile:1.0") {
dependency “:providedCompile-transitive:1.0@jar”
}
runtime “:runtime:1.0”
providedRuntime “:providedRuntime:1.0@jar”
testCompile “junit:junit:4.11”
moreLibs “:otherLib:1.0”
}
war {
from ‘src/rootContent’ // adds a file-set to the root of the archive
webInf { from ‘src/additionalWebInf’ } // adds a file-set to the WEB-INF dir.
classpath fileTree(‘additionalLibs’) // adds a file-set to the WEB-INF/lib dir.
classpath configurations.moreLibs // adds a configuration to the WEB-INF/lib dir.
webXml = file(‘src/someWeb.xml’) // copies a file to WEB-INF/web.xml