6

我正在尝试从我的项目所在的目录中复制一个文件并将其移动到一个临时的“dist”目录,直到它可以复制到其最终位置。pom 似乎知道项目所在的位置,但它不喜欢我没有指定目录的事实,当我指定目录时,它说它无法找到。

就复制而言,这是有效的:

<id>copy-resources-rdeska</id>
<phase>site</phase>
<goals>
    <goal>copy-resources</goal>
</goals>
<configuration>
    <overwrite>true</overwrite>
    <outputDirectory>${dist.dir}/rdesk</outputDirectory>
    <resources>
        <resource>
            <directory>/rdesk</directory>
            <filtering>false</filtering>
            <includes>
                <include>**/*</include>
            </includes>
            <excludes>
                <exclude>**/*.svn</exclude>
                <exclude>**/webapp/*</exclude>
                <exclude>/contact_ejb_default/</exclude> 
            </excludes>
        </resource>
    </resources>
</configuration>

这是众多之一,但麻烦的是这样的:

<id>copy-resources-deploy</id>
<phase>site</phase>
<goals>
    <goal>copy-resources</goal>
</goals>
<configuration>
    <overwrite>true</overwrite>
    <outputDirectory>${dist.dir}/deploy</outputDirectory>
    <resources>
        <resource>
            <directory></directory>
            <filtering>false</filtering>
            <includes>
                <include>deploy.xml</include>
            </includes>
        </resource>
    </resources>
</configuration>

最大的区别是我试图复制一个文件,但无论哪种方式都找不到当前目录。

4

1 回答 1

1

I don't think you can leave the <directory> element empty in a resource element. If the deploy.xml file is in the project directory, try

<directory>${basedir}</directory>
于 2013-06-27T21:20:05.023 回答