使用 OSC Maven 第三方仓库

若是您在使用 OSC Maven 时是否遇到了这个问题:maven

[ERROR] Failed to execute goal on project ...: Could not resolve dependencies for project ...: The following artifacts could not be resolved: com.smart:smart-framework:jar:1.0, ...: Failure to find com.smart:smart-framework:jar:1.0 in http://maven.oschina.net/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of osc has elapsed or updates are forced -> [Help 1]

或许本文会帮您解决这个问题。url

据了解,目前 OSC Maven 已经将全部第三方 jar 包放到了独立的仓库中,该仓库的地址以下:spa

http://maven.oschina.net/content/repositories/thirdparty/ .net

为了防止与中央仓库同步时致使冲突,目前 thirdparty 仓库与 public 仓库没有任何交集了,也就是说它们是彻底独立的,public 再也不包括 thirdparty。xml

因此须要在本身的 setting.xml 中作以下配置(注意绿色文字): ci

配置 mirror

<mirrors>
...
        <mirror>
            <id>osc</id>
            <mirrorOf>central</mirrorOf>
            <url>http://maven.oschina.net/content/groups/public/</url>
        </mirror>
        <mirror>
            <id>osc_thirdparty</id>
            <mirrorOf>thirdparty</mirrorOf>
            <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
        </mirror>
...
</mirrors> get

配置 profile

<profiles>
...
        <profile>
            <id>osc</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>osc</id>
                    <url>http://maven.oschina.net/content/groups/public/</url>
                </repository>
                <repository>
                    <id>osc_thirdparty</id>
                    <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>osc</id>
                    <url>http://maven.oschina.net/content/groups/public/</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
...
</profiles> 同步

欢迎使用 OSC Maven 仓库: maven.oschina.net
相关文章
相关标签/搜索