顯示具有 Maven 標籤的文章。 顯示所有文章
顯示具有 Maven 標籤的文章。 顯示所有文章

2023/11/09

整合 GitLab Private Repository with Jenkins and Nexus Repository

如果還不知道如何使用Webhook可以先至『GitLab 透過 Webhook 連動 Jenkins』查看
目標:代碼提交時,透過Jenkins自動處理上傳的代碼並發布到Maven Repository
 記得要先在Maven Project的pom.xml加入<distributionManagement>和maven-compiler-plugin,下方是示範的pom.xml


2019/04/24

使用Artifactory建立 Maven Repository on Cent OS 7

執行結果:



# Install Artifactory
wget https://excellmedia.dl.sourceforge.net/project/artifactory/artifactory/3.9.2/artifactory-3.9.2.rpm
yum install -y artifactory-3.9.2.rpm

# Install network tools
yum install -y net-tools

# Start Artifactory
service artifactory start

瀏覽:http://localhost:8081


參考資料:
https://fenriswolf.me/2012/04/04/%E5%BB%BA%E7%AB%8B-maven-repository/

2019/03/06

Java XML to JSON

要取得XML Tag / Content / 和 Attribute是不難
但有套件當然用套件解決了XDD
套件為org.json
我是透過Mavem安裝org.json的

<?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>cy.com</groupId>
    <artifactId>Test</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>LATEST</version>
        </dependency>
    </dependencies>
</project>


XML參考自w3cSchools


<breakfast_menu>
    <food>
        <name>Belgian Waffles</name>
        <price>$5.95</price>
        <description>
            Two of our famous Belgian Waffles with plenty of real maple syrup
        </description>
        <calories>650</calories>
    </food>
    <food>
        <name>Strawberry Belgian Waffles</name>
        <price>$7.95</price>
        <description>
            Light Belgian waffles covered with strawberries and whipped cream
        </description>
        <calories>900</calories>
    </food>
    <food>
        <name>Berry-Berry Belgian Waffles</name>
        <price>$8.95</price>
        <description>
            Belgian waffles covered with assorted fresh berries and whipped cream
        </description>
        <calories>900</calories>
    </food>
    <food>
        <name>French Toast</name>
        <price>$4.50</price>
        <description>
            Thick slices made from our homemade sourdough bread
        </description>
        <calories>600</calories>
    </food>
    <food>
        <name>Homestyle Breakfast</name>
        <price>$6.95</price>
        <description>
            Two eggs, bacon or sausage, toast, and our ever-popular hash browns
        </description>
        <calories>950</calories>
    </food>
</breakfast_menu>