хорошо вот ответ.

у скопировать файл ресурса из src / main / resources вCargo Tomcat в / target / tomcat6x / container / webapps используяMaven.

Я пытался с помощьюmaven-resources-plugin но у меня нет никакого успеха.

Я попробовал это:

<plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.0.5</version>
            <configuration>
                <wait>false</wait>
                <container>
                    <containerId>tomcat6x</containerId>
                    <zipUrlInstaller>
                        <url>
                            http://mirrors.enquira.co.uk/apache/tomcat/tomcat-6/v6.0.30/bin/apache-tomcat-6.0.30.zip
                        </url>
                        <installDir>${installDir}</installDir>
                    </zipUrlInstaller>
                    <output>
                        ${project.build.directory}/tomcat6x.log
                    </output>
                    <log>${project.build.directory}/cargo.log</log>
                </container>
                <configuration>
                    <files>
                        <copy>
                          <file>src/main/resources/datasource.properties</file>
                          <!--tofile>${project.build.directory}/tomcat6x/container/webapps/datasource.properties</tofile-->
                          <todir>${project.build.directory}/tomcat6x/container/webapps</todir>
                        </copy>
                    </files>
                    <home>
                        ${project.build.directory}/tomcat6x/container
                    </home>
                    <properties>
                        <cargo.logging>high</cargo.logging>
                        <cargo.servlet.port>8081</cargo.servlet.port>
                    </properties>
                </configuration>
            </configuration>


            <executions>
                <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>configure</goal>
                        <goal>start</goal>
                        <goal>deploy</goal>
                    </goals>
                    <configuration>
                        <deployer>
                            <deployables>
                                <deployable>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <type>war</type>
                                    <pingURL>http://localhost:8081/charmweb-0.0.1-SNAPSHOT/</pingURL>
                                    <pingTimeout>180000</pingTimeout> 
                                    <properties>
                                        <context>charmweb-0.0.1-SNAPSHOT</context>
                                    </properties>
                                </deployable>
                            </deployables>
                        </deployer>
                    </configuration>
                </execution>

                <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

... но файл не копируется до запуска сервера, и приложение проверяется.

Кто-нибудь знает, как правильно его использовать?

Ответы на вопрос(2)

Ваш ответ на вопрос