Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:classifier in exclusions forbidden by Clojars #688

Closed
blueberry opened this issue Apr 12, 2018 · 7 comments
Closed

:classifier in exclusions forbidden by Clojars #688

blueberry opened this issue Apr 12, 2018 · 7 comments

Comments

@blueberry
Copy link

This is related to #515, which should have been solved, but is a colateral issue.

I need to exclude a dependency that contains macOS binaries from my library that I deploy to Clojars since it (unecessary) breaks the library on macOS.

I do that by adding

:exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]]

to the dependency in project.clj

It works as expected.

However, Clojars refuses to deploy it, with the following message:

Could not transfer metadata uncomplicate:neanderthal/maven-metadata.xml from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/uncomplicate/neanderthal/maven-metadata.xml, ReasonPhrase: Forbidden - invalid pom file: Unrecognised tag: 'classifier' (position: START_TAG seen ...</groupId>\n          <classifier>... @125:23).
Failed to deploy metadata: Could not transfer metadata uncomplicate:neanderthal/maven-metadata.xml from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/uncomplicate/neanderthal/maven-metadata.xml, ReasonPhrase: Forbidden - invalid pom file: Unrecognised tag: 'classifier' (position: START_TAG seen ...</groupId>\n          <classifier>... @125:23).

@danielcompton
Copy link
Member

Just to confirm, the exclusions that you've set do work to exclude the macOS library if you use it from a locally installed version? I'm pretty sure that's what you're saying, just wanted to check.

@blueberry
Copy link
Author

Yes, they do. On both linux and macOS. The step that is refusing them is lein deploy clojars.

@tobias
Copy link
Member

tobias commented Apr 13, 2018

We're using org.apache.maven.model.io.xpp3.MavenXpp3Reader (from [org.apache.maven/maven-model "3.0.4"]) to read the pom file, and that is what is throwing that error. We may need to upgrade our dependency - it looks like the version we are using doesn't accept the pom that lein is generating.

Can you share the pom.xml that lein creates?

@blueberry
Copy link
Author

pom.xml:

<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>uncomplicate</groupId>
  <artifactId>neanderthal</artifactId>
  <packaging>jar</packaging>
  <version>0.19.1-SNAPSHOT</version>
  <name>neanderthal</name>
  <description>Neanderthal is a Clojure library for fast matrix and linear algebra computations.</description>
  <url>https://github.com/uncomplicate/neanderthal</url>
  <licenses>
    <license>
      <name>Eclipse Public License</name>
      <url>http://www.eclipse.org/legal/epl-v10.html</url>
    </license>
  </licenses>
  <scm>
    <url>https://github.com/uncomplicate/neanderthal</url>
    <connection>scm:git:git://github.com/uncomplicate/neanderthal.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/uncomplicate/neanderthal.git</developerConnection>
    <tag>e6352aad06321336866d481ac3eb647ea76f36a6</tag>
  </scm>
  <build>
    <sourceDirectory>src/clojure</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
      <resource>
        <directory>resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>resources</directory>
      </testResource>
    </testResources>
    <directory>target</directory>
    <outputDirectory>target/classes</outputDirectory>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/opencl</source>
                <source>src/cuda</source>
                <source>src/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>central</id>
      <url>https://repo1.maven.org/maven2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
    <repository>
      <id>clojars</id>
      <url>https://repo.clojars.org/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
  </repositories>
  <dependencyManagement>
    <dependencies/>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <version>1.9.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>uncomplicate</groupId>
      <artifactId>commons</artifactId>
      <version>0.5.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>uncomplicate</groupId>
      <artifactId>fluokitten</artifactId>
      <version>0.6.1</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>uncomplicate</groupId>
      <artifactId>neanderthal-native</artifactId>
      <version>0.19.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>uncomplicate</groupId>
      <artifactId>clojurecl</artifactId>
      <version>0.9.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jocl</groupId>
      <artifactId>jocl-blast</artifactId>
      <version>1.3.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>uncomplicate</groupId>
      <artifactId>clojurecuda</artifactId>
      <version>0.4.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jcuda</groupId>
      <artifactId>jcublas</artifactId>
      <version>0.9.0</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>3.6.1</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>midje</groupId>
      <artifactId>midje</artifactId>
      <version>1.9.1</version>
      <exclusions>
        <exclusion>
          <artifactId>jcublas-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
        <exclusion>
          <artifactId>jcuda-natives</artifactId>
          <groupId>org.jcuda</groupId>
          <classifier>apple-x86_64</classifier>
        </exclusion>
      </exclusions>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

<!-- This file was autogenerated by Leiningen.
  Please do not edit it directly; instead edit project.clj and regenerate it.
  It should not be considered canonical data. For more information see
  https://github.com/technomancy/leiningen -->

@blueberry
Copy link
Author

blueberry commented Apr 13, 2018

This is one of the variations that I tried. The only difference is where the exclusions are and how many there are, but every variation gets blocked by Clojars.

@tobias
Copy link
Member

tobias commented Apr 13, 2018

From looking at the maven xsd, classifiers aren't legal within exclusion blocks, even in the latest version of the xsd. So that would imply that lein is generating invalid poms. But I wonder what the maven solution is for excluding based on classifier?

@blueberry
Copy link
Author

I found that solution in https://github.com/technomancy/leiningen/blob/master/sample.project.clj

I didn't realize it's illegal in maven. Bummer. I hoped it is just a configuration in Clojars for some marginal reason. It would have nicely solved the macos issue in my project...

Thank you for clarifying this!

@tobias tobias closed this as completed Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants