cap_jack_sp 2019-02-25 16:47 采纳率: 0%
浏览 605

springmvc项目,pom修改配置文件报错?

在maven的setting文件中配置了profile:

<profile>  
            <id>dev</id>  
            <properties>  
                <jdbc.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.driver>
                <jdbc.url>jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=test</jdbc.url>
                <jdbc.username>admin</jdbc.username>
                <jdbc.password>admin123</jdbc.password>
            </properties>  
            <activation>  
                <activeByDefault>true</activeByDefault>  
            </activation>  
        </profile>

在pom的build节点下配置resources,用来将setting中的配置内容动态更新到项目中:

<resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </resource>
    </resources>

在mybatis的配置文件中${}使用
图片说明

发现启动报错:

[2019-02-25 04:40:45,069] Artifact ssm:war exploded: Artifact is being deployed, please wait...
25-Feb-2019 16:40:46.745 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2019-02-25 16:40:47 [INFO]-[org.springframework.web.servlet.DispatcherServlet] FrameworkServlet 'SpringMVC': initialization started
2019-02-25 16:40:47 [INFO]-[org.springframework.web.context.support.XmlWebApplicationContext] Refreshing WebApplicationContext for namespace 'SpringMVC-servlet': startup date [Mon Feb 25 16:40:47 CST 2019]; root of context hierarchy
2019-02-25 16:40:47 [INFO]-[org.springframework.web.servlet.DispatcherServlet] FrameworkServlet 'SpringMVC': initialization completed in 138 ms
[2019-02-25 04:40:47,225] Artifact ssm:war exploded: Artifact is deployed successfully
[2019-02-25 04:40:47,225] Artifact ssm:war exploded: Deploy took 2,156 milliseconds
2019-02-25 16:40:47 [WARN]-[org.springframework.web.servlet.PageNotFound] No mapping found for HTTP request with URI [/swagger/index.html] in DispatcherServlet with name 'SpringMVC'
2019-02-25 16:40:48 [WARN]-[org.springframework.web.servlet.PageNotFound] No mapping found for HTTP request with URI [/v2/api-docs.do] in DispatcherServlet with name 'SpringMVC'

删除pom的resource配置,启动正常,求解!
该怎么配置?

  • 写回答

1条回答 默认 最新

  • 毕小宝 博客专家认证 2019-02-25 20:22
    关注

    应该还是语法的问题,建议再研究下pom中resource的配置过程。
    参考:https://blog.csdn.net/u011781521/article/details/79052725

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划