Java – Maven: no source compilation

I'm following "building Java projects with Maven"( https://spring.io/guides/gs/maven/#scratch ), when I run 'MVN compile' from / users / Misha / desktop / SRC / main / Java / Hello, I get this prompt:

[INFO] Scanning for projects...   
[INFO]                                                                                  
[INFO] ------------------------------------------------------------------------   
[INFO] Building gs-maven 0.1.0    
[INFO] ------------------------------------------------------------------------   
[INFO]    
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gs-maven ---   
[INFO] Using 'UTF-8' encoding to copy filtered resources.   
[INFO] Copying 3 resources   
[INFO]    
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ gs-maven ---   
[INFO] No sources to compile   
[INFO] ------------------------------------------------------------------------   
[INFO] BUILD SUCCESS     
[INFO] ------------------------------------------------------------------------    
[INFO] Total time: 0.942 s    
[INFO] Finished at: 2015-01-11T23:10:28-08:00   
[INFO] Final Memory: 7M/155M
[INFO] ------------------------------------------------------------------------

I have two java files and XML files in the Hello directory. I assume I should see "Hello world!" Instead of no source compilation Why can't my java code compile? thank you!

Solution

To create a maven project you need

>Contains POM Project directory of XML file > under this project directory, a subdirectory Src / main / Java containing your Java code (package to the subdirectory Src / main / Java)

Call Maven to run MVN compilation or similar project directory

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>