0

src/main/java要包含我定义的非 java (txt) 文件

<resources>
    <resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.txt</include>
        </includes>
    </resource>
</resources>

pom.xml并且运行良好。但是定义更具体的目录路径,例如

<resources>
    <resource>
        <directory>src/main/java/com/oppballi/kanake</directory>
        <includes>
            <include>**/*.txt</include>
        </includes>
    </resource>
</resources>

不是。这是设计使然还是我遗漏了什么?

4

2 回答 2

1

你可以看看target/classes内容。

由于您将其定义为资源根,因此可能会出现src/main/java/com/oppballi/kanake诸如 txt 文件src/main/java/com/oppballi/kanake/core/readme.txttarget/classes/core/readme.txt

于 2013-06-21T22:05:36.167 回答
0

将其更改为,可能没有更多的子目录可以查看

<resources>
    <resource>
        <directory>src/main/java/com/oppballi/kanake</directory>
        <includes>
            <include>*.txt</include>
        </includes>
    </resource>
</resources>
于 2013-06-21T22:02:48.597 回答