Maven学习

 

书籍

《Maven实战》

《Maven权威指南中文版》

读书笔记

本来打算边看书边练习边做笔记,不用了,别人都写好了笔记,直接去看就好了,挑重点记录一下即可:)

Maven实战学习笔记 http://blog.csdn.net/zndxlxm/article/category/6176222

 

好吧,其实重点内容也都有人记录了:

 

常见问题

 
maven-compiler-plugin 指定JDK版本和编码

命令行执行mvn clean compile时,会用告警:

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

在pom.xml中明确指定编码即可解决(见下面pom.xml中的plugins部分)

<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>me.learn</groupId>
    <artifactId>register-demo</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>register-demo Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <!-- 导入java ee jar 包 -->
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>register-demo</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
指定JDK版本和编码

参考:http://ljhzzyx.blog.163.com/blog/static/383803122013481152724/

 
Workspace defines a VM that does not contain a valid jre/lib/rt.jar: C:\Program Files\Java\jre7
Maven编译时两则信息 (Workspace以及default classpath container)
 
Error “The goal you specified requires a project to execute but there is no POM in this directory” after executing maven command
注意:该问题在PowerShell中会出现,在cmd命令行中没有问题
 

maven与eclipse结合使用

Maven转换成Eclipse/Idea/MyEclipse工程,以及配置Web工程

http://www.cnblogs.com/EasonJim/p/6624974.html

 

Eclipse/MyEclipse:

//Jar
mvn eclipse:eclipse
mvn eclipse:myeclipse
//Web
mvn eclipse:eclipse -Dwtpversion=2.0
mvn eclipse:myeclipse -Dwtpversion=2.0

更多详细命令用法,参考:http://maven.apache.org/plugins/maven-eclipse-plugin/

Idea:

mvn idea:idea

更多详细命令用法,参考:http://maven.apache.org/plugins/maven-idea-plugin/

 


How to create a Web Application Project with Maven

 
maven+eclipse+tomcat配置过程记录
 
maven生成web project,后转换为eclipse
 
 
Maven 环境快速搭建二(eclipse+maven2+jetty)
 
使用maven创建web项目
MyEclipse+Tomcat+MAVEN+SVN项目完整环境搭建
 
Eclipse+Tomcat+MAVEN+SVN项目完整环境搭建
 
Eclipse怎么导入maven的项目或项目群?
 
 
 

其他

 

Maven的第一个小程序

http://www.cnblogs.com/hongten/p/hongten_maven_first_program.html

 

 
SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
 
 
svn://192.168.6.17/ITE-EOMS/04Source/branches/DEV03

route add 192.168.0.0 mask 255.255.0.0 192.168.254.1

用svn命令行从中盈的svn服务器上将代码下载下来,如果在eclipse中直接File->Import->Maven->Existing Maven Project
posted @ 2016-12-25 13:36  Jason571  阅读(329)  评论(0编辑  收藏  举报