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

jar task is easily confused after uber generated multiple pom.properties files #112

Closed
schmir opened this issue Jan 29, 2015 · 7 comments
Closed

Comments

@schmir
Copy link
Contributor

schmir commented Jan 29, 2015

the jar task searches for pom.properties files in the fileset and chooses the first one in order to build the jar's name from it. The first one is pretty much random on my windows system, so I end up with a jar file name of one of my dependencies. As a workaround I can specify the filename via the file argument.

@micha
Copy link
Contributor

micha commented Feb 2, 2015

Can we assume that pom.{properties,xml} files will be in the META-INF subdirectory of the the JARs being pulled in by uber? If so perhaps we just want to ignore anything in META-INF when we unpack the JARs into the fileset?

Perhaps the uber task should ignore pom.{xml,properties} files when unpacking? It already ignores files in META-INF...

@schmir
Copy link
Contributor Author

schmir commented Feb 2, 2015

I'd rather vote for making it explicit. Or, is there a way to associate metadata to individual entries in the fileset? If not, probably there should be a way to do that.

@micha
Copy link
Contributor

micha commented Feb 7, 2015

There definitely is! You can use the boot.core/add-meta function to associate metadata with entries in the fileset.

@schmir
Copy link
Contributor Author

schmir commented Feb 10, 2015

@micha thanks for the pointer.

I think the :exclude pattern for the META_INF directory does not work on windows, since it uses a slash character instead of a backslash. Will open an issue for that one.

Why does it exclude that directory by default?

@micha
Copy link
Contributor

micha commented Feb 10, 2015

@schmir It excludes that directory because the stuff in it is only pertinent to the packaging of the jar, not to the code contained within (it's meta information about the jar itself), so when you make an uberjar the meta information about a constituent dependency jar is not relevant to the jar you're building (the uberjar).

@micha micha closed this as completed Feb 10, 2015
@micha micha reopened this Feb 10, 2015
@schmir
Copy link
Contributor Author

schmir commented Feb 10, 2015

I'm reading that pom files from dependencies at runtime in order to print the version of packaged dependencies.

@jeluard
Copy link

jeluard commented Sep 26, 2015

I noticed this happen when uber task is used with some :exclude patterns. There is then an extra debug line duplicate entry: META-INF/MANIFEST.MF right after Writing ... .jar from the jar task.

It appears this is because setting your own exclude overrides default and META-INF from various libs collide.
I am not clear if this is on purpose or not. Maybe the default could still apply when you provide your own excludes? Or META-INF from libs could be relocated somewhere?

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