7
votes

I have a portlet project which runs using build.xml. I want to shift to maven-based build management.

  1. How can I map build.xml to pom.xml?

  2. How can I write a goal for every target in build.xml?

  3. Is it a good idea to use maven maven-antrun-plugin-1.6 for running ant tasks from pom.xml or not?

  4. How can I put jars from the build path to repository?

1

1 Answers

4
votes
  1. You simply can't because Maven has a build life-cycle

  2. You have to understand that Maven has a build life-cycle and that is your plan. You must forget the Ant Targets.

    The lifecycle has for example test-compile (compile the unit tests) and compile (compiling your production code. And further steps are running the unit tests and finally packaging your production code into a jar file.

  3. It's not a good idea to use maven-antrun-plugin (only in very very very very rare cases).

  4. Via mvn release:prepare release:perform or via mvn deploy (for SNAPSHOTs)

I recommend reading Books about Maven in particular Maven by Example and Maven: The Complete Reference

If you are working for a company you should think hard about setting up a repository manager (for example Nexus or Archiva etc.).