http://qqbwww.iteye.com/blog/2042307

****************************************

#Maven打包遇到的一些问题

## 1.将依赖打成一个包
参考这篇

## 2.Fatal error compiling: 无效的目 标版本: 1.7 -> [Help 1]

因为是在cmd中执行,然后maven依赖jdk,我的环境变量中将JAVA_HOME写死,指导了jdk1.6版本。而这个项目需要1.7版本,在POM文件的编译插件中

  1. <plugin>
  2. <artifactId>maven-compiler-plugin</artifactId>
  3. <version>3.1</version>
  4. <configuration>
  5. <source>1.7</source>
  6. <target>1.7</target>
  7. </configuration>
  8. </plugin>

将版本设置为1.7就会报上面的错误。重新指定环境变量JAVA_HOME指到支持1.7以上的JDK就可以了

eg

<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-samples</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
</parent>
<artifactId>spring-boot-sample-web-thymeleaf3</artifactId>
<name>Spring Boot Web Thymeleaf 3 Sample</name>
<description>Spring Boot Web Thymeleaf 3 Sample</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>http://www.spring.io</url>
</organization>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

Maven打包遇到的一些问题(zhuan)的更多相关文章

  1. maven 打包含有第三方依赖的 jar 包

    maven 打包含有第三方依赖的 jar 包:mvn assembly:assembly

  2. maven打包问题

    <build> <finalName>项目名</finalName> <!-- 配置maven打包时过滤的文件 --> <resources> ...

  3. Idea开发环境中搭建Maven并且使用Maven打包部署程序

    1.配置Maven的环境变量 a.首先我们去maven官网下载Maven程序,解压到安装目录,如图所示: b.配置M2_HOME的环境变量,然后将该变量添加到Path中 备注:必须要有JAVA_HOM ...

  4. 利用Maven打包时,如何包含更多的资源文件

    首先,来看下MAVENx项目标准的目录结构: 一般情况下,我们用到的资源文件(各种xml,properites,xsd文件等)都放在src/main/resources下面,利用maven打包时,ma ...

  5. maven打包不执行测试用例

    在执行maven打包时不需要执行测试用例,使用如下2种方式实现:-DskipTests=true : 不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下 ...

  6. maven打包步骤_maven 构建项目

    maven打包 1:先在pom文件中添加下面配置  jar <build>        <plugins>            <!-- compiler插件, 设定 ...

  7. Maven打包pom里面配置exclude 排除掉环境相关的配置文件

    Maven打包pom里面配置exclude 排除掉环境相关的配置文件 有几种方式:1. 打包时,指定环境参数把环境的配置文件复制过去2. 不打包所有的环境相关的配置文件,直接由运维的人维护 可以在上传 ...

  8. maven打包异常

    maven打包异常,如图: 问题原因:服务器密码错了.

  9. maven打包异常:软件包com.sun.org.apache.xml.internal.security.utils.Base64 不存在

    maven打包异常:软件包com.sun.org.apache.xml.internal.security.utils.Base64 不存在 将jre/lib/rt.jar添加到maven的compi ...

随机推荐

  1. javaScript判断鼠标滚轮的上下滚动

    分享一个js实现判断鼠标滚轮的上下滚动: <script type="text/javascript"> var scrollFunc = function (e) { ...

  2. openmp在图像处理上面的运用

    // openmptest的测试程序 //   #include "stdafx.h"   void Test(int n){     for (int i=0;i<1000 ...

  3. EasyUI的DataGrid 打印导出

    EasyUI的DataGrid 打印导出   一直在Winform和WPF的项目,偶尔接触Web都是网上下个模板修修改改就成了,学习的不太深入. 今日遇到一个打印导出datagrid的问题,做桌面项目 ...

  4. jquery.util.easyui.dialog

    (function ($) { var $parent = parent.$; //获取弹出窗口数据集合 function getDialogs() { var dialogs = $parent(& ...

  5. AutoIt实现selenium上传文件

    1,安装autoIt 2,工程中建文件夹,例如:script,将autoit 复制到该文件夹,并且编辑视频所在的文件夹的路径,编辑"au3"格式的文件 3,编辑完成后生成EXE文件 ...

  6. P1533 可怜的狗狗

    http://www.luogu.org/problem/show?pid=1533 题目背景 小卡由于公务需要出差,将新家中的狗狗们托付给朋友嘉嘉,但是嘉嘉是一个很懒的人,他才没那么多时间帮小卡喂狗 ...

  7. IIS与Apache共用80端口方法[试用成功]

    然后假设apache服务器已经安装完成,打开httpd.conf配置文件,找到这些地方去掉#开启代理模块: LoadModule proxy_module modules/mod_proxy.so L ...

  8. WDCP控制面板如何安装PDO_mysql组件

    http://osacar.iteye.com/blog/2098431 执行wget -c http://down.wdlinux.cn/in/pdo_mysql_ins.sh再执行chmod 75 ...

  9. mfc学生成绩录入与查询

    1.声明结构体 struct Person{ char name[8]; char yuwen[8]; char math[8];}; 2.成绩录入 在"保存"按钮中实现以下代码 ...

  10. 取出ip address control的ip字符

    1.给这个空间设置control型变量 m_add; 2.定义4个字节型变量,来获取控件中的4个ip字节 BYTE a,b,c,d: m_add.GetAddress(a,,b,c,d): 3.定义I ...