1

I am new to maven and I am porting a java project to a maven project . I installed the maven plugin and set up the environment . the steps I followed are

1) Used the inbuild convert to maven option in eclipse 2) updated my POM with all the repo info and dependency info

when I try and run my maven project it asks me to enter my goal . I read on SO that I am supposed to enter package . I am not sure what this all means , a lot of googling later I am still not able to understand what this really means . Is this converting my project to a jar ??

4

2 回答 2

1

是的,这应该将所有已编译的类文件以及src/main/resources文件夹中的任何内容放入一个 jar 中。<build>一旦你开始在你的 pom 部分配置其他插件,那么package可能会有不同的行为并产生其他东西,比如 ejb、war 或 ear。

您应该查看Build Lifecycles上的 maven 页面

此外,正如 Jesper 所说,这不是一个真正适合提出这么简单问题的地方。

于 2013-08-15T20:40:23.467 回答
0

默认生命周期具有以下构建阶段(有关构建阶段的完整列表,请参阅生命周期参考):

  • 验证- 验证项目是否正确并且所有必要的信息都可用
  • compile - 编译项目的源代码
  • 测试- 使用合适的单元测试框架测试编译的源代码。这些测试不应该要求打包或部署代码
  • package - 获取编译后的代码并将其打包成可分发的格式,例如 JAR。
  • 集成测试- 如有必要,将包处理并部署到可以运行集成测试的环境中
  • 验证- 运行任何检查以验证包是否有效并符合质量标准
  • install - 将包安装到本地存储库中,作为本地其他项目的依赖项
  • 部署- 在集成或发布环境中完成,将最终包复制到远程存储库以与其他开发人员和项目共享。
于 2013-08-15T20:43:37.980 回答