出错总结

  1. maven 错误,配置项 setting中 mirror错误
    • mirror 缺失,没有配对
    • mirror配置需要在mirrors内,mirrors缺失
  2. spring mvc的xml配置,解析不到java包。

    • 文件结构不符合maven结构

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      - main
      - src
      - java
      - resources
      - webapp
      -WEB-INF
      - test
      - java
      - resources
      - pom.xml
      - *.iml
    • 那就不是java包,要在java下一定要新建为packge,而不是file,新建file最后改为sources Root也不行的
      参考 stackoverflow

      1
      I have found the solution. "main.tr.source" is not a package but directory. When I create "new package" instead of "new directory" It works. But I still don't know what is the difference between them. Thanks for your help by the way. – hellzone Oct 20 '13 at 12:19
  3. 最后页面的${msg}还是没出来,为什么呢?

    • 渣渣maven生成的web.xml不正确,需要修改为以下:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5"
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <servlet>
      <servlet-name>let'sGo</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>let'sGo</servlet-name>
      <url-pattern>/</url-pattern>
      </servlet-mapping>
      </web-app>

      参考明将军的博客

  4. maven遗留一个错误,待解决?

    1
    Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

    这个问题其实不用解决,如果有兴致解决也是可以的

    • 不必采用 maven deploy
      参考 stackoverflow
    • pom中添加以下:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      <distributionManagement>
      <repository>
      <id>nexus</id>
      <name>releases</name>
      <url>http://mvn2.qdingnet.com/nexus/content/repositories/releases</url>
      <uniqueVersion>true</uniqueVersion>
      </repository>
      <snapshotRepository>
      <id>nexus</id>
      <name>snapshots</name>
      <url>http://mvn2.qdingnet.com/nexus/content/repositories/snapshots</url>
      </snapshotRepository>
      </distributionManagement>

      参考我叫张凯的博客