【发布时间】:2012-06-04 23:19:53
【问题描述】:
我正在尝试使用 Maven 插件测试工具为依赖于 Aether 的 Maven 3 插件编写单元测试。在执行我的测试时,虽然 RepositorySystemSession 为空,经过大量搜索后,我无法弄清楚如何将会话注入单元测试插件工具。
我正在使用 Maven 3.0.3 核心 API、Maven 插件测试工具 2.0 和 Aether 1.12。我尝试了其他各种组合,但似乎在某处缺少关键组件。
可以在此处找到示例的代码库:http://www.sonatype.com/people/2011/01/how-to-use-aether-in-maven-plugins/。
插件工具的文档可以在这里找到:http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/getting-started/index.html。
我的示例代码可以在这里看到:
关于如何将 RepositorySystemSession 注入容器以进行单元测试的任何想法?
TIA, 斯科特 ES
【问题讨论】:
标签: maven maven-plugin maven-3 sonatype