Maven build with POM-type dependencies
Maven build with POM-type dependencies
- Subject: Maven build with POM-type dependencies
- From: Dennis Scheffer <email@hidden>
- Date: Mon, 07 Jan 2019 09:02:58 +0100
Hello everyone,
As per the Maven best practices found at
https://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-best-practice.html
<https://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-best-practice.html>,
I am trying to group common dependencies in separate modules of a multi-module
project. When running the project in Eclipse everything works fine but when I
deploy the application the startup fails due to bad jar-files.
I narrowed down the classpath entries causing the application to fail and
discovered the cause. For some reason the *ClassPath.txt files generated by the
wolifecycle plugin contain entries even for the pom type dependencies.
So if I have a dependency like this in my pom file
<dependency>
<groupId>com.example</groupId>
<artifactId>Dependencies</artifact>
<version>1.0</version>
<type>pom</pom>
</dependency>
I get an entry in my *ClassPath.txt files like this
APPROOT/Resources/Java/com/example/Dependencies/1.0/Dependencies-1.0.jar
Since the respective modules do not produce jar files due to their packaging
type being 'pom', the built generates some dummy .jar files which seem to be
broken. When I try to unzip such files from the command line, I get the error:
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
When I remove the faulty entries from the *ClassPath.txt files, the application
starts successfully. Has anyone encountered this problem? Is there a good way
to have the build process remove such entries automatically or maybe not
generate them at all?
Thanks a lot for any suggestions!
With kind regards
--
Dennis Scheffer
Phone +49-(0)941-69 84 84-25
email@hidden
===================================
SELBSTDENKER AG - No Vision Too Far
Gesandtenstraße 10
93047 Regensburg
Phone +49-(0)941-69 84 84-0
Fax +49-(0)941-69 84 84-99
email@hidden
http://www.selbstdenker.ag
Niederlassung: Regensburg
Handelsregister: Regensburg HRB 7860
Vorstand/CEO: Herr Stephan Fürnrohr
Vors. des Aufsichtsrates/Chairman of the board:
Herr Dipl. Betriebswirt (FH) Richard Sibinger
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden