It's not a secret anymore!
The moose likes Ant, Maven and Other Build Tools and the fly likes Build a java application using Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Build a java application using Maven" Watch "Build a java application using Maven" New topic

Build a java application using Maven

Cow Yeung

Joined: Oct 07, 2008
Posts: 16

I am building a software that need to use Maven for project management. The software can export a library out. Therefore, I need to use some project management library. If there is some libraries or plug-in of Maven that I can call function in java application instead of using command in DOS mode to build a project?

SCJP 5 72%
OCEJPA 6 86%
OCEEJB 6 91%
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

"Eric OX" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.

|Asking Good Questions|
Edwin Stephens

Joined: Dec 30, 2008
Posts: 15

I think the "Maven 2 Exec Plugin" offers the capabilities that you are looking for. In summary, "The plugin provides 2 goals to make execution of system and Java programs."

The plugin's two goals are:
exec::exec - execute programs and Java programs in a separate process
exec::java - execute Java programs in the same VM

The project's homepage and documentation can be found at:

The plugin exists in the central maven repository. Links to the versions of the plugin in the central repo (including dependency information) can be found here:

Hope that helps,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

This isn't quite clear. Maven has its own project management library. It's one of the core features (and major advantages) of Maven.

If you're just developing a Jar that you want to go into a repository and be usable as a dependency by other Maven project(s), use the goal "mvn install". It will do the build and check a copy of the JAR and POM info into your local Maven repository.

An IDE is no substitute for an Intelligent Developer.
Cow Yeung

Joined: Oct 07, 2008
Posts: 16

Maybe it is not so clear that what do I want.

I mean the Application software can generate some folder and some files after clicking a button in the application. The file generating process is as same as Maven. However, Maven is using command on command mode and my application is using some code to control the generation process. Or, maybe I would like to find a java library that using code instead of the command.

I agree. Here's the link:
subject: Build a java application using Maven
It's not a secret anymore!