开发者

Using m2eclipse for multiple projects with parent pom.xml

I have mult开发者_运维百科iple maven projects with their individual pom.xml's an a parent pom.xml.

my_workspace
├── application-project
│   ├── pom.xml
│   └── src
│       ├── main
│           └── ...
│       └── test
│           └── ...
├── common-project
│   ├── pom.xml
│   └── src
│       ├── main
│           └── ...
│       └── test
│           └── ...
└── pom.xml

Now, from Eclipse, I can right click on common-project or application-project, I see Run As Maven... options there. But when I need to run a specific goal for all the projects, i.e. which is in the parent pom.xml, I don't understand how to go about it, if not using command line?


I guess you have appropriate plug-in, if not already having, install m2eclipse plugin first

Run > Run Configuration > Maven Build

Double click[*], choose the project, put down the goals, put down profile if any.

Fron next time use this (will be available in drop down) to execute your own goals.

[*] The form that opens here has all the capability to construct a maven command that you can run from command line. You might need to play around a bit to get what you actually wanted.


Updated as question was modified:

OK, so your parent project is your workspace folder. worry not.

Run > Run Configuration > Maven Build

Double click, browse filesystem and select the workspace folder, put down the goals, put down profile if any. I have just tested it. It works.


Yet another way, as OP found out, that you can click variables... button beneath the text-field for Base Directory and choose workspace_loc to point to your workspace directory as the base directory for Maven build.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜