0

We have recently migrated our ivy to maven repositories but I am running into an issue with a few artifacts that contain multiple jars per artifact. For instance the artifact located at org.apache.xml:xalan-j:2.7.1 and with in that location there are the following jars that I need to access

  • serializer.jar
  • xalan.jar
  • xsltc.jar

Can maven handle this situation and if so some guidance would be greatly appreciated.

---Code---

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.xml</groupId>
<artifactId>xalan-j</artifactId>
<packaging>pom</packaging>
<version>2.7.1</version>
<url>http://xml.apache.org/xalan-j/</url>
<dependencies>
    <dependency>
        <groupId>org.apache.xerces</groupId>
        <artifactId>xerces</artifactId>
        <version>[2.7,)</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xml</groupId>
        <artifactId>xml-commons-external</artifactId>
        <version>[1.3,)</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xml</groupId>
        <artifactId>xalan-j</artifactId>
        <version>2.7.1</version>
        <classifier>xalan</classifier>
    </dependency>
    <dependency>
        <groupId>org.apache.xml</groupId>
        <artifactId>xalan-j</artifactId>
        <version>2.7.1</version>
        <classifier>xsltc</classifier>
    </dependency>
    <dependency>
        <groupId>org.apache.xml</groupId>
        <artifactId>xalan-j</artifactId>
        <version>2.7.1</version>
        <classifier>serializer</classifier>
    </dependency>
</dependencies>

Ed Dunn
  • 1,152
  • 3
  • 11
  • 27
  • What do you mean by "access within that location"? What is the actual problem? – Tobb Apr 04 '18 at 13:19
  • the artifacts all share the same groupId,artifactId and version. They all have unique classifiers but I am not sure if they are being retrieved when gradle calls the dependency. – Ed Dunn Apr 04 '18 at 13:29
  • I don't find this artifact on maven central: have you a custom repository?. You can classifier to distinguish many jars, but it doesn't seem to fit your case. To search standard library: https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22org.apache.xml.serializer%22 – pdem Apr 04 '18 at 13:30
  • yes, this is a custom repository, it use to be handled by an internal ivy repository but since have migrated to using artifactory and maven. I know that artifactory and gradle handle ivy just fine but despite my petitioning, my developers want to get away from ivy completely. – Ed Dunn Apr 04 '18 at 13:33
  • I just see your comment about classifiers, you didn't sepcify it in your gradle path: https://stackoverflow.com/questions/13188438/how-to-specify-a-classifier-in-a-gradle-dependencys-dependency – pdem Apr 04 '18 at 13:33
  • I will update the above code to include what my pom file looks like, if it helps – Ed Dunn Apr 04 '18 at 13:34
  • can you please help us out with there maven coordinates(groupId : Articfact id: version) ? – Afgan Apr 04 '18 at 13:34
  • the pom is in the above question, there are a few artifacts that have this issue, luckily not many. – Ed Dunn Apr 04 '18 at 13:36
  • As i said in my previous comment (see the link above): add the classifier in your gradle dependency:`compile "org.apache.xml:xalan-j:2.7.1:xalan"` etc. for the others – pdem Apr 04 '18 at 13:40
  • oh I see, so there is no way to grab all the artifacts individually? It looks like this should work **compile(group: 'org.apache.xml', name: 'xalan-j', version: '2.7.1', classifier: 'serializer')** – Ed Dunn Apr 04 '18 at 13:42
  • While you can solve this with classifiers, the correct solution would be to migrate to "standard" artifacts. They normally do not have multiple JARs per artifact. – lexicore Apr 04 '18 at 14:27

0 Answers0