如何将.m2 Maven存储库提交到SVN

时间:2017-11-20 14:20:05

标签: java maven jenkins svn selenium-webdriver

我是Maven的新手,并将Selenium testng套件与Maven和Jenkins以及SVn作为存储库集成。但是当我在Jenkins中触发目标时,我的误差低于此值。

" [错误]插件org.apache.maven.plugins:maven-clean-plugin:2.5或其中一个依赖项无法解析:无法读取org.apache.maven.plugins的工件描述符: maven-clean-plugin:jar:2.5:无法传输工件org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from / to central(http://repo.maven.apache.org/maven2):网络无法访问 - > [帮助1] [错误] [错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。 [ERROR]使用-X开关重新运行Maven以启用完整的调试日志记录。 [错误] [错误]有关错误和可能解决方案的更多信息,请阅读以下文章: [错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException "

下面是我的Maven pom.xml结构

<properties>
    <suiteXmlFile>webtest.xml</suiteXmlFile>
    <skipTests>false</skipTests>
</properties>

<dependencies>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.8.7</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.28.0</version>
        </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>21.0</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <compilerVersion>1.8</compilerVersion>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.15</version>
            <configuration>
                <forkMode>never</forkMode>
                <suiteXmlFiles>
                    <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>
    </plugins>
</build>
</project>

我不确定是否必须将.m2文件提交给SVN?或者我应该如何在SVN存储库和Jenkins中配置? My jenkins和SVN存储库都是On Server。

1 个答案:

答案 0 :(得分:0)

您似乎拥有Internet连接的代理设置。代理阻止直接访问目标计算机中的mvn存储库。你必须配置。 settings.xml中的代理服务器(位于.m2目录的根目录下)。通常,artifactory将工件作为代理mvn repo。请咨询IT团队/开发团队以获取必要的设置。