IDEA+MAVEN使用過(guò)程中常見(jiàn)的問(wèn)題

在maven中引入了包,也install成功了,可是代碼還是標(biāo)紅?

在項(xiàng)目上右鍵,maven->reload project 即可

was cached in the local repository, resolution will not be reattempted until the update interval of aliyun-repository has elapsed or updates are forced

到maven rep路徑下,找到相應(yīng)的包,連文件夾一起刪掉即可

maven clean時(shí):Failed to clean project: Failed to delete

使用系統(tǒng)的任務(wù)管理器,查找java.exe,強(qiáng)制關(guān)閉即可

pom文件中resources的作用是什么?

配置mvn install 時(shí),會(huì)把哪些文件拷貝到哪里

在哪里指定web.xml文件

<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webXml>WebRoot/WEB-INF/web.xml</webXml>
<webappDirectory>{project.build.directory}/{project.build.finalName}</webappDirectory>
</configuration>
</plugin>

上述xml中的webappDirectory的作用是什么?

指定war打出來(lái)的WEB-INF/classes放在哪里

如何指定自己的tomcat配置?

1、在項(xiàng)目中新建一個(gè)目錄,寫一個(gè)context.xml文件,把tomcat配置寫進(jìn)去
2、在tomcat7-maven-plugin中配置contextFile,指向context.xml文件
<plugin>

<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<port>80</port>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<contextReloadable>true</contextReloadable>
<contextFile>_tomcat/context.xml</contextFile>
<warSourceDirectory>{project.build.directory}/{project.build.finalName}</warSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>

上述配置中warSourceDirectory的作用是什么?

配置從哪里讀取整個(gè)war包資源或解壓后的war包資源,然后在這個(gè)基礎(chǔ)上啟動(dòng)tomcat容器

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容