Maven使用

清理依赖
mvn clean dependency:copy-dependencies package

打包
mvn package
mvn clean package

创建
mvn archetype:create -DgroupId=com.adosoft -DartifactId=ado-modules


mvn archetype:create -DgroupId=com.adosoft -DartifactId=ado-core
mvn archetype:create -DgroupId=com.adosoft -DartifactId=ado-flow


mvn archetype:create -DgroupId=com.adosoft -DartifactId=ado-work

mvn archetype:create -DgroupId=com.adosoft -DartifactId=faint-work


mvn archetype:create \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-site \
-DgroupId=com.mycompany.app \
-DartifactId=my-app-site

mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.mochasoft.mgs.hi -DartifactId=uniwork
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.mochasoft.mgs.hi -DartifactId=mochauniwork

mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mochasoft.mgs.hi -DartifactId=uniwork

mvn archetype:create -DarchetypeGroupId=org.springframework.ws -DarchetypeArtifactId=spring-ws-archetype -DarchetypeVersion=1.0.1 -DgroupId=com.mochasoft.hi -DartifactId=uniwork

mvn install:install-file -DgroupId=jdbc -DartifactId=oracle -Dversion=10g -Dpackaging=jar -Dfile=D:/classes12.jar
mvn install:install-file -DgroupId=opensymphony -DartifactId=osworkflow -Dversion=2.8.0 -Dpackaging=jar -Dfile=E:\opensource\workflow\osworkflow-2.8.0\osworkflow-2.8.0.jar


mvn install:install-file -DgroupId=jdbc -DartifactId=oracle -Dversion=10g -Dpackaging=jar -Dfile=D:/ojdbc14.jar

mvn scm:cvs|pserver|dongyl@localhost|C:/Program Files/cvsnt/repositories|module_name

mvn scm:cvs|pserver|dongyl|dongyl@localhost|D:/version/cvsroot/uniwork


mvn plugin:download -Dmaven.repo.remote=http://maven-plugins.sourceforge.net/maven/ -DgroupId=maven-plugins -DartifactId=maven-was6-plugin

//格式化代码
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jalopy-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
</plugin>
mvn jalopy:format


mvn archetype:create -DgroupId=com.mochasoft.portal -DartifactId=portlet -DarchetypeArtifactId=maven-archetype-portlet

pluto
在~/.m2/settings.xml中添加如下内容才可使用以下命令
<settings>
.....
<pluginGroups>
<pluginGroup>org.apache.pluto</pluginGroup>
</pluginGroups>
.....
</settings>

mvn pluto:install -DinstallDir=D:\installed\apache-tomcat-6.0.14

设置tomcat
1.To be able to use application-scoped PortletSession attributes in Pluto, modify the Connector element for port 8080 in <TOMCAT_HOME>/conf/server.xml by adding the following attribute and value: emptySessionPath="true".
2.The Pluto Testsuite portlet application needs the role 'pluto' to run the Security Mapping Test. So before starting tomcat, you should edit <TOMCAT_HOME>/conf/tomcat-users.xml, add the role 'pluto', and add a user in that role. The simplest way to do this is to edit add the 'pluto' role to the 'tomcat' user's record. Here is a sample tomcat-users.xml file:
3.使用http://localhost:8080/pluto/portal tomcat/tomcat


多个项目合作
在父项目pom.xml中添加以下内容:
<modules>
<module>guide-ide-eclipse-site</module>
<module>guide-ide-eclipse-core</module>
<module>guide-ide-eclipse-module1</module>
</modules>
在子项目pom.xml中添加以下内容:
<parent>
<groupId>guide.ide.eclipse</groupId>
<artifactId>guide-ide-eclipse</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Add dependency from module1 to the core-module:
<dependency>
<groupId>guide.ide.eclipse.core</groupId>
<artifactId>guide-ide-eclipse-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

Install the project in your local repository and generate the Eclipse files:
mvn install
mvn eclipse:eclipse
Check in your project using the Eclipse team support (select from the context menu Team > Share Project). Note: Do not check in the generated Eclipse files. If you use CVS you should have a .cvsignore-file with the following entries for each module:
target
.classpath
.project
.wtpmodules
Even the parent project should have this .cvsignore-file. Eclipse will automatically generate a new simple .project-file when you check out the project from the repository.


Add M2_REPO to workspace:
mvn -Declipse.workspace=D:\workspaces\ eclipse:add-maven-repo


mvn -Dmessage="hello" -Dmaven.scm.provider.cvs.implementation=cvs_native scm:checkin


mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.nagor -DartifactId=agor-flow
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值