0

我正在尝试将 Spring 3.1.2 Security 添加到现有的 JSF 应用程序,问题是找不到此注释,我不知道那里缺少哪个依赖项。任何帮助表示赞赏:

POM.xml

<properties>
    <myfaces.version>2.1.8</myfaces.version>
    <spring-security.version>3.1.2.RELEASE</spring-security.version>
</properties>

        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-acl</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${spring-security.version}</version>
        </dependency>   
4

1 回答 1

0

您没有提到您要部署到哪个应用服务器,所以我假设 Tomcat,它通常不具有所有/Java EE 依赖项。如果您只是在寻找注释,您可以简单地获取 JSR250 API 依赖项:

<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>jsr250-api</artifactId>
    <version>1.0</version>
</dependency>

您还可以引入完整的 Java EE 6 API:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
</dependency>
于 2012-10-04T14:36:33.107 回答