2017-02-22 3 views
0

JenkinsでMaven(クリーン検証コンパイル)でいくつかの目標を持ってジョブを作成しました。 しかし、私は実行すると、ジョブはエラーがあります。マニュアル依存MavenとJenkins

[ERROR] Failed to execute goal on project NameProject: Could not resolve dependencies for project NameProject:x:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc14:jar:10.2.0.5, org.primefaces.themes:sentinel-theme:jar:2.1.2: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.5 in central (https://repo.maven.apache.org/maven2) -> [Help 1] 
 
[ERROR] 
 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
 
[ERROR] 
 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

私はMavenの

mvn install:install-file 
 
    -Dfile=<path-to-file> 
 
    -DgroupId=<group-id> 
 
    -DartifactId=<artifact-id> 
 
    -Dversion=<version> 
 
    -Dpackaging=<packaging> 
 
    -DgeneratePom=true

を手動で依存関係を作成しましたが、ジェンキンスは」doesnのpomのこの依存関係を知っている。 Mavenでverifyコンパイルを実行すると動作します!しかし、Jenkinsで実行すると動作しません。

+0

Jenkinsサーバーにインストールしましたか? –

+0

Jenkinsをテストするためにlocalhostにインストールしました!同じローカルMaven。 – Halley

+0

同じユーザーですか、別ですか? –

答えて

0

ローカルリポジトリにインストールする場合は、それをJenkinsサーバーで使用されるローカルリポジトリにインストールする必要があります。 Jenkinsサーバーでmvn installを開始する必要があります。

企業のNexusサーバをお持ちの場合は、そこにインストールする方がいいでしょう。

0

私はデフォルトのローカルリポジトリをhave changed Mavenの

<localRepository>C:/Users/nameUser/.m2/repository</localRepository>

私のMavenのdiretoryは別のドライブ(E:/)にあった(C :)でたときにリポジトリ。