NutzCN Logo
问答 resource中文件丢失
发布于 2415天前 作者 qq_1d84c364 1250 次浏览 复制 上一个帖子 下一个帖子
标签:

请问一下我项目a(对应了一个jar,对应war的项目测试过了没问题)的src/main/resource下有个配置文件,eclipse的自动编译功能会把src/main/resource先的文件生成到workpace的target的class中,可是用maven的clean package打包,target的class中却找不到
下面是我新项目的pom.xml,什么都未引入

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>easysoft</groupId>
    <artifactId>easysoft</artifactId>
    <version>1.0.0</version>
  </parent>
  <groupId>easysoft-test</groupId>
  <artifactId>easysoft-test</artifactId>
  <name>easysoft-test</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

2 回复

正确的路径应该叫 src/main/resources ,你的路径少了个s

嗯,确实是的,谢谢!这个论坛真是个好东西,什么都可以问

添加回复
请先登陆
回到顶部