Sara
Sara

Reputation: 2505

Maven goal running from eclipse

When I run mvn compile from command line, it builds using pom.xml. But when I try to run it within Eclipse (by using m2eclipse plugin), when I right click on the pom.xml and run as maven build, it asks for a goal. I am new to Maven and want to run it through Eclipse. So why doesn't it ask for anything when running from command line? Is there a default goal?

Upvotes: 13

Views: 73825

Answers (1)

Dave Newton
Dave Newton

Reputation: 160170

Yes, there is a default goal, but what it is depends on the project, and can be explicitly defined.

See the BaseBuild Element Set (the default goal is install) as well as the rest of that page for further information. IIRC you can define a default goal for m2eclipse, although I haven't used it in some time.

There's also a setting to define a goal to be run when a source directory is updated:

http://www.sonatype.com/books/m2eclipse-book/reference/preferences.html

Upvotes: 10

Related Questions