Let's start by looking at a normal compilation process:
1. Check out a project from SVN;
2. See if the project is a MAVEN project, not a MAVEN project: Right-click the project and select Configure->convert to Maven
3. Compile the project with Maven: Right-click on the project and select Run As->maven install
The above process is done, MAVEN packaging success, then congratulations, you have checked out the project can be released, the code has been compiled. However, the problem I encountered is that the implementation of Maven install is not a problem, the compilation action is also executed, to the output directory target\classes also has the compiled class file, but under Eclipse is not compiled Java files, Java icon is hollow. Repeated tossing for a long time, can not solve the problem. For example: Right-click the project, select Properties->project Facets, select Java, you can right-click on the project Select Build Path, and then configure the dependent jar, but cannot load maven Dependencies, compile is OK , but all red forks and Red forks.
Finally analyzed, I checked out from SVN is a project package called services, which in addition to with the Pom.xml file, is 3 directories, and these 3 directories is actually 3 projects, they also have their own pom.xml, the structure is as follows:
Services
| ———— ms-a
| ———— ms-b
| ———— ms-c
I ran directly under the service of the pom.xml, it has such a configuration:
<Modules> <Module>Ms-a</Module> <Module>Ms-b</Module> <Module>Ms-c</Module></Modules>
Right-click the Services project, select Run As->maven install, compile ms-a, Ms-b, and ms-c, and then output their compiled packages, but the Java files in eclipse are still not compiled. I checked out the ms-a in the normal process, the Java file icon is solid. Of course the other two is also the same, as you want to ask me why in the services compiled can not, then I can only tell you, I do not know now. Have to know the students please advise, thank you.
MAVEN Compilation issue: Maven compilation succeeded, eclipse file not compiled