1. 程式人生 > 其它 >SpringMVC專案中maven編譯後target中沒有generated-sources檔案

SpringMVC專案中maven編譯後target中沒有generated-sources檔案


解決思路:

  1. 重新匯入lib包 -- 沒有解決
  2. 重新clean Maven 重新建立pom.xml -沒有解決
  3. 重新建立tomcat - 沒有解決

問題出在此modul中.iml檔案上

原因是:之前建立modul的時候發現modul的專案名字拼寫錯誤之後進行refactor-rename導致.iml中多了些配置項

# 錯誤的檔案

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="web" name="Web">
      <configuration>
        <descriptors>
          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
        </descriptors>
        <webroots>
          <root url="file://$MODULE_DIR$/web" relative="/" />
        </webroots>
        <sourceRoots>
          <root url="file://$MODULE_DIR$/src/main/java" />
          <root url="file://$MODULE_DIR$/src/main/resources" />
        </sourceRoots>
      </configuration>
    </facet>
  </component>
  <-- 以下都是錯誤新增的內容-->
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$" />
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>
# 正確的配置項


<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="web" name="Web">
      <configuration>
        <descriptors>
          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
        </descriptors>
        <webroots>
          <root url="file://$MODULE_DIR$/web" relative="/" />
        </webroots>
        <sourceRoots>
          <root url="file://$MODULE_DIR$/src/main/java" />
          <root url="file://$MODULE_DIR$/src/main/resources" />
        </sourceRoots>
      </configuration>
    </facet>
  </component>
</module>
我從小到大沒有什麼夢想,一直在路上不問遠方,只是衷心希望自己成為一個很厲害的人。你問我什麼算厲害,大概就是能有朝一日,保護好我愛的人,贍養好家人。