本站首页    管理页面    写新日志    退出


«October 2025»
1234
567891011
12131415161718
19202122232425
262728293031


公告

戒除浮躁,读好书,交益友


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:邢红瑞的blog
日志总数:523
评论数量:1142
留言数量:0
访问次数:9718456
建立时间:2004年12月20日




[软件项目管理]idea中使用maven
原创空间,  文章收藏,  软件技术,  电脑与网络

邢红瑞 发表于 2006/9/1 18:41:26

  下载maven 就不说了1 命令行 运行mvn archetype:create -DgroupId=com.tatan -DartifactId=tatan -DpackageName=com.tatan -DarchetypeArtifactId=maven-archetype-webapp 2 补全某些目录 cd test\src mkdir main\java mkdir test\resources mkdir test\java 3 修改src\main\webapp\WEB-INF目录下web.xml 默认生成2.3的头,改为2.4的。 使用idea 打开工程,然后使用run 运行maven install,添加新的jar后,运行mvn idea:idea。pom例子 <dependencies>                <dependency>            <groupId>junit</groupId>            <artifactId>junit</artifactId>            <version>3.8.1</version>            <scope>test</scope>        </dependency>        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring-web</artifactId>            <version>2.5.5</version>        </dependency>        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring-webmvc</artifactId>            <version>2.5.5</version>        </dependency>        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring</artifactId>            <version>2.5.5</version>        </dependency>        <dependency>            <groupId>mysql</groupId>            <artifactId>mysql-connector-java</artifactId>            <version>5.1.6</version>        </dependency>        <dependency>            <groupId>commons-dbcp</groupId>            <artifactId>commons-dbcp</artifactId>            <version>1.2.1</version>            <exclusions>                <exclusion>                    <artifactId>xerces</artifactId>                    <groupId>xerces</groupId>                </exclusion>            </exclusions>        </dependency>             <dependency>        <groupId>javax.servlet</groupId>        <artifactId>servlet-api</artifactId>         <version>2.5</version>            <scope>compile</scope>        </dependency>         <dependency>            <groupId>javax.servlet</groupId>            <artifactId>jstl</artifactId>            <scope>runtime</scope>            <version>1.1.2</version>        </dependency>         <dependency>            <groupId>taglibs</groupId>            <artifactId>standard</artifactId>            <scope>runtime</scope>            <version>1.1.2</version>        </dependency>     </dependencies> <build>        <finalName>tatan</finalName>        <plugins>            <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-compiler-plugin</artifactId>                 <configuration>                    <source>1.5</source>                    <target>1.5</target>                 </configuration>            </plugin>            <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-surefire-plugin</artifactId>                <configuration>                    <testFailureIgnore>true</testFailureIgnore>                </configuration>            </plugin>            <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-surefire-plugin</artifactId>                <configuration>                    <skip>true</skip>                </configuration>            </plugin>            <plugin>                <groupId>org.mortbay.jetty</groupId>                <artifactId>maven-jetty-plugin</artifactId>                <configuration>                    <scanIntervalSeconds>10</scanIntervalSeconds>                    <connectors>                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">                            <port>8080</port>                            <maxIdleTime>60000</maxIdleTime>                        </connector>                    </connectors>                </configuration>            </plugin>        </plugins>    </build>  点击刷新的图标,IDEA project的dispendency自动就改了,原先设置被覆盖了


阅读全文(2915) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.063 second(s), page refreshed 144789144 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号