Maven +eclipse+subverson(svn)開發(環境搭建)

來源:互聯網
上載者:User
工具下載

1下載jdk

2、安裝eclipse到 http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigosr1

下載最新版本的jeeEclipse 

3、安裝maven到:

http://maven.apache.org/download.html

下載最新版本的maven 環境的配置

1、 在我的電腦屬性中配置jdk的環境和maven的環境變數

2、 在eclipse中配置剛才安裝好的jdk

3、 在eclipse中安裝如下外掛程式:

1、 subversion 版本控制器:http://subclipse.tigris.org/update_1.6.x

2、 m2eclipse外掛程式  http://m2eclipse.sonatype.org/sites/m2e/


3、 m2eclipse擴充 http://m2eclipse.sonatype.org/sites/m2e-extras/

或者:http://download.jboss.org/jbosstools/updates/m2e-extensions/


選擇 Maven Integration for Eclipse WTP (web項目外掛程式)

 Maven Integration for Subeclipse (svn外掛程式)


運行項目

svn下載項目 需要如下兩步:

1、配置svn建立資產庫

2、配置maven項目的scm

1、選擇Checkout Maven Projects from SCM


2、 填寫好svn地址

注意這個地址應該是 svn://192.168.16.51/repos/trunk 

Trunk目錄下因為這個主幹目錄。


3、 點擊finish之後項目就下載下來了。


常見問題

1、 最好是將項目的檔案的格式統一UTF-8或者GBK,然後在pom.xml中編譯外掛程式中加入如下內容:

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<configuration>

<source>1.5</source>

<target>1.5</target>

<encoding>UTF-8</encoding>

</configuration>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-resources-plugin</artifactId>

<configuration>

<source>1.5</source>

<target>1.5</target>

<encoding>UTF-8</encoding>

</configuration>

</plugin>


m2eclipse後 可能會報Eclipse 運行使用指定的 JVM - m2eclipse 外掛程式找不到 com.sun 的 default-tools.jar

1、在pom.xml中添加

<profiles>

<profile>

<id>default-tools.jar</id>

<activation>

<property>

<name>java.vendor</name>

<value>Sun Microsystems Inc.</value>

</property>

</activation>

<dependencies>

<dependency>

<groupId>com.sun</groupId>

<artifactId>tools</artifactId>

<version>1.5.0_05</version>

<scope>system</scope>

<systemPath>${java.home}/../lib/tools.jar</systemPath>

</dependency>

</dependencies>

</profile>

</profiles>



2、開啟eclipse.ini檔案添加:

-vm

H:\Progra~1\Java\jdk1.7.0_04\jre\bin\javaw.exe

注意:

不能有空格,否則要用~1代替,如: ‘Program Files’ is ‘Progra~1′

jre裡面的javaw.exe

一定要在:-vmargs之前


預設eclipse的檔案編譯:


為什麼web項目啟動的時候找不到類。

1、有可能是在pom.xml中更新某個jar包的版本,導致久版本還遺留在webapp/web-inf/lib 下面,這是一個非常常見的問題,如果升級某個子模組也可能導致久版本在lib下面出現各式各樣的問題。


為什麼安裝maven外掛程式報錯。
選擇3.7版本下載,maven外掛程式安裝的時候會依賴依賴這個外掛程式,沒有的會有錯誤,資訊如下:
Cannot complete the install because one or more required items could not be found.
Software being installed: Maven Integration for Eclipse (Required) 0.10.0.20100209-0800 (org.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800)
Missing requirement: Maven Integration for Eclipse (Editors) 0.10.0.20100209-0800 (org.maven.ide.eclipse.editor 0.10.0.20100209-0800) requires ‘bundle org.eclipse.zest.core 0.0.0′ but it could not be found
Cannot satisfy dependency:
From: Maven Integration for Eclipse (Required) 0.10.0.20100209-0800 (org.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800)
To: org.maven.ide.eclipse.editor [0.10.0.20100209-0800]

先安裝gef外掛程式
地址:http://download.eclipse.org/tools/gef/updates/interim/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.