How to convert build.xml file to maven pom?

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

  • How to match build.xml with pom.xml?

  • How can I write a goal for each goal in the build.xml file?

  • Is it possible to use maven maven-antrun-plugin-1.6 to run ant tasks from pom.xml or not?

  • How can I put jars from the build path into the repository?

+6
source share
1 answer
  • You just can't, because Maven has a life cycle build

  • You must understand that Maven has a life cycle to build , and this is your plan. You must forget Ant targets.

    The life cycle has, for example, test compilation (compilation of unit tests) and compilation (compilation of your production code). Further steps are performed by unit tests and finally pack your production code into a jar file.

  • Using maven-antrun-plugin is not recommended (only in very very very rare cases).

  • Via mvn release: prepare release: run or via mvn deploy (for SNAPSHOT)

I recommend reading Maven Books, in particular Maven, as an example and Maven: The Complete Reference

If you work in a company, you should consider setting up a storage manager (for example, Nexus or Archiva, etc.).

+4
source

Source: https://habr.com/ru/post/894698/


All Articles