简体   繁体   English

我在哪里放置 pom.xml 文件?

[英]Where do I place the pom.xml file?

I have been going throughthis tutorial and got maven installed, created my environment variables, created a new android project but i do not know where to place the pom.xml file?我一直在阅读本教程并安装了 maven,创建了我的环境变量,创建了一个新的 android 项目,但我不知道将 pom.xml 文件放在哪里?

also, how do I run my maven build so a new.apk file is created?另外,如何运行我的 maven 构建以创建一个新的 .apk 文件?

Maven commands that execute on a POM need to be executed in the current working directory of your project. 在POM上执行的Maven命令需要在项目的当前工作目录中执行。 Say your project is in c:\\myproject . 假设您的项目在c:\\myproject That means your pom file would be located at c:\\myproject\\pom.xml . 这意味着您的pom文件将位于c:\\myproject\\pom.xml When you run a maven command in the command line you need to set your current working directory to c:\\myproject . 在命令行中运行maven命令时,需要将当前工作目录设置为c:\\myproject

In windows if you hold down shift then right click on the open folder, you will see an additional menu item called Open command window here . 在Windows中,如果您按住shift然后右键单击打开的文件夹,则会Open command window here看到一个名为“ Open command window here的附加菜单项。

Alternatively you can always open your command window and type in cd <path to your project> . 或者,您始终可以打开命令窗口,然后输入cd <path to your project>

Once there type in your maven commands such as mvn3 clean install 在那里输入maven命令,例如mvn3 clean install

Heres a screenshot of the drop down for windows 以下是Windows下拉菜单的屏幕截图 在此处输入图片说明

You should use the defaul project layout: 您应该使用默认项目布局:

http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

The pom.xml is placed in the projects root-folder. pom.xml放在项目的根文件夹中。

This occurred due to change of a project name, and the old project name of a module keep showing in a bracket beside the new project name.这是由于更改项目名称而发生的,并且模块的旧项目名称一直显示在新项目名称旁边的括号中。 if you want to remove the old name in the bracket[.如果你想删除括号中的旧名称[。 . . . . .], go to your projects settings.gradle file or use short cut Ctrl+Shift+F to get the file. .], go 到你的项目 settings.gradle 文件或使用快捷键 Ctrl+Shift+F 来获取文件。 You will see old module project name.您将看到旧模块项目名称。

  • include ':app'包括':应用程序'

  • rootProject.name = "the old project name of a module" rootProject.name = "模块的旧项目名称"

In rootProject.name="...." Renamed it with your new project name and synced the project, then the root module name will be updated and the old module project name in the bracket will be gone.在 rootProject.name="..." 中用你的新项目名称重命名并同步项目,然后根模块名称将更新,括号中的旧模块项目名称将消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM