How to run a Maven project from Eclipse?

前端 未结 3 1527
眼角桃花
眼角桃花 2020-12-25 11:41

I am trying to run a simple Java project. I had created a project using the \'Maven Project\' type. I have one main class called \'TestMain\'. When I tried to run the projec

3条回答
  •  攒了一身酷
    2020-12-25 12:10

    Your Maven project doesn't seem to be configured as a Eclipse Java project, that is the Java nature is missing (the little 'J' in the project icon).

    To enable this, the element in your pom.xml should be jar (or similar).

    Then, right-click the project and select Maven > Update Project Configuration

    For this to work, you need to have m2eclipse installed. But since you had the _ New ... > New Maven Project_ wizard, I assume you have m2eclipse installed.

提交回复
热议问题