convert java projects to Maven

Asked

Viewed 60 times

1

I have some java projects and would like to convert them pro Maven.

  • Is there any command maven for conversion of existing java projects?
  • If I just add the pom.xml it will become a Maven project?

I thought about those two cases because I don’t have the eclipse and I’d like to put that process in a pipeline.

  • 1

    I never stopped to test this, but I just tested it here in Netbeans 12, got two HTML projects and another Javascript added Pom.xml to them the IDE recognized as Maven projects.

1 answer

1

Don’t just add the pom.xml. The project must at least follow the directory structure:

- pom.xml
- src
  |-- main
  |   |-- java
  |   |   |-- App.java
  |   |-- resources
  |       |-- file.csv
  |-- test
      |-- java
      |   |-- AppTest.java
      |-- resources
          |-- testfile.csv

There are, of course, other possibilities of organizing additional directories and configuration files, but this is the minimum for it to run as a Maven project.

As to whether there is any command maven do, I don’t know.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.