如何配置maven以使用servlet 3 [英] How to config maven to use servlet 3

查看:150
本文介绍了如何配置maven以使用servlet 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想升级我的webapp以使用servlet 3.0(插入2.5)。我正在使用WebLogic Server版本:12.1.1.0(12c),maven,java 7_10和NetBeans 7.3.1

I want to upgrade my webapp to use servlet 3.0 (insetd of 2.5). I am using WebLogic Server Version: 12.1.1.0 (12c),maven,java 7_10 and NetBeans 7.3.1

由于某种原因,唯一可用的servlet-api是3.0- alpha-1而不是3.0

For some reason the only available servlet-api is 3.0-alpha-1 and not 3.0

<project xmlns="http://maven.apache.org/POM/4.0.0"      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<dependencies>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>3.0-alpha-1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.myfaces.core</groupId>
        <artifactId>myfaces-api</artifactId>
        <version>2.1.8</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.myfaces.core</groupId>
        <artifactId>myfaces-impl</artifactId>
        <version>2.1.8</version>
        <scope>compile</scope>
    </dependency>


推荐答案

您的选项实际上是 3.0最终版本的.1 3.1.0 工件ID已更改。使用旧的 servlet-api 工件ID,可用的版本只有2.x,除了你找到的alpha。

Your options are actually 3.0.1 or 3.1.0 of the final releases, and the artifact ID has been changed. Using the old servlet-api artifact ID, the releases available are only 2.x, aside from the alpha you've found.

如果您更新到 javax.servlet-api ,您将找到较新的 3.x 版本:

If you update to javax.servlet-api, you'll find the newer 3.x releases:

http://mvnrepository.com/artifact/javax .servlet / javax.servlet-api

您可以更新您的POM使用:

You can update your POM to use:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

这篇关于如何配置maven以使用servlet 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆