ivy install from maven repo with dependency wrong type element value: source

234 Views Asked by At

I'm trying to install in a ivy local repository from the following repository http://repository.pentaho.org/artifactory/repo the below artifact:

  <dependency>
    <groupId>pentaho</groupId>
    <artifactId>mondrian</artifactId>
    <version>3.6.7</version>        
  </dependency>

Below the ant task in common.xml:

<target name="import">
    <ivy:install organisation="${module.organization}" module="${module.name}" revision="${module.version}"
        from="${module.resolver.source}" to="${module.resolver.target}" transitive="${module.transitive}" overwrite="true"/>
</target>

with the following properties values:

<property name="module.organization" value="pentaho" />
<property name="module.name" value="mondrian" />
<property name="module.version" value="3.6.7" />
<property name="module.transitive" value="true" />
<property name="module.resolver.source" value="pentaho-chain" />
<property name="module.resolver.target" value="thirdparty" />

But it fails, because its pom contains a dependency (see below), which has a wrong type element value:

 <dependency>
  <groupId>org.olap4j</groupId>
  <artifactId>olap4j</artifactId>
  <version>1.1.0</version>
  <type>source</type>
  <classifier>sources</classifier>
  <optional>true</optional>
</dependency>

This snippet is translated into the following line in the ivy file:

...
<artifact name="olap4j" type="source" ext="jar" conf="sources" m:classifier="sources"/>
...

This line leads to the following download url:

http://repository.pentaho.org/artifactory/repo/org/olap4j/olap4j/1.1.0/olap4j-1.1.0-sources.source

with .source instead of .jar, so as result the artifact hasn't been found.

Is there a way to configure ivy properly to workaround this situation?

Thanks

1

There are 1 best solutions below

1
On
  • Remove type, its adding source by default to your url. By default ivy takes type as jar.
  • Also you dont need classifier like maven does here.

So if you remove these attributes, it should work fine.