How does maven find Java compiler?

前端 未结 4 1106
天涯浪人
天涯浪人 2021-01-06 10:46

I am new to learn maven by following this example given by sonatype\'s book.This is a simplest pom.xml file (works fine). But my question is, how does maven

4条回答
  •  孤独总比滥情好
    2021-01-06 11:45

    If you go to this path, say with maven version 3.2.3

    apache-maven-3.2.3-bin\apache-maven-3.2.3\bin
    

    opne the mvn.bat, you can see below

    @REM Maven2 Start Up Batch script

    @REM Required ENV vars:

    @REM JAVA_HOME - location of a JDK home dir

    Clearly it picks JAVA_HOME, from your environment variables. Below code snippet from the file.

    @REM ==== START VALIDATION ====
    if not "%JAVA_HOME%" == "" goto OkJHome
    :OkJHome
    if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
    :chkMHome
    if not "%M2_HOME%"=="" goto valMHome
    

    for issue, javax.servlet

    
        javax.servlet
        javax.servlet-api
        3.0.1
        provided
    
    

    or whichever available

    
        javax.servlet
        servlet-api
        2.5
        provided
    
    

提交回复
热议问题