ivy - gradle adding -source.jar to war -


I am in the process of converting several projects from ANT + IV to Gradle.

One of the projects ( address / code>) produces a simple jar to be included in a webapp. I have established the build.gradle to publish a personal java and a source jar.

Address / build.gradle Excerpt: Apply plugin: Apply 'Publication' plugin: 'IV-Published '[... link ...] Work source jar (type: jar) {SourceSets.main.java classifier "source"} {Repositories {ivy {url' http://dev.example.com/ivy/ ' Layout "pattern", {artifact "[organization] / [module] / [type] s / [artifact] - [amendment] [code]

I published it with [Ext] "}}} Publications {Ivy Enlightenment} {components.java from Artifact (sourceJar) {type" source "}}}}

Crowley published It may result in jar on my webapp:

  compile 'com.example: address: 1.0.0'  

I have a problem This is that when I do gradlew build on the webapp, the web-INF / Lib address-source -1.0.0. Jar along with the expected Address-1.0.0.jar .

I do not know why the source jar is being included in the war, it does not appear in the gradlew dependency .

Here is the IV.XM designed for jar:

   & Lt; Configuration & gt; & Lt; Conf name = "default" visibility = "public" extended = "runtime" /> & Lt; Conf name = "runtime" visibility = "public" /> & Lt; / Configuration & gt; & Lt; Publications & gt; & Lt; Artifact name = "address" type = "jar" ext = "jar" conf = "runtime" /> & Lt; Artifact name = "address" type = "source" ext = "jar" conf = "runtime" m: classifier = "source" /> & Lt; / Publication & gt; & Lt; Dependency & gt; & Lt; Dependency org = "org.springframework" name = "spring-asm" rev = "3.0.5.RELEASE" conf = "runtime- & gt; default" /> & Lt; Dependency org = "org.springframework" name = "spring-beam" rev = "3.0.5.RELEASE" conf = "runtime- & gt; default" /> & Lt; Dependency org = "org.springframework" name = "spring-reference" rev = "3.0.5.RELEASE" conf = "runtime- & gt; default" /> & Lt; Dependency org = "org.springframework" name = "spring-expression" rev = "3.0.5.RELEASE" conf = "runtime- & gt; default" /> & Lt; Dependency org = "org.springframework" name = "spring-core" rev = "3.0.5.RELEASE" conf = "runtime- & gt; default" /> & Lt; Dependency org = "log4j" name = "log4j" rev = "1.2.14" conf = "runtime- & gt; default" /> & Lt; Dependency org = "org.slf4j" name = "jcl-over-slf4j" rev = "1.5.6" conf = "runtime-> default" /> & Lt; Dependency org = "org.slf4j" name = "slf4j-log4j12" rev = "1.5.6" conf = "runtime- & gt; Default" /> & Lt; Dependency org = "commons-lang" name = "commons-lang" rev = "2.4" conf = "runtime- & gt; default" /> & Lt; Dependency org = "org.slf4j" name = "slf4j-api" rev = "1.5.6" conf = "runtime- & gt; default" /> & Lt; / Dependencies & gt; & Lt; / Module from Vertical & gt;  

I think the reason for this is that source artifacts runtime configuration also, if you use special configuration (like source ) then it should work:

  publishing {ivyJava (IvyPublication) {components.java From) configuration.cent ('source') artifact (source) {conf "sources"}}}  

( configuration.redhat) due to Required)


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -