Showing posts with label maven. Show all posts
Showing posts with label maven. Show all posts

Friday, November 3, 2017

Maven: install sqljdbc

在用Maven build時遇到了無法分析sqljdbc的問題,錯誤信息大致如下︰
Failed to collect dependencies at com.microsoft.sqlserver:sqljdbc4:jar:4.0: Failed to read artifact descriptor for com.micrsoft.sqlserver:sqljdbc4:jar

師兄建議參照解決方案︰

  • 在項目右鍵︰Run As -> Run Configurations
  • 新增一個新的Maven build
  • Goals內填『install:install-file』
  • 然後切換到JRE填參數,注意的是JDK1.7選sqljdbc41.jar,JDK1.8選sqljdbc42.jar
  • -Dfile=sqljdbc41.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
  • 然後Build就可以了

Tuesday, October 31, 2017

Maven: cql3-scala

第二次遇到這個問題了,記錄一下解決方案。
在Maven build時遇到了︰
Failure to find org.cql3-scala:cql3-scala:jar:0.8.2-SNAPSHOT in http://repository.primefaces.org was cached in the local repository

原來是項目需要用cql3-scala,所以要先下載才可以成功build。

到github下載相關項目︰https://github.com/masayoshi-louis/cql3-scala
然後到eclipse打開剛剛下載的cql3-scala

對項目右鍵->run as...->Maven install
這樣就會安裝到eclipse中。

然後在原本的項目中就可以成功地build了。

Eclipse: Maven build

在Maven build的時候已經試過出現幾次以下錯誤信息︰
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

其實只要按以下幾個步驟進行就可以重設JDK的位置︰
  • Go to Window -> Preferences -> Java -> installed JREs 
  • Select the JDK you are using (C:\Program Files\Java\jdk1.6.xx) 
  • Press Edit to see the list of jars including tools.jar, OW you can add it as Add External JAR