首页 文章

Maven tomcat6插件将资源/属性文件复制到自定义路径

提问于
浏览
1

我've a tricky configuration, I' ve属性文件当前在我的webapps文件夹中我想从我的webapps文件夹中复制这些配置说 c:\kp\conf${catalina.home}/conf .

我可以通过在 catalina.properties 文件中附加属性 common.loader 将上述位置添加为类路径来实现此配置 .

现在真正的问题 .

我正在使用tomcat6插件将我的war / applications部署/重新部署到tomcat 6服务器 . 如何配置我的tomcat6插件将资源复制到上述位置?我不想手动复制它 .

我检查了maven copy-resources插件,它会将资源复制到本地机器,如果你正在运行maven构建而不是服务器位置

有人可以建议我如何使用tomcat6插件或任何替代插件,它将部署时复制到该位置?

1 回答

  • 0

    总有瑞士军刀exec-maven-plugin . 假设您有一个shell脚本为您复制,您可以向POM添加这样的内容:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <phase>deploy</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <executable>bash</executable>
            <arguments>
                <argument>${basedir}/scripts/copy-your-files.sh</argument>
            </arguments>
        </configuration>
    </plugin>
    

    干杯,

相关问题