Community
Participate
Working Groups
I have 3 projects, each of which can generate wars (tests of their libraries), but also generate pure jar files as libraries for other projects. I have configured them so that they via maven generate a jar file - which are correctly formatted as a jar file, i.e. their contents have this format. 0 Wed Aug 22 15:53:02 CEST 2018 META-INF/ 130 Wed Aug 22 15:53:00 CEST 2018 META-INF/MANIFEST.MF 0 Wed Aug 22 15:47:22 CEST 2018 dk/ 0 Wed Aug 22 15:47:22 CEST 2018 dk/ttsh/ 0 Wed Aug 22 15:47:22 CEST 2018 dk/ttsh/servlet/ 0 Wed Aug 22 15:47:22 CEST 2018 dk/ttsh/servlet/ROOT/ 0 Wed Aug 22 15:47:22 CEST 2018 dk/ttsh/servlet/filters/ 0 Wed Aug 22 15:47:22 CEST 2018 dk/ttsh/servlet/mappers/ When including this jar file into the primary war project in eclipse, via maven, or directly via build path (external jar), or via user libraries. The jar is apparently rebuilt internally as a war file, this means that as a jar it's structure is wrong and contains. 0 Tue May 08 12:34:54 CEST 2018 META-INF/ 39 Tue May 08 12:34:54 CEST 2018 META-INF/MANIFEST.MF 0 Tue May 08 12:34:54 CEST 2018 WEB-INF/ 0 Tue May 08 12:36:38 CEST 2018 WEB-INF/classes/ 0 Tue May 08 12:36:00 CEST 2018 WEB-INF/classes/dk/ 0 Tue May 08 12:36:00 CEST 2018 WEB-INF/classes/dk/ttsh/ 0 Tue May 08 12:41:38 CEST 2018 WEB-INF/classes/dk/ttsh/servlet/ 0 Tue May 08 12:36:00 CEST 2018 WEB-INF/classes/dk/ttsh/servlet/ROOT/ 1507 Fri Aug 24 09:04:26 CEST 2018 WEB-INF/classes/dk/ttsh/servlet/ROOT/RootStatus.class 0 Tue May 08 12:42:44 CEST 2018 WEB-INF/classes/dk/ttsh/servlet/filters/ This of course means that the classes contained in the jar file cannot be found runtime, and the service fails. Manually replacing the jar file with the correctly generated jar file in the tomcat directly, makes the service run as it should. Searching the file system, the only versions of the library that can be found are correctly formatted jar files (which eclipse is told to include in the project), however what eclipse places in the "WEB-INF/lib/" in the tomcat installation, is the corrupted jar. Building my war via maven (outside of eclipse) results in a working service, testing via eclipse results in a broken service.
Same problem seems to exist in Eclipse 4.8.
Moving to web tools
Is the projects pom's "packaging" attribute correctly set to "jar" and not "war" ?