I’m trying to publish a jar , well actually 3 jars - classes,sources and javadoc,by using plugin ‘ivy-publish’. But executing ‘gradle publish’ always ends in:
Could not parse Ivy file file:/C:/dev/ie8-git/services/restgenericclient/build/publications/ivyJava/ivy.xml
Problem occurred while parsing ivy file: Cannot add artifact ‘iengine-service-restgenericclient.jar(sources)’ to configuration ‘sources’ of module tie#iengine-service-restgenericclient;1.0.0 because this configuration doesn’t exist!
The error is because you are specifying configurations for the artifacts (“sources” and “javadoc”) that don’t exist. You should use one of the existing configurations unless you have a reason to use a separate configuration. The “runtime” configuration is probably what you want.
Thanks for your answer. I’d like to seperate “runtime” from “sources” configuration. For example in ivy.xml of aopalliance in my local gradle cache (C:\Users\tiezad.gradle\caches\modules-
2\metadata-2.12\descriptors\aopalliance\aopalliance\1.0\8eb80c2e7e631bf662f14a25bb19e6c0) those two configurations are seperated as well.
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="aopalliance" module="aopalliance" revision="1.0" status="release" publication="20070226234340">
<license name="Public Domain"/>
<description homepage="http://aopalliance.sourceforge.net">AOP Alliance</description>
</info>
<configurations>
<conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
<conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
<conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
<conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation
classpath, and is not transitive."/>
<conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths,
but not the compile classpath." extends="compile"/>
<conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation
and execution phases." extends="runtime"/>
<conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and
is not looked up in a repository."/>
<conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
<conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
<conf name="optional" visibility="public" description="contains all optional dependencies"/>
</configurations>
<publications>
<artifact name="aopalliance" type="jar" ext="jar" conf="master"/>
<artifact name="aopalliance" type="source" ext="jar" conf="sources" m:classifier="sources"/>
</publications>
</ivy-module>
Is it possible to add this configuration “sources”?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishIvyJavaPublicationToIvyRepository'.
> Failed to publish publication 'ivyJava' to repository 'ivy'
> Could not parse Ivy file file:/C:/dev/ie8-git/services/restgenericclient/build/publications/ivyJava/ivy.xml
> Problem occurred while parsing ivy file: Cannot add artifact 'iengine-service-restgenericclient.jar(source)' to configuration 'sources' of module tie#iengine-service-restgenericclient;1.0.0 because this configuration doesn't exist!