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

Unable to use rusheye-impl via maven in java11 due to jar-with-dependencies #31

Open
kiicia opened this issue Mar 29, 2021 · 0 comments

Comments

@kiicia
Copy link

kiicia commented Mar 29, 2021

Issue Overview

When using rusheye-impl in java 11 project there is problem with duplicated packages between modulepath and classpath:

The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml

For example project I am maintaining and updating java 8 -> java 11 has problems with packages:

  • javax.xml.parsers
  • org.w3c.dom
  • org.xml.sax

This is caused by building rusheye-impl (as seen in pom.xml) as jar-with-dependencies:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>jar-with-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <finalName>rusheye-core</finalName>
              <appendAssemblyId>false</appendAssemblyId>
              <archive>
                <manifest>
                  <mainClass>org.arquillian.rusheye.Main</mainClass>
                </manifest>
              </archive>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
            </configuration>
          </execution>
        </executions>
      </plugin>

As I understand this allowed for one-jar apps, but it also causes you being unable to exclude selected dependencies when used in bigger project with many other dependencies.

For example project I am maintaining actually uses ocular, which depends on rusheye-impl:

<groupId>com.testautomationguru.ocular</groupId>
<artifactId>ocular</artifactId>
<version>1.0.0.Alpha</version>

... but I am unable to exclude any packages because it is already contained in rusheye-impl.jar that is downloaded from maven (I am preparing custom jar tho).

Expected Behaviour

Java 11 compatibility, possibly by:

  • creating another artifact that is not jar-with-dependencies so you can exclude what you need to (additional/alternative artefact in maven repository)
  • creating version that is compatible with java 11 (new version in maven repository)
  • fixing rusheye-impl pom to remove assembly plugin (thus creating lean jar) and deploying it as 1.0.1 to maven repository, then everyone affected can use dependency management to use version 1.0.1

[edit]

I was able to remove assembly plugin, change version and compile it, however it won't compile/pass tests in java 11 (compiled it in java 8, used within java 11 project using in-project repository and dependency management overriding version used by ocular)

seeing how pom.xml files look like, it seems like:

  • rusheye-impl - was supposed to be lean jar (packed with no dependencies) used as maven dependency in other projects
  • rusheye-dist - was supposed to be fat jar (packed with dependencies) used for one-jar applications, as it's only dependency is rusheye-impl (it was supposed to repack it along with all dependencies)

assembly plugin in rusheye-impl was introduced in commit:
commit 99a1365
added assembly of rusheye-core

but it was not removed when rusheye-dist was added year later:
commit 8dfeb0a
added distribution configuration

@kiicia kiicia changed the title Unable to use maven rusheye in java11 due to jar-with-dependencies Unable to use rusheye-impl via maven in java11 due to jar-with-dependencies Mar 29, 2021
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

1 participant