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

Artifacts should be copied by user selection (runtime, compile, etc) #23

Open
GoogleCodeExporter opened this issue Apr 7, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. The one-jar maven plugin will copy all dependency libraries in to the 
one.jar/lib/ directory.

2. This includes even <scope>compile</scope> libraries of transitive 
dependencies, which are in 99% of all cases not needed to run the one.jar.

3. This means there are unnecessary libraries in the one.jar, bloating the 
resulting archive.

Ideally I should be able to pick

a) if transitive dependencies should be copied at all
b) for all dependencies (transitive or not) what scopes should be considered
c) probably, the default should be to copy transitive dependencies with 
<scope>runtime</scope> and not any other scope


What version of onejar-maven-plugin are you using?

1.4.3
What is the output of "mvn -version" on your machine?


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 8 Jul 2010 at 10:12

@GoogleCodeExporter
Copy link
Author

This is a classic problem with artifacts which are not declared correctly, 
bringing in too many or too few transitive dependencies. It should be handled 
by the authors/maintainers of those dependencies, but can be overridden by you 
in the <dependency> declaration using <excludes>.

Original comment by [email protected] on 6 Oct 2010 at 8:48

  • Changed state: WontFix
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

I know how to declare dependencies and their transitive behavior and I'm quite 
sure I've not made a mistake.  Compile scoped transitive dependencies should 
not be copied into the one-jar archive but they are.

Related to this bug: one-jar also copies <optional>true</optional> transitive 
dependencies into the archive.

Original comment by [email protected] on 6 Oct 2010 at 9:08

@GoogleCodeExporter
Copy link
Author

My mistake; I was too quick to dismiss. Thanks for clarifying!

Original comment by [email protected] on 7 Oct 2010 at 3:55

  • Changed state: Accepted
  • Added labels: Type-Defect
  • Removed labels: Type-Enhancement

@GoogleCodeExporter
Copy link
Author

This declaration in my parent pom:

            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>${javax.inject.version}</version>
                <scope>compile</scope>
                <optional>true</optional>
            </dependency>

Results in the javax.inject jar inside my one-jar archive.  Why?

Original comment by [email protected] on 18 Nov 2011 at 6:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant