You probably want to use a plugin. For instance you could use the DocBook plugin.
http://maven-plugins.sourceforge.net/maven-sdocbook-plugin/index.html Once you have this plugin you can simply run the command: mvn sdocbook You will also want to get a better understanding of Maven's build lifecycle and undertand how lifecycles, phases and goals are related. It is more complex than ant targets but is also far more powerful. http://books.sonatype.com/maven-book/reference/lifecycle.html Ultimately, you will want to hide the fact that your particular project is using DocBook by binding these goals to a certain phase of the build lifecycle. ie: you will never have to run the "mvn sdocbook" command explicitly (although you still could if you needed to). What part of the lifecycle will be up to you but creating PDFs would likely best be sutied to the site lifecycle. Good luck. --- Todd Thiessen > -----Original Message----- > From: Trevor Harmon [mailto:tre...@vocaro.com] > Sent: Tuesday, December 16, 2008 10:28 AM > To: Maven Users List > Subject: Are Maven profiles like Ant targets? > > I'm coming from the Ant world, where targets are fundamental. > Need to generate the JavaDocs and a JAR? Write targets called > "javadoc" and "jar" then do: > > ant javadoc > ant jar > > In Maven, these particular tasks have built-in plugins, so > there's no need to write a target. Instead you just invoke > the plugin goal: > > mvn javadoc:javadoc > mvn jar:jar > > But there are many scenarios in which no plugin is available. > For instance, I use install4j to build an installer, and I > use DocBook to translate XML into PDF. Accomplishing these > tasks with the AntRun plugin is easy enough, but it's not > clear how to actually invoke them. > The Ant concept of a target does not exist in Maven. > > Maven does have profiles, however. I'm able to put the > install4j stuff into a profile called "install4j" and the > DocBook stuff into a profile called "docbook". Then I can do: > > mvn -Pinstall4j > mvn -Pdocbook > > This works, but from an end-user standpoint it's a little confusing. > For some things you invoke a plugin goal but for other things > you invoke a profile. It's inconsistent. Also, the Build > Profiles chapter of the Maven book mentions nothing about > this use case. It only talks about profiles for the purpose > of build portability. > > So... am I doing this right? Are profiles intended to play > the role of Ant targets? Or is there some other mechanism for that? > > Trevor > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org