[精讚] [會員登入]
482

回應

修正pom.xml,

分享此文連結 //n.sfs.tw/11603

分享連結 回應@外行中的外行
(文章歡迎轉載,務必尊重版權註明連結來源)
2018-10-26 12:01:16 最後編修
2017-08-11 19:04:10 By jung
 

1. before you start to download dependencies for maven project, you should add settings.xml to your username's ".m2"folder, in order to download private packages
according to: http://www.codedata.com.tw/java/understanding-gradle-2-maven/
透過『宣告』相依性的方法在替專案增加相依函式庫,將專案原始碼與函式庫分開處理,方便了版本控制系統的使用。編譯成果會被放在 target 目錄下,除了 target 目錄的內容,其他都是需要進版本控制系統的『資料』。而函式庫會由 Maven 透過 repostiory server 下載,並 cache 在使用者目錄下的 /.m2 目錄

written those texts into your "settings.xml",and save to your user home directory's ".m2" folder

########################以下為新增內容#################

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd";;;;;;; xmlns="http://maven.apache.org/SETTINGS/1.1.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <servers>
   <server>
     <username>attention!!must insert your own user name on JFrog Artifactory</username>
     <password>and your own password here!!</password>
     <id>oidcrs-release</id>
   </server>
 </servers>
 <!--
 <profiles>
   <profile>
     <repositories>
       <repository>
         <snapshots>
           <enabled>false</enabled>
         </snapshots>
         <id>central</id>
         <name>libs-release</name>
         <url>https://oidcrs.tanet.edu.tw/artifactory/libs-release</url>
       </repository>
     </repositories>
     <id>artifactory</id>
   </profile>
 </profiles>
 <activeProfiles>
   <activeProfile>artifactory</activeProfile>
 </activeProfiles>
 -->
</settings>

###########################################################################

then restart your netbeans.

 

2. maven java application project's pom.xml revised as followng:

如 "http://n.sfs.tw/content/index/11551
提到的,在新增maven專案後,到該專案的pom.xml修改如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">;;;;;;;
    <modelVersion>4.0.0</modelVersion>
    <groupId>rest</groupId>
    <artifactId>IDP001</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
###以下為新增的部分#####################   

<dependencies>
        <dependency>
            <groupId>tc.edu</groupId>
            <artifactId>cnclibs</artifactId>
            <version>0.0.1</version>
        </dependency>
</dependencies>
<repositories>
    <repository>
        <id>oidcrs-release</id>
        <url>https://oidcrs.tanet.edu.tw/artifactory/libs-release</url>
    </repository>
</repositories>

#####以上是新增的部分##################

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>    
</project>

============================================================

then, after you saved pom.xml in netbeans, you can right click on your netbeans project name, and choose to reload POM,

after doing that, right click on your project's dependencies folder, choose to "download declared dependencies"

 

3. doing the same thing from here五、建立Other Source

END

你可能感興趣的文章

solution for selinux issue while installing zabbix agent on centos7 install zabbix agent as service will raise selinux issue on some centos 7.3.1611

更新程式環境到wildfly18+openjdk11-phase2: update IDEA to jdk11 更新IDEA 編譯環境

系統不正常關機導致mongodb啟動失敗 重新安裝mongodb使用mongorestore

在apache http server停用TLS 1.0/1.1 and SSL 2.0/3.0 How to disable outdated versions of SSL/TLS on Apache

更新程式取消google recaptcha改用輸入驗證碼 update cnclibs to 0.0.8.6

縣市端IdP新增自訂首頁內容功能 合併本部主程式,手動於mongo內新增管理使用者資料

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

[java]縣市IDP建置 使用NetBeans建置IDP程式

安裝netbeans9遇到的小狀況 how to show netbeans9 program onto ubuntu desktop

在windows環境下強制刪除無法以檔案總管刪除的檔案或目錄 how to remove directories or files that cannot be deleted by default file manager

如何在ubuntu 18.04上設定一開機就啟動virtualbox某個vm a way to setup ubuntu18.04 for start vm on boot

更新程式環境到wildfly18+openjdk11-phase1: upgrade mongodb server 更新程式環境到wildfly18+openjdk11-phase1: upgrade mongodb server to version 3.6