用ECLIPSE 導(dǎo)入MAVEN項目后,POM.XML該怎么寫
在eclipse里導(dǎo)入一個maven項目后,POM.XML該怎么改寫呢,老師在視頻教程里好像是從其它地方拷貝來的代碼,但是沒有細說是從哪來的!我已經(jīng)提過一個這個問題,有人讓我去聽maven課程,我去聽了,但是課程中講的重點是maven的原理,沒有講到我想要問的方面的詳解,請高手賜教
在eclipse里導(dǎo)入一個maven項目后,POM.XML該怎么改寫呢,老師在視頻教程里好像是從其它地方拷貝來的代碼,但是沒有細說是從哪來的!我已經(jīng)提過一個這個問題,有人讓我去聽maven課程,我去聽了,但是課程中講的重點是maven的原理,沒有講到我想要問的方面的詳解,請高手賜教
2016-06-09
舉報
2016-06-29
<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.education</groupId>
? <artifactId>educationcrm</artifactId>
? <packaging>war</packaging>
? <version>1.0-SNAPSHOT</version>
? <name>educationcrm Maven Webapp</name>
? <url>http://maven.apache.org</url>
? <properties>
? ? <!-- spring版本號 -->
? ? <spring.version>4.0.2.RELEASE</spring.version>
? ? <!-- mybatis版本號 -->
? ? <mybatis.version>3.2.6</mybatis.version>
? ? <!-- log4j日志文件管理包版本 -->
? ? <slf4j.version>1.7.7</slf4j.version>
? ? <log4j.version>1.2.17</log4j.version>
? </properties>
? <!-- 指定maven倉庫 -->
? <repositories><!-- 發(fā)現(xiàn)依賴和擴展的遠程資源庫 -->
? ? <repository>
? ? ? <id>CN</id>
? ? ? <name>OSChina Central</name>
? ? ? <layout>default</layout>
? ? ? <url>http://maven.oschina.net/content/groups/public/</url>
? ? ? <snapshots>
? ? ? ? <enabled>false</enabled>
? ? ? </snapshots>
? ? </repository>
? ? <!-- maven自己官方倉庫 -->
? ? <repository>
? ? ? <id>maven</id>
? ? ? <name>Maven Repository Switchboard</name>
? ? ? <layout>default</layout>
? ? ? <url>http://repo1.maven.org/maven2</url>
? ? ? <snapshots>
? ? ? ? <enabled>false</enabled>
? ? ? </snapshots>
? ? </repository>
? ? <!-- 阿里巴巴發(fā)布版本倉庫 -->
? ? <repository>
? ? ? <id>alibaba-opensource</id>
? ? ? <name>alibaba-opensource</name>
? ? ? <url>http://code.alibabatech.com/mvn/releases/</url>
? ? ? <layout>default</layout>
? ? </repository>
? ? <!-- 阿里巴巴快照版本倉庫 -->
? ? <repository>
? ? ? <id>alibaba-opensource-snapshot</id>
? ? ? <name>alibaba-opensource-snapshot</name>
? ? ? <url>http://code.alibabatech.com/mvn/snapshots/</url>
? ? ? <layout>default</layout>
? ? </repository>
? </repositories>
? <dependencies>
? ? <dependency>
? ? ? <groupId>junit</groupId>
? ? ? <artifactId>junit</artifactId>
? ? ? <version>4.11</version>
? ? ? <!-- 表示開發(fā)的時候引入,發(fā)布的時候不會加載此包 -->
? ? ? <scope>test</scope>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-core</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-web</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-oxm</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-tx</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-jdbc</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-webmvc</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-aop</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-context-support</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-test</artifactId>
? ? ? <version>${spring.version}</version>
? ? </dependency>
? ? <!-- mybatis核心包 -->
? ? <dependency>
? ? ? <groupId>org.mybatis</groupId>
? ? ? <artifactId>mybatis</artifactId>
? ? ? <version>${mybatis.version}</version>
? ? </dependency>
? ? <!-- mybatis/spring包 -->
? ? <dependency>
? ? ? <groupId>org.mybatis</groupId>
? ? ? <artifactId>mybatis-spring</artifactId>
? ? ? <version>1.2.2</version>
? ? </dependency>
? ? <!-- 導(dǎo)入java ee jar 包 -->
? ? <dependency>
? ? ? <groupId>javax</groupId>
? ? ? <artifactId>javaee-api</artifactId>
? ? ? <version>7.0</version>
? ? </dependency>
? ? <!-- 導(dǎo)入Mysql數(shù)據(jù)庫鏈接jar包 -->
? ? <dependency>
? ? ? <groupId>mysql</groupId>
? ? ? <artifactId>mysql-connector-java</artifactId>
? ? ? <version>5.1.30</version>
? ? </dependency>
? ? <!-- 導(dǎo)入dbcp的jar包,用來在applicationContext.xml中配置數(shù)據(jù)庫 -->
? ? <dependency>
? ? ? <groupId>commons-dbcp</groupId>
? ? ? <artifactId>commons-dbcp</artifactId>
? ? ? <version>1.2.2</version>
? ? </dependency>
? ? <!-- JSTL標(biāo)簽類 -->
? ? <dependency>
? ? ? <groupId>jstl</groupId>
? ? ? <artifactId>jstl</artifactId>
? ? ? <version>1.2</version>
? ? </dependency>
? ? <!-- 日志文件管理包 -->
? ? <!-- log start -->
? ? <dependency>
? ? ? <groupId>log4j</groupId>
? ? ? <artifactId>log4j</artifactId>
? ? ? <version>${log4j.version}</version>
? ? </dependency>
? ? <!-- 格式化對象,方便輸出日志 -->
? ? <dependency>
? ? ? <groupId>com.alibaba</groupId>
? ? ? <artifactId>fastjson</artifactId>
? ? ? <version>1.1.41</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.slf4j</groupId>
? ? ? <artifactId>slf4j-api</artifactId>
? ? ? <version>${slf4j.version}</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.slf4j</groupId>
? ? ? <artifactId>slf4j-log4j12</artifactId>
? ? ? <version>${slf4j.version}</version>
? ? </dependency>
? ? <!-- log end -->
? ? <!-- 映入JSON -->
? ? <dependency>
? ? ? <groupId>org.codehaus.jackson</groupId>
? ? ? <artifactId>jackson-mapper-asl</artifactId>
? ? ? <version>1.9.13</version>
? ? </dependency>
? ? <!-- 上傳組件包 -->
? ? <dependency>
? ? ? <groupId>commons-fileupload</groupId>
? ? ? <artifactId>commons-fileupload</artifactId>
? ? ? <version>1.3.1</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>commons-io</groupId>
? ? ? <artifactId>commons-io</artifactId>
? ? ? <version>2.4</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>commons-codec</groupId>
? ? ? <artifactId>commons-codec</artifactId>
? ? ? <version>1.9</version>
? ? </dependency>
? ? <!-- druid -->
? ? <dependency>
? ? ? <groupId>com.alibaba</groupId>
? ? ? <artifactId>druid</artifactId>
? ? ? <version>0.2.9</version>
? ? </dependency>
? ? <!-- aspectjweaver.jar這是Spring AOP所要用到的包 -->
? ? <dependency>
? ? ? <groupId>org.aspectj</groupId>
? ? ? <artifactId>aspectjweaver</artifactId>
? ? ? <version>1.7.1</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.springframework</groupId>
? ? ? <artifactId>spring-orm</artifactId>
? ? ? <version>3.2.0.RELEASE</version>
? ? </dependency>
? ? <!-- hibernate4 -->
? ? <dependency>
? ? ? <groupId>org.hibernate</groupId>
? ? ? <artifactId>hibernate-core</artifactId>
? ? ? <version>4.2.5.Final</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.hibernate</groupId>
? ? ? <artifactId>hibernate-entitymanager</artifactId>
? ? ? <version>4.2.5.Final</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.hibernate</groupId>
? ? ? <artifactId>hibernate-ehcache</artifactId>
? ? ? <version>4.2.5.Final</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.hibernate.javax.persistence</groupId>
? ? ? <artifactId>hibernate-jpa-2.0-api</artifactId>
? ? ? <version>1.0.1.Final</version>
? ? </dependency>
? ? <!--驗證碼-->
? ? <dependency>
? ? ? <groupId>com.github.penggle</groupId>
? ? ? <artifactId>kaptcha</artifactId>
? ? ? <version>2.3.2</version>
? ? </dependency>
? ? <dependency>
? ? ? <groupId>junit</groupId>
? ? ? <artifactId>junit</artifactId>
? ? ? <version>4.11</version>
? ? </dependency>
? ? <!-- jackson start -->
? ? <dependency>
? ? ? <groupId>org.codehaus.jackson</groupId>
? ? ? <artifactId>jackson-core-asl</artifactId>
? ? ? <version>1.9.12</version>
? ? </dependency>
? ? ? <dependency>
? ? ? ? ? <groupId>com.fasterxml.jackson.core</groupId>
? ? ? ? ? <artifactId>jackson-core</artifactId>
? ? ? ? ? <version>2.7.4</version>
? ? ? </dependency>
? ? <dependency>
? ? ? <groupId>com.fasterxml.jackson.core</groupId>
? ? ? <artifactId>jackson-annotations</artifactId>
? ? ? <version>2.7.4</version>
? ? </dependency>
? ? ? <dependency>
? ? ? ? ? <groupId>com.fasterxml.jackson.core</groupId>
? ? ? ? ? <artifactId>jackson-databind</artifactId>
? ? ? ? ? <version>2.7.4</version>
? ? ? </dependency>
? ? <dependency>
? ? ? <groupId>org.codehaus.jackson</groupId>
? ? ? <artifactId>jackson-mapper-lgpl</artifactId>
? ? ? <version>1.9.12</version>
? ? </dependency>
? ? <!-- http://mvnrepository.com/artifact/commons-io/commons-io -->
? ? <dependency>
? ? ? <groupId>commons-io</groupId>
? ? ? <artifactId>commons-io</artifactId>
? ? ? <version>2.4</version>
? ? </dependency>
? ? <!-- http://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
? ? <dependency>
? ? ? <groupId>commons-fileupload</groupId>
? ? ? <artifactId>commons-fileupload</artifactId>
? ? ? <version>1.3.1</version>
? ? </dependency>
? </dependencies>
? <build>
? ? <finalName>educationcrm</finalName>
? ? <plugins>
? ? ? <plugin>
? ? ? ? <groupId>org.apache.maven.plugins</groupId>
? ? ? ? <artifactId>maven-compiler-plugin</artifactId>
? ? ? ? <configuration>
? ? ? ? ? <source>1.8</source>
? ? ? ? ? <target>1.8</target>
? ? ? ? </configuration>
? ? ? </plugin>
? ? </plugins>
? </build>
</project>
這個是我的pom文件,主要使用的spring,springmvc,hibernate
<dependency>
中間就是需要的jar包和jar版本號
</dependency>
具體需要什么jar包去?http://mvnrepository.com/? 這個網(wǎng)站就是maven的jar倉庫
2016-09-17
我也想知道從哪兒copy的
2016-06-09
COPY都不會還學(xué)什么?