Maven Installing Guideline

Maven Handbook

Purpose: This document is help you how to installing maven andinstalling 3rd party JARs

1. Guide to installing Maven

InstallMaven on Windows

1. JDK and JAVA_HOME

Make sure JDK is installed, and “JAVA_HOME” variable is addedin Windows environment variable, and point to the JDK folder.


2. DownloadApache Maven

Visit thisMaven official website:http://maven.apache.org/download.cgi,choosea version and click on the download link, e.g.apache-maven-3.2.1-bin.zip

3. Extract It

Extract the downloaded zip file. In this case, we extractedto c driver and renamed the folder, e.g.C:\Maven.

4. Add MAVEN_HOME

Add a new “MAVEN_HOME” variable to the Windows environment,and point it to your Maven folder.


5. Verification

To verify Maven if installed is correctly, in command prompt,type “mvn -version”.

 

 

 

6. Configuring Maven

a. Configuring your local repository 

Please update the configuration setting.xml(C:\Tools\Maven\apache-maven-3.1.0\conf).The location of your local repository can be changed in your userconfiguration. The default value is ${user.home}/.m2/repository/.

<localRepository>C:/M3/repository</localRepository>

 

 

b. If you have not installed Eclipse. Recommended Eclipse4.3.0 and above. It integrated with Maven plugin.

Download link https://www.eclipse.org/downloads

 

 

 

 

c. If you have installed Eclipse, but it’s not integratedMaven function.

Open Eclipse, please choose “Help” > “Install NewSoftware…”, then type the following link to download the Maven plugin.

http://download.eclipse.org/technology/m2e/releases/1.2/1.2.0.20120903-1050

 

 

If installed ok, Choose “Windows” > “Preferences” >“Maven”

 

 

 

 

Please select the settings.xml for your installed the mavenpath.

 

 

 

 

 

7. Import Maven project

Choose “File” > “Import” > “Existing MavenProjects” 


8. Maven Command

Compilethe application: clean package install

Packagethe project: clean package package

For jetty:Start the application: clean jetty:run

ForTomcat: Start the application: clean tomcat7:run

 

 

2.  Guideto installing 3rd party JARs

1.Please prepares the JAR on your local machine

eg: C:\M3\ext\kacdr\sqlframework.jar

2. Please usesmaven command to install the JAR to your local repository.

eg: mvn install:install-file-DgroupId=com.cathaypacific.sqlframework -DartifactId=sqlframework-Dversion=1.0 -Dpackaging=jar -Dfile=C:\M3\ext\kacdr\sqlframework.jar -DgeneratePom=true

3.Configure the dependency on the pom.xml file.

<dependency>

            <groupId>com.cathaypacific.sqlframework</groupId>

            <artifactId>sqlframework</artifactId>

            <version>1.0</version>

</dependency>

4. Right click the project “KACrewDirectRequests”, select“Maven” > “Update Project…”

mvninstall:install-file -DgroupId=com.cathaypacific.sqlframework-DartifactId=sqlframework -Dversion=1.0 -Dpackaging=jar-Dfile=C:\M3\ext\kacdr\sqlframework.jar -DgeneratePom=true

 

 

5. Find Bugs uses static analysis to identify hundreds ofdifferent potential types of errors in Java programs.

Find Bugs for maven project:

<plugin>

            <groupId>org.codehaus.mojo</groupId>

            <artifactId>findbugs-maven-plugin</artifactId>

            <version>2.3.2</version>

            <configuration>

                        <findbugsXmlOutput>true</findbugsXmlOutput>

                        <findbugsXmlWithMessages>true</findbugsXmlWithMessages>

                        <xmlOutput>true</xmlOutput>

                        <findbugsXmlOutputDirectory>target/site</findbugsXmlOutputDirectory>

            </configuration>

</plugin>

 

3. Configuring localdev for CSC Maven project

1. Selectthe project, right click “Run As” > “Run Configurations…” , please add theparameter as the following:

Name=spring.profiles.default

Value=local_dev


2. Please add the comment for the following parameter on the Web.xml

<!-- 

    <context-param>

              <param-name>spring.profiles.default</param-name>

              <param-value>dev</param-value>

    </context-param>

-->

 

-server -Xms256m -Xmx512m -XX:PermSize=256m-XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDetails-Xloggc:%M2_HOME%/gc.log -XX:+HeapDumpOnOutOfMemoryError-XX:HeapDumpPath=%M2_HOME%/java_pid<pid>.hprof

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

啸梦飞扬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值