Reputation: 75
Am migrating an application from websphere to websphere liberty and have to migrate JSf bean validation components. How to add the WLP features to the web project using Maven .I have added
<dependency>
<groupId>net.wasdev.maven.tools.targets</groupId>
<artifactId>liberty-target</artifactId>
<version>RELEASE</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
but that doesn't get me the JSF and bean validation related classes .
Upvotes: 1
Views: 195
Reputation: 5330
I'd recommend following the example in the Open Liberty guide:
https://openliberty.io/guides/getting-started.html
The basic approach involves:
Using aggregate dependencies for compile:
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
Using the server.xml to do fine-grained feature enablement, only activating the features you're using, so for the features you mentioned, you might have:
<server description="Sample Liberty server">
<featureManager>
<feature>beanValidation-2.0</feature>
<feature>jsf-2.3</feature>
<feature>cdi-2.0</feature>
<!-- .... -->
</featureManager>
Also note, though it's not directly related to your question, you might as well be sure to use the 3.x version of the liberty-maven-plugin, with "dev mode" and a lot of other useful function:
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
Upvotes: 2