1

I am migrating a webapp project to Java 9 which uses primefaces.

In the maven pom.xml primefaces was declared already properly:

<dependencies>
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>6.0</version>
    </dependency>
 ...
</dependencies>

In module-info.java I added - as indicated by IntelliJ - a "requires primefaces;". So it looks:

module sharedwebapp {
    ...
    requires primefaces;
    ...
}

For other third party components this worked well. But for primefaces, I get the following error doing mvn clean install :

 >...shared-webapp/src/main/java/module-info.java:[9,14] module not found: primefaces

Is there anything I miss to declare? Anything else to add?

Naman
  • 27,789
  • 26
  • 218
  • 353
jahuer1
  • 377
  • 4
  • 15
  • 2
    What does `jar --file=primefaces-6.0.jar --describe-module` print? – Alan Bateman Mar 29 '18 at 09:18
  • Tried to list down the steps including above at [How to use 3rd party library in Java9 module?](https://stackoverflow.com/a/46715853/1746118) – Naman Mar 29 '18 at 10:01
  • @AlanBateman: C:\Users\demo\.m2\repository\org\primefaces\primefaces\6.0>`jar --file=primefaces-6.0.jar --describe-module Moduldeskriptor kann nicht abgeleitet werden f³r: primefaces-6.0.jar Provider class INSTALL not in module` ---- So this seems to be: `No module descriptor found.` – jahuer1 Mar 29 '18 at 12:57
  • 1
    This is saying that the a module descriptor cannot be derived for the library, meaning it cannot be used as an automatic module. Can you check the META-INF/services directory, it suggests there is a service provider listed named "INSTALL" that is not in the JAR file. – Alan Bateman Mar 29 '18 at 13:49

1 Answers1

1

After the hint by Alan (see comment above) it turned out that there is a nasty text "INSTALL" in the following file:

primefaces-6.0.jar/META-INF/services/org.atmosphere.cpr.AtmosphereFramework

INSTALL
org.primefaces.push.impl.PushEndpointMapper
org.primefaces.push.impl.PushEndpointInterceptor

But apparently there are only classes expected. So I took a brute force solution deleting this text 'INSTALL':

org.primefaces.push.impl.PushEndpointMapper
org.primefaces.push.impl.PushEndpointInterceptor

Running mvn clean install now works like a charm...

jahuer1
  • 377
  • 4
  • 15