<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] # 示例 > ## 基礎 POM.xml 1. dependencies:依賴標簽,用于聲明項目的依賴jar包,這也是Maven的核心功能之一。 2. plugins:插件標簽,用于配置各種構建插件,擴展Maven的功能。 3. build:構建標簽,控制項目構建策略,比如編譯版本、資源過濾、輸出目錄、插件執行順序等。 4. profiles: profiles標簽,定義不同環境(dev/test/prod)的構建profile,可以切換不同的依賴配置。 5. repositories:倉庫標簽,定義第三方jar包倉庫,擴展 jar 包來源。 6. parent:繼承父POM,實現項目重復配置的抽取與繼承。 7. properties:屬性標簽,定義Maven常用變量,擴展POM的靈活性。 8. dependencyManagement:依賴管理標簽,管理jar包版本,實現版本統一管理。 9. modules:模塊標簽,定義項目的子模塊結構,實現模塊依賴與繼承。 10. scm:源碼管理標簽,定義項目的源碼存放地址。方便開發人員獲取最新源碼。 ``` <?xml version="1.0" encoding="UTF-8"?> <!-- POM文件的根元素,用于定義項目的基本信息和依賴關系 --> <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"> <!-- POM模型版本號 --> <modelVersion>4.0.0</modelVersion> <!-- 項目的組ID --> <groupId>com.example</groupId> <!-- 項目的唯一標識符 --> <artifactId>example-project</artifactId> <!-- 項目的版本號 --> <version>1.0.0-SNAPSHOT</version> <!-- 項目的打包方式,默認為jar --> <packaging>jar</packaging> <!-- 項目的名稱 --> <name>Example Project</name> <!-- 項目的描述信息 --> <description>This is an example project for demonstration purposes.</description> <!-- 項目的主頁地址 --> <url>https://www.example.com</url> <!-- 項目的許可證信息 --> <licenses> <license> <name>Apache License 2.0</name> <url>https://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <!-- 項目的開發者信息 --> <developers> <developer> <id>johndoe</id> <name>John Doe</name> <email>johndoe@example.com</email> <organization>Example Organization</organization> <organizationUrl>https://www.example.com</organizationUrl> <roles> <role>developer</role> </roles> </developer> </developers> <!-- 項目的依賴關系 --> <dependencies> <!-- 項目的依賴項 --> <dependency> <!-- 依賴項的組ID --> <groupId>com.example</groupId> <!-- 依賴項的唯一標識符 --> <artifactId>example-library</artifactId> <!-- 依賴項的版本號 --> <version>1.0.0</version> <!-- 依賴項的作用范圍 --> <scope>compile</scope> <!-- 是否為可選依賴 --> <optional>false</optional> <!-- 排除依賴項 --> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <!-- 項目的倉庫信息 --> <repositories> <!-- Maven倉庫的地址和協議信息 --> <repository> <!-- 倉庫的唯一標識符 --> <id>central</id> <!-- 倉庫的URL地址 --> <url>https://repo.maven.apache.org/maven2/</url> </repository> </repositories> <!-- 項目的構建信息 --> <build> <!-- 源代碼目錄 --> <sourceDirectory>src/main/java</sourceDirectory> <!-- 最終構建產物的名稱 --> <finalName>example-project</finalName> <!-- 項目的插件信息 --> <plugins> <!-- 項目的插件 --> <plugin> <!-- 插件的唯一標識符 --> <groupId>org.apache.maven.plugins</groupId> <!-- 插件的唯一標識符(續) --> <artifactId>maven-compiler-plugin</artifactId> <!-- 插件的版本號 --> <version>3.8.1</version> <!-- 插件的執行配置信息 --> <executions> <!-- 插件的執行配置 --> <execution> <!-- 配置項的激活條件 --> <id>default-compile</id> <!-- 插件的目標 --> <goals> <goal>compile</goal> </goals> </execution> </executions> <!-- 插件的配置信息 --> <configuration> <!-- 插件的配置項 --> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project> ``` > ## 項目構建 build ``` <!-- 項目的構建信息 --> <build> <!-- 源代碼目錄 --> <sourceDirectory>src/main/java</sourceDirectory> <!-- 最終構建產物的名稱 --> <finalName>example-project</finalName> <!-- 項目的插件信息 --> <plugins> <!-- 項目的插件 --> <plugin> <!-- 插件的唯一標識符 --> <groupId>org.apache.maven.plugins</groupId> <!-- 插件的唯一標識符(續) --> <artifactId>maven-compiler-plugin</artifactId> <!-- 插件的版本號 --> <version>3.8.1</version> <!-- 插件的執行配置信息 --> <executions> <!-- 插件的執行配置 --> <execution> <!-- 配置項的激活條件 --> <id>default-compile</id> <!-- 插件的目標 --> <goals> <goal>compile</goal> </goals> </execution> </executions> <!-- 插件的配置信息 --> <configuration> <!-- 插件的配置項 --> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> ``` > ## 項目倉庫信息 repositories ``` <!-- 項目的倉庫信息 --> <repositories> <!-- Maven倉庫的地址和協議信息 --> <repository> <!-- 倉庫的唯一標識符 --> <id>central</id> <!-- 倉庫的URL地址 --> <url>https://repo.maven.apache.org/maven2/</url> </repository> </repositories> ``` > ## 項目依賴信息 ``` <!-- 項目的依賴關系 --> <dependencies> <!-- 項目的依賴項 --> <dependency> <!-- 依賴項的組ID --> <groupId>com.example</groupId> <!-- 依賴項的唯一標識符 --> <artifactId>example-library</artifactId> <!-- 依賴項的版本號 --> <version>1.0.0</version> <!-- 依賴項的作用范圍 --> <scope>compile</scope> <!-- 是否為可選依賴 --> <optional>false</optional> <!-- 排除依賴項 --> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> </exclusions> </dependency> </dependencies> ``` > ## 項目開發者信息 ``` <!-- 項目的開發者信息 --> <developers> <developer> <id>johndoe</id> <name>John Doe</name> <email>johndoe@example.com</email> <organization>Example Organization</organization> <organizationUrl>https://www.example.com</organizationUrl> <roles> <role>developer</role> </roles> </developer> </developers> ``` >## PIG 項目 pom.xml 示例 ``` <?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright (c) 2020 pig4cloud Authors. All Rights Reserved. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" 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>com.pig4cloud</groupId> <artifactId>pig</artifactId> <name>${project.artifactId}</name> <!-- name標簽定義項目顯示名稱,一般引用${project.artifactId}變量 --> <version>3.6.5</version> <packaging>pom</packaging> <!-- packaging標簽定義項目的打包方式,可選jar、war、pom等 --> <url>https://www.pig4cloud.com</url> <!-- properties標簽定義項目屬性,常用于定義版本號等 --> <properties> <spring-boot.version>2.7.7</spring-boot.version> <spring-cloud.version>2021.0.5</spring-cloud.version> <spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <spring-boot-admin.version>2.7.9</spring-boot-admin.version> <spring.authorization.version>0.4.0</spring.authorization.version> <dynamic-ds.version>3.6.0</dynamic-ds.version> <captcha.version>2.2.2</captcha.version> <velocity.version>2.3</velocity.version> <velocity.tool.version>3.1</velocity.tool.version> <configuration.version>1.10</configuration.version> <jasypt.version>2.1.0</jasypt.version> <swagger.fox.version>3.0.0</swagger.fox.version> <knife4j.ui.version>3.0.3</knife4j.ui.version> <xxl-job.version>2.3.1</xxl-job.version> <docker.plugin.version>0.32.0</docker.plugin.version> <docker.host>http://192.168.0.100:2375</docker.host> <docker.registry>192.168.0.100</docker.registry> <docker.namespace>pig4cloud</docker.namespace> <docker.username>username</docker.username> <docker.password>password</docker.password> <git.commit.plugin>4.9.9</git.commit.plugin> <spring.checkstyle.plugin>0.0.35</spring.checkstyle.plugin> </properties> <!-- dependencies標簽定義項目的依賴 --> <!-- 以下依賴 全局所有的模塊都會引入 --> <dependencies> <!--配置文件處理器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> <!--配置文件加解密--> <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <version>${jasypt.version}</version> </dependency> <!--監控--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <!--監控客戶端--> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>${spring-boot-admin.version}</version> </dependency> <!--Lombok--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> <!--測試依賴--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <!-- modules標簽定義項目的子模塊 --> <modules> <module>pig-register</module> <module>pig-gateway</module> <module>pig-auth</module> <module>pig-upms</module> <module>pig-common</module> <module>pig-visual</module> <module>xudemo</module> </modules> <!-- dependencyManagement標簽定義依賴管理,用于控制jar包的版本 --> <dependencyManagement> <dependencies> <!--pig 公共版本定義--> <dependency> <groupId>com.pig4cloud</groupId> <artifactId>pig-common-bom</artifactId> <version>${project.version}</version> <type>pom</type> <scope>import</scope> </dependency> <!-- spring boot 依賴 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> <!-- spring cloud 依賴 --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> <!-- spring cloud alibaba 依賴 --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>${spring-cloud-alibaba.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <!-- build標簽定義項目的構建設置,比如編譯版本、輸出目錄、插件配置等 --> <build> <finalName>${project.name}</finalName> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <pluginManagement> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> <configuration> <finalName>${project.build.finalName}</finalName> <layers> <enabled>true</enabled> </layers> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>${docker.plugin.version}</version> <configuration> <!-- Docker Remote Api--> <dockerHost>${docker.host}</dockerHost> <!-- Docker 鏡像私服--> <registry>${docker.registry}</registry> <!-- 認證信息--> <authConfig> <push> <username>${docker.username}</username> <password>${docker.password}</password> </push> </authConfig> <images> <image> <!-- 鏡像名稱: 172.17.0.111/library/pig-gateway:2.6.3--> <name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name> <build> <dockerFile>${project.basedir}/Dockerfile</dockerFile> </build> </image> </images> </configuration> </plugin> </plugins> </pluginManagement> <plugins> <!--打包jar 與git commit 關聯插件--> <plugin> <groupId>io.github.git-commit-id</groupId> <artifactId>git-commit-id-maven-plugin</artifactId> <version>${git.commit.plugin}</version> <executions> <execution> <id>get-the-git-infos</id> <goals> <goal>revision</goal> </goals> <phase>initialize</phase> </execution> </executions> <configuration> <failOnNoGitDirectory>false</failOnNoGitDirectory> <generateGitPropertiesFile>true</generateGitPropertiesFile> <!--因為項目定制了jackson的日期時間序列化/反序列化格式,因此這里要進行配置,不然通過management.info.git.mode=full進行完整git信息監控時會存在問題--> <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat> <includeOnlyProperties> <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty> <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty> </includeOnlyProperties> </configuration> </plugin> <!-- 代碼格式插件,默認使用spring 規則,可運行命令進行項目格式化:./mvnw spring-javaformat:apply 或 mvn spring-javaformat:apply,可在IDEA中安裝插件以下插件進行自動格式化: https://repo1.maven.org/maven2/io/spring/javaformat/spring-javaformat-intellij-idea-plugin --> <plugin> <groupId>io.spring.javaformat</groupId> <artifactId>spring-javaformat-maven-plugin</artifactId> <version>${spring.checkstyle.plugin}</version> <executions> <execution> <phase>validate</phase> <inherited>true</inherited> <goals> <goal>validate</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <!-- profiles標簽定義環境切換profiles,可以根據不同環境進行依賴調整等設置 --> <profiles> <profile> <id>dev</id> <properties> <!-- 環境標識,需要與配置文件的名稱相對應 --> <profiles.active>dev</profiles.active> </properties> <activation> <!-- 默認環境 --> <activeByDefault>true</activeByDefault> </activation> </profile> </profiles> </project> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看