使用 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
相關文章
相關標籤/搜索