生成项目
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simpleweb -DartifactId=simple-webapp -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
添加资源 cd src/main
mkdir resources
cd resources
运行1 mvn install -X(option)
mvn exec:java -Dexec.mainClass=com.qucc.Main
查看依赖 mvn dependency:resolve
mvn dependency:tree
测试 mvn test
跳过测试 mvn install -Dmaven.test.skip=true
导出运行jar mvn install assembly:assembly
运行2 java -cp com.qucc.jar.with-dependencies.jar com.qucc.Main
生成web项目 mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.mycompany.app -DartifactId=my-webapp
安装jetty <plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
安装tomcat <plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
运行jetty mvn jetty:run
运行tomcat mvn tomcat7:run
添加servelt mkdir src\main\java\{package}
servelt依赖 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
设置父属性 <parent>
<groupId>org.sonatype.mavenbook.multi</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
</parent>
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
导入自定义LIB到Maven Repository
mvn install:install-file -Dfile=c:\kaptcha-{version}.jar -DgroupId=com.google.code
-DartifactId=kaptcha -Dversion={version} -Dpackaging=jar
<dependency>
<groupId>com.google.code</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3</version>
</dependency>
sakai
tomcat/sakai.properties
tomcat/connector/mysql-connector.jar
添加资源 cd src/main
mkdir resources
cd resources
运行1 mvn install -X(option)
mvn exec:java -Dexec.mainClass=com.qucc.Main
查看依赖 mvn dependency:resolve
mvn dependency:tree
测试 mvn test
跳过测试 mvn install -Dmaven.test.skip=true
导出运行jar mvn install assembly:assembly
运行2 java -cp com.qucc.jar.with-dependencies.jar com.qucc.Main
生成web项目 mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.mycompany.app -DartifactId=my-webapp
安装jetty <plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
安装tomcat <plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
运行jetty mvn jetty:run
运行tomcat mvn tomcat7:run
添加servelt mkdir src\main\java\{package}
servelt依赖 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
设置父属性 <parent>
<groupId>org.sonatype.mavenbook.multi</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
</parent>
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
导入自定义LIB到Maven Repository
mvn install:install-file -Dfile=c:\kaptcha-{version}.jar -DgroupId=com.google.code
-DartifactId=kaptcha -Dversion={version} -Dpackaging=jar
<dependency>
<groupId>com.google.code</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3</version>
</dependency>
sakai
tomcat/sakai.properties
tomcat/connector/mysql-connector.jar