我正在使用Maven 3.0.3。对于我们的项目,我们在集成测试阶段启动Selenium服务器,以便运行测试。我们有一个自定义的用户扩展文件,我们集成如下……
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<logOutput>true</logOutput>
<userExtensions>${project.basedir}/src/test/resources/selenium/user-extensions.js</userExtensions>
</configuration>
</execution>
</executions>
</plugin>此文件存在于git存储库中,我更喜欢从git存储库中下载最新版本的文件,而不是将其复制到我们的项目中,然后在新版本的文件出现时手动更新所有项目。但是,我不知道如何获取该文件的最新版本并将其包含在Maven的插件中。有什么想法吗?
发布于 2011-07-25 22:09:05
使用maven-scm-plugin
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>Foo</id>
<goals>
<goal>export</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<connectionUrl>scm:git:...</connectionUrl>
<exportDirectory>${project.build.directory}</exportDirectory>
</configuration>
</execution>
</executions>
</plugin>发布于 2011-07-25 22:09:48
maven解决此问题的方法是构建一个单独的模块,在生成的工件(例如jar或zip文件)中包含此文件,并将其部署到您的maven存储库。
然后,您可以使用maven依赖项插件从maven存储库中检索它,将其解压缩到您的目标文件夹,并在您的selenium插件调用中引用它。
https://stackoverflow.com/questions/6817197
复制相似问题