• maven笔记


    一、构建项目
    mvn archetype:create -DgroupId=com.maven.test -DartifactId=helloMaven -DpackageName=com.maven.test -DarchetypeArtifactId=maven-archetype-webapp -Dversion=1.0
    groupId //项目包名
    artifactId //项目名称
    archetype //是一个内建插件,他的create任务将建立项目骨架
    archetypeArtifactId //项目骨架的类型
    创建Maven项目:mvn archetype:create
    编译源代码:mvn compile
    编译测试代码:mvn test-compile
    运行测试:mvn test
    产生site:mvn site
    打包:mvn package
    在本地Repository中安装jar:mvn install
    清除产生的项目:mvn clean
    二、编译项目-生成eclipse的项目结构
    编译项目代码//建成我们eclipse可以导入的项目
    mvn clean compile
    Clean 告诉maven清理输入出目录target/,compile告诉maven编译项目主代码
    mvn eclipse:eclipse
    参考信息:http://www.cnblogs.com/fnng/archive/2011/12/02/2272610.html
    三、导入Eclipse
    配置maven仓库路径
    Window----Perferences-----java-----Build Path-----Classpath Variables
    四、包的更新与下载
    打开项目发现我们junit 是3.8.1的,有点老了。那我想换成4.7的,如何通过maven的方式更换呢。其实,很简单,打开我们项目下的的pom.xml文件。
    ……
    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.8.1</version>
    <scope>test</scope>
    </dependency>
    </dependencies>
    ……
    更改变,junit的版本号,然后重新执行:mvn eclipse:eclipse

  • 相关阅读:
    微信小程序登录(包括获取不到unionid的情况)
    ionic生成签名的APK方法总结
    iframe的简单使用方法
    常见的浏览器端的存储技术:cookie
    AJAX 过程总结
    react相关知识总结2
    正则表达式相关知识点
    vue相关知识汇总
    react相关知识汇总
    Vue-Router核心实现原理
  • 原文地址:https://www.cnblogs.com/guaishushu/p/4126096.html
Copyright © 2020-2023  润新知