简体   繁体   中英

JSF Maven Mojarra implementation

I try to create simple project with JSF, Eclipse and Maven. I used

<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>

for download by Maven jsf-api. But if I understand correct I also need jsf-impl? When I try add like:

<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>

nothing find. Where I can find jsf-impl? Thanks.

On the same website that I posted on your last question, the instructions explain that you shouldn't need jsf-impl, because your app server should provide it. The site goes on to mention how to get it from maven if you really need it.

<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.0</version>

If you need the Mojarra implementation, this is available in the Java.net repository. You'll need to add the following entries in your POM:

<project>
    ...
    <dependencies>
    ...
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    ...
    <repositories>
    ...
        <repository>
            <id>Java.net</id>
            <url>http://download.java.net/maven/2</url>
        </repository>
    </repositories>
    ...
</project>

Update: the repository mentioned here is not available anymore. But you can pick a good maven repository (maven central) of your liking.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM