I have a portlet project which runs using build.xml. I want to shift to maven-based build management.
How can I map build.xml to pom.xml?
How can I write a goal for every target in build.xml?
Is it a good idea to use maven maven-antrun-plugin-1.6 for running ant tasks from pom.xml or not?
How can I put jars from the build path to repository?
A POM does not relate to a build. xml file, just as much as Maven does not relate to Ant. However, if you integrate Ivy into your Ant environment you can convert the POM to an ivy. xml file with the convertpom task.
You simply can't because Maven has a build life-cycle
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.
It's not a good idea to use maven-antrun-plugin (only in very very very very rare cases).
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.).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With