問題異常:
Build errors for ems; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project ems: Could not resolve dependencies for project com.ether:ems:war:2.20.091-SNAPSHOT:
The following artifacts could not be resolved:
com.oracle:ojdbc14:jar:10.2.0.1.0,
com.microsoft.sqlserver:sqljdbc:jar:1.0,
ET299jni:et299:jar:1.0:
Failure to find com.oracle:ojdbc14:jar:10.2.0.1.0 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
原因:
由於maven中央倉庫沒有第三方包(ojdbc14:jar、sqljdbc:jar、et299:jar)所以報錯,可在本地私服倉庫安裝這三個包。
解決:
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=1.0 -Dpackaging=jar -Dfile=E:\項目\20130609\ems\WebContent\WEB-INF\lib\ojdbc14.jar
mvn install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc -Dversion=1.0 -Dpackaging=jar -Dfile=E:\項目\20130609\ems\WebContent\WEB-INF\lib\sqljdbc.jar
mvn install:install-file -DgroupId=ET299jni -DartifactId=et299 -Dversion=1.0 -Dpackaging=jar -Dfile=E:\項目\20130609\ems\WebContent\WEB-INF\lib\ET299jni.jar
對應pom.xml文件描述
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>ET299jni</groupId>
<artifactId>et299</artifactId>
<version>1.0</version>
</dependency>