maven创建helloword项目
[root@666 maven_work]# mvn archetype:create -DgroupId=helloword -DartifactId=helloworld
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.493 s
[INFO] Finished at: 2017-11-27T14:46:23+08:00
[INFO] Final Memory: 7M/145M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.1 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException
以create报错
[root@666 maven_work]# mvn archetype:create -DgroupId=helloword -DartifactId[root@666 maven_work]# mvn archetype:generate -DgroupId=helloword -DartifactId=helloworld
成功!!
生成以下文件:
# tree helloworld/
helloworld/
|-- pom.xml
`-- src
|-- main
| `-- java
| `-- helloword
| `-- App.java
`-- test
`-- java
`-- helloword
`-- AppTest.java 7 directories, 3 files
进到项目中,然后进行:
# cd helloworld/
[root@666 helloworld]# ls
pom.xml src
[root@666 helloworld]# mvn package
第一次编译的话,需要联网,因为Maven会自动下载依赖包.成功后会生成:target文件夹
[root@666 helloworld]# ls
pom.xml src target [root@666 helloworld]# tree target/
target/
|-- classes
| `-- helloword
| `-- App.class
|-- helloworld-1.0v.jar
|-- maven-archiver
| `-- pom.properties
|-- maven-status
| `-- maven-compiler-plugin
| |-- compile
| | `-- default-compile
| | |-- createdFiles.lst
| | `-- inputFiles.lst
| `-- testCompile
| `-- default-testCompile
| |-- createdFiles.lst
| `-- inputFiles.lst
|-- surefire-reports
| |-- helloword.AppTest.txt
| `-- TEST-helloword.AppTest.xml
`-- test-classes
`-- helloword
`-- AppTest.class 12 directories, 10 files
手动运行jar包查看结果
# java -cp target/helloworld-1.0v.jar helloword.App
Hello World!
这里列举几个常用的命令
maven创建helloword项目的更多相关文章
- Eclipse+Maven创建webapp项目<一>(转)
还在为jar下载而烦恼吗?还在为jar依赖关系而烦恼吗?还在为jar冲突而烦恼吗?强大的maven项目管理工具来拯救你们呢?自动下载jar,自动下载jar依赖包.你什么都不用做,只需要在中央仓库中co ...
- 【maven】maven创建web项目-pom文件提示web.xml is missing and <failOnMissingWebXml> is set to true
使用maven创建web项目,选择war类型后,pom文件红叉 提示web.xml is missing and <failOnMissingWebXml> is set to true ...
- Eclipse+Maven创建webapp项目
Eclipse+Maven创建webapp项目<一> 1.开启eclipse,右键new-->other,如下图找到maven project 2.选择maven project,显 ...
- Eclipse+Maven创建webapp项目<一>
Eclipse+Maven创建webapp项目<一> 1.开启eclipse,右键new——>other,如下图找到maven project 2.选择maven project,显 ...
- Maven创建servlet项目演示(三)
上一节用Maven新建了web项目成功后,本文演示在此基础上应用servlet. 从对tomcat服务器进行配置可的过程中可以知道,tomcat作为servlet容器运行,负责处理客户请求,把请求传送 ...
- Eclipse+Maven创建webapp项目<一><二><三>
转-http://www.cnblogs.com/candle806/p/3439469.html Eclipse+Maven创建webapp项目<一> 1.开启eclipse,右键new ...
- Eclipse使用Maven创建Web项目
一.Maven插件下载.jdk下载 1.maven下载地址: http://maven.apache.org/download.cgi 2.jdk下载地址: http://www.oracle.com ...
- Eclipse+Maven创建webapp项目<二> (转)
Eclipse+Maven创建webapp项目<二> 1.开启eclipse,右键new——>other,如下图找到maven project 2.选择maven project,显 ...
- Eclipse+Maven创建webapp项目<一> (转)
Eclipse+Maven创建webapp项目<一> 1.开启eclipse,右键new——>other,如下图找到maven project 2.选择maven project,显 ...
随机推荐
- RFC2616-HTTP1.1-Header Field Definitions(头字段规定部分—单词注释版)
part of Hypertext Transfer Protocol -- HTTP/1.1RFC 2616 Fielding, et al. 14 Header Field Definitions ...
- Alpha(2/10)
鐵鍋燉腯鱻 项目:小鱼记账 团队成员 项目燃尽图 冲刺情况描述 站立式会议照片 各成员情况 团队成员 学号 姓名 git地址 博客地址 031602240 许郁杨 (组长) https://githu ...
- css3组件之几何图形
一.平行四边形 1.实心无边框 #parallelogram { width: 150px; height: 100px; -webkit-transform: skew(20deg); -moz-t ...
- NEO学习笔记,从WIF到地址
2018开年,先给大家拜个年,Happy Neo Year. 开年总得写点什么,就打算继续开学习笔记系列,一点一点仔细的去分析NEO. 今天说一说从WIF到地址的这一串关系. 简单说就一张图: 或 ...
- Java实现FTP与SFTP文件上传下载
添加依赖Jsch-0.1.54.jar <!-- https://mvnrepository.com/artifact/com.jcraft/jsch --> <dependency ...
- git rewinding head to replay your work on top of it...
git fetch origin git reset --hard origin/<branch>
- [CF49E]Common ancestor
[CF49E]Common ancestor 题目大意: 有两个由小写字母构成的字符串\(S\)和\(T(|S|,|T|\le50)\).另有\(n(n\le50)\)个形如\(a\to bc\)的信 ...
- Mac下重新编译Linux内核
Mac下重新编译Linux内核 操作系统实验,要求添加系统调用并重新编译内核,这里记录一下编译内核的过程 0.下载VirtualBox 博主一直用parallel desk,但因为驱动等问题,在PD上 ...
- 一步步完成Maven+SpringMVC+SpringFox+Swagger整合示例
本文给出一个整合Maven+SpringMVC+SpringFOX+Swagger的示例,并且一步步给出完成步骤. 本人在做实例时发现 http://blog.csdn.net/zth1002/art ...
- 在Ubuntu1404的64bit版本下安装caffe
原创文章,未经允许不要转载 想安装很久了,一直到这时才开始安装,我是笔记本华硕FL5800L的,所以配置比较低.在win7 64位里面先装个vmware 12 pro,然后装了个Ubuntu140 ...