[精讚] [會員登入]
411

回應

修正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

你可能感興趣的文章

更新程式環境到wildfly18+openjdk11-phase3: 伺服器環境升級準備 upgrade jdk and wildfly on server

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

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

回應 修正pom.xml,

新增縣市端回傳使用者資料功能 新增縣市端回傳使用者資料功能

縣市端新增syncdata spi功能 為了讓部裡主機可以透過OAUTH2流程,呼叫縣市同步SYNCDATA 的API

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

[NetBeans]如何從git下載專案改建為自己的專案 修改git專案

縣市IDP更換SSL憑證及修改servername+wildfly等設定 縣市IDP更換SSL

bitbucket repository control application setup 安裝完bitbucket服務後,須設定bitbucket.properties

縣市IDP新增API功能 修改IDP程式增加API介面

在debian9使用apt-key add gpg key from ubuntu keyserver