zoukankan      html  css  js  c++  java
  • pom.xml文件指定jdk版本号

    <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>com.chinasofti</groupId>
        <!-- 工程名 -->
        <artifactId>web01</artifactId>
        <!-- 打包类型 -->
        <packaging>war</packaging>
        <!-- 版本 -->
        <version>0.0.1-SNAPSHOT</version>
        <name>web01 Maven Webapp</name>
        <url>http://maven.apache.org</url>
    
    
        <!-- 指定依赖jar -->
        <dependencies>
            <!-- junit单元测试 -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.10</version>
                <!-- test 仅测试时依赖该jar compile 编译期使用 -->
                <scope>test</scope>
            </dependency>
    
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>compile</scope>
            </dependency>
    
            <dependency>
                <groupId>com.chinasofti</groupId>
                <artifactId>commons</artifactId>
                <version>0.0.1-SNAPSHOT</version>
    
            </dependency>
        </dependencies>
        <build>
            <!-- finalName指定打包生成的文件名,默认为工程名-版本号 -->
            <finalName>web01</finalName>
    
            <plugins>
                <!-- 指定jdk版本 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <!-- 源码的编译器版本 -->
                        <source>1.8</source>
                        <!-- class的编译器版本 -->
                        <target>1.8</target>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <!-- 跳过测试 -->
                        <skip>true</skip>
                    </configuration>
                    <version>2.18.1</version>
                </plugin>
    
            </plugins>
        </build>
    </project>

    错误截图

     解决方法:

    再重新构建就没问题了!

  • 相关阅读:
    linux解压 tar命令
    kernel部分数据结构列表二(超级块)
    Linux QQ 的安装
    怎么把uclinux下载到EPCS中
    CentOS 5 上安装git
    【转】Linux下使用Evolution收发Email
    几个采样代码的对比
    NIOS II 安装uclinux的硬件要求
    S3C2440 Timer初始化方法
    基于NIOS II的液晶显示设计——ucGUI移植
  • 原文地址:https://www.cnblogs.com/fuyuteng/p/13677259.html
Copyright © 2011-2022 走看看