Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 尝试用maven构建第一个Spring项目_Java_Spring_Maven - Fatal编程技术网

Java 尝试用maven构建第一个Spring项目

Java 尝试用maven构建第一个Spring项目,java,spring,maven,Java,Spring,Maven,我正在尝试使用maven构建我的第一个Spring项目,在使用maven之前它是有效的,但是现在我正在尝试使用maven进行构建,我得到了以下输出。有人能告诉我发生了什么事吗 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building WebFlowTemplate Maven Webapp [INFO

我正在尝试使用maven构建我的第一个Spring项目,在使用maven之前它是有效的,但是现在我正在尝试使用maven进行构建,我得到了以下输出。有人能告诉我发生了什么事吗

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building WebFlowTemplate Maven Webapp
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 5 source files to /home/jsmith/Downloads/home/jsmith/Documents/workspace-sts-3.0.0/WebFlowTemplate/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/home/jsmith/Downloads/home/jsmith/Documents/workspace-sts-3.0.0/WebFlowTemplate/src/main/java/org/uftwf/webflowtemplate/service/TestServiceImpl.java:[9,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Service

/home/jsmith/Downloads/home/jsmith/Documents/workspace-sts-3.0.0/WebFlowTemplate/src/main/java/org/uftwf/webflowtemplate/controller/HelloWorldController.java:[8,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Controller

/home/jsmith/Downloads/home/jsmith/Documents/workspace-sts-3.0.0/WebFlowTemplate/src/main/java/org/uftwf/webflowtemplate/controller/swf/HellowWorldFlowActions.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.apache.log4j.Logger.getLogger;

/home/jsmith/Downloads/home/jsmith/Documents/workspace-sts-3.0.0/WebFlowTemplate/src/main/java/org/uftwf/webflowtemplate/controller/swf/HellowWorldFlowActions.java:[13,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Component

/home/jsmith/Downloads/home/jsmith/Documents/workspace-sts-3.0.0/WebFlowTemplate/src/main/java/org/uftwf/webflowtemplate/domain/Customer.java:[7,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@SuppressWarnings("serial")


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Sep 13 22:09:00 EDT 2012
[INFO] Final Memory: 19M/163M
[INFO] ------------------------------------------------------------------------
这是我的pox.xml文件:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.springsource.greenbeans.maven</groupId>
    <artifactId>WebFlowTemplate</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>WebFlowTemplate Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
<!-- 
<dependency>
        <groupId>org.jasig.cas</groupId>
        <artifactId>cas-server-core</artifactId>
        <version>3.5.0</version>
        <exclusions>
            <exclusion>
                <artifactId>jcl-over-slf4j</artifactId>
                <groupId>org.slf4j</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.6.6</version>
    </dependency>

-->
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.3.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.3.0.Final</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>1.6.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.webflow</groupId>
            <artifactId>spring-webflow</artifactId>
            <version>2.3.1.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-ldap</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-cas</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-cas-client</artifactId>
            <version>3.0.7.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.ldap</groupId>
            <artifactId>spring-ldap-core</artifactId>
            <version>1.3.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.ldap</groupId>
            <artifactId>spring-ldap-core-tiger</artifactId>
            <version>1.3.0.RELEASE</version>
        </dependency>

<!-- 
        <dependency>
            <groupId>org.jasig.cas</groupId>
            <artifactId>cas-server-core</artifactId>
            <version>3.5.0</version>
        </dependency>
 -->
        <dependency>
            <groupId>org.jasig.cas.client</groupId>
            <artifactId>cas-client-core</artifactId>
            <version>3.1.12</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.6</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-ext</artifactId>
            <version>1.6.6</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.6</version>
        </dependency>
<!-- 
        <dependency>
            <groupId>org.apache.directory.server</groupId>
            <artifactId>apacheds-core</artifactId>
            <version>1.5.5</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.directory.server</groupId>
            <artifactId>apacheds-server-jndi</artifactId>
            <version>1.5.5</version>
            <scope>runtime</scope>
        </dependency>
 -->
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>2.2.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-nop</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>
    <build>
        <finalName>WebFlowTemplate</finalName>

    </build>
</project>

4.0.0
org.springsource.greenbeans.maven
WebFlowTemplate
战争
0.0.1-快照
WebFlowTemplate Maven Webapp
http://maven.apache.org
jstl
jstl
1.2
org.hibernate
冬眠核心
3.6.3.最终版本
org.hibernate
休眠验证器
4.3.0.1最终版本
朱尼特
朱尼特
3.8.1
测验
org.aspectj
aspectjtools
1.6.2
org.springframework
春季方面
3.1.2.1发布
org.springframework
spring上下文
3.1.2.1发布
org.springframework.webflow
SpringWebFlow
2.3.1.1发布
org.springframework.security
spring安全内核
3.1.2.1发布
org.springframework.security
spring安全网
3.1.2.1发布
org.springframework.security
spring安全配置
3.1.2.1发布
org.springframework.security
spring安全ldap
3.1.2.1发布
org.springframework.security
春季安全
3.1.2.1发布
org.springframework.security
spring安全cas客户端
3.0.7.1发布
org.springframework
春季aop
3.1.2.1发布
log4j
log4j
1.2.17
c3p0
c3p0
0.9.1.2
org.springframework.ldap
SpringLDAP核心
1.3.0.1发布
org.springframework.ldap
春之虎
1.3.0.1发布
org.jasig.cas.client
cas客户端核心
3.1.12
org.slf4j
slf4j api
1.6.6
org.slf4j
slf4j分机
1.6.6
org.slf4j
slf4j-log4j12
1.6.6
org.apache.tiles
平铺jsp
2.2.2
org.slf4j
slf4j nop
org.slf4j
slf4j api
org.slf4j
jcl-over-slf4j
WebFlowTemplate

看来您使用的是JDK 1.5之前的版本。java中的注释支持是从JDK 1.5开始引入的,您应该将项目配置为使用1.5或更高版本运行,如下所示:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
</build>

org.apache.maven.plugins
maven编译器插件
2.5.1
1.5
1.5

看来您使用的是JDK 1.5之前的版本。java中的注释支持是从JDK 1.5开始引入的,您应该将项目配置为使用1.5或更高版本运行,如下所示:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
</build>

org.apache.maven.plugins
maven编译器插件
2.5.1
1.5
1.5