1. 程式人生 > >使用Maven來管理專案-pom.xml詳細解讀(三)

使用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>

    <parent> <!-- 指定該pom的父級pom  -->
        <groupId>org.codehaus.mojo</groupId> <!-- 父級pom組織id -->
        <artifactId>my-parent</artifactId>  <!-- 父級pom標識 -->
        <version>2.0</version>  <!-- 父級pom版本 -->
        <relativePath>../my-parent</relativePath>   <!-- 父級pom位置 -->
    </parent>

    <groupId>com.yourcompany.app</groupId>  <!-- 當前專案的組織id -->
    <artifactId>app</artifactId>  <!-- 當前maven專案的唯一標識-->
    <version>1.0-SNAPSHOT</version>  <!-- 當前maven專案版本號 -->
    <packaging>pom</packaging>   <!-- 當前maven專案package 命令打包型別 eg.war、jar...-->
    <!-- 專案有多個模組時使用,解決專案之間的依賴關係。eg:web專案->框架專案 前臺專案 後臺專案... -->
    <modules>
        <module>webFrame</module>     <!-- 模組的名稱 -->
    </modules>

    <dependencies>              <!-- 管理專案依賴的jar包 -->
        <dependency>
            <groupId>junit</groupId>    <!-- 依賴的jar包組織名稱 -->
            <artifactId>junit</artifactId>  <!-- 依賴的jar包名稱-->
            <version>4.0</version>  <!-- 依賴的jar包版本號,寫法:
            1.0: "Soft" requirement on 1.0 (just a recommendation, if it matches all other ranges for the dependency)
            [1.0]: "Hard" requirement on 1.0
            (,1.0]: x <= 1.0
            [1.2,1.3]: 1.2 <= x <= 1.3
            [1.0,2.0): 1.0 <= x < 2.0
            [1.5,): x >= 1.5
            (,1.0],[1.2,): x <= 1.0 or x >= 1.2; multiple sets are comma-separated
            (,1.1),(1.1,): this excludes 1.1 (for example if it is known not to work in combination with this library)
            -->
            <type>jar</type> <!-- 依賴的jar包型別-->
            <scope>test</scope>  <!-- 依賴包使用區域 有:
            compile -> this is the default scope, used if none is specified. Compile dependencies are available in all classpaths. Furthermore, those dependencies are propagated to dependent projects.
            provided - this is much like compile, but indicates you expect the JDK or a container to provide it at runtime. It is only available on the compilation and test classpath, and is not transitive.
            runtime - this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.
            test - this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.
            system - this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.
            特別指明是system區域,管理本地的jar包,同時需要新增systemPath屬性來指明依賴包的位置-->
            <!--<systemPath>.../WEB-INF/lib/xxxxxx.jar</systemPath>-->
            <optional>true</optional>
            <exclusions>       <!-- 當依賴的這個包同時也依賴了其他包時,用來指明依賴該包所依賴的某一個包,不依賴該包所依賴的所有包使用*來匹配 -->
                <exclusion>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>maven-core</artifactId>
                </exclusion>
                <!-- 依賴的jar包型別-->
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-embedder</artifactId>
            <version>3.1.0</version>
            <exclusions>
                <exclusion>   <!-- 不依賴該包(org.apache.maven<)所依賴的所有包使 -->
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <dependencyManagement>    <!-- 通常在父級pom中新增這個元素,用來管理一下共用的依賴,使得繼承該pom的子pom使用,子pom中是需要指定groupId 和 artifactId,版本號會自動被補全 -->
        <dependencies>
            <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant</artifactId>
                <version>1.8.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!--
    properties->pom中的元素就一個pom的屬性,pom的頂級屬性就是project,屬性的訪問格式:${屬性名稱},
    env.X: (訪問當前系統環境變數)Prefixing a variable with "env." will return the shell's environment variable. For example, ${env.PATH} contains the PATH environment variable.
Note: While environment variables themselves are case-insensitive on Windows, lookup of properties is case-sensitive. In other words, while the Windows shell returns the same value for %PATH% and %Path%, Maven distinguishes between ${env.PATH} and ${env.Path}. As of Maven 2.1.0, the names of environment variables are normalized to all upper-case for the sake of reliability.
    project.x:(訪問pom中的屬性<pom的元素>) A dot (.) notated path in the POM will contain the corresponding element's value. For example: <project><version>1.0</version></project> is accessible via ${project.version}.
    settings.x: (訪問配置檔案中的屬性)A dot (.) notated path in the settings.xml will contain the corresponding element's value. For example: <settings><offline>false</offline></settings> is accessible via ${settings.offline}.
Java System Properties: All properties accessible via java.lang.System.getProperties() are available as POM properties, such as ${java.home}.
    x: (訪問使用properties定義的變數)Set within a <properties /> element in the POM. The value of <properties><someVar>value</someVar></properies> may be used as ${someVar}.
    -->
    <properties>   <!-- 用來定義屬性 eg:定義了一個變數名為varName 值為varValue的屬性 訪問:${varName} -->
        <varName>varValue</varName>
    </properties>

    <!--
    repositories是一些附加在Maven倉庫目錄顯示的製品的集合,要想成為Maven倉庫的製品,pom檔案不需是$BASE_REPO/groupId/artifactId/version/artifactId-version.pom. $BASE_REPO結構
    repositories就是收集和儲存成品的地方。
    -->
    <repositories>
        <repository>   <!-- repository是Maven社群最有力的特性,預設的Maven倉庫中心是 http://repo.maven.apache.org/maven2/. -->
            <id>central</id>    <!-- 編譯配置 -->
            <name>Central Repository</name>    <!-- 編譯配置 -->
            <url>http://repo.maven.apache.org/maven2</url>    <!-- 編譯配置 -->
            <layout>default</layout>    <!-- 編譯配置 -->
            <snapshots>    <!-- 編譯配置 -->
                <enabled>false</enabled>    <!-- 編譯配置 -->
            </snapshots>
        </repository>
        <repository>
            <releases>
                <enabled>false</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
            <id>codehausSnapshots</id>
            <name>Codehaus Snapshots</name>
            <url>http://snapshots.maven.codehaus.org/maven2</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <distributionManagement>        <!-- 成品釋出管理 -->

    </distributionManagement>
    <pluginRepositories>    <!-- 編譯配置 -->
        <pluginRepository>    <!-- 編譯配置 -->
            <id>central</id>    <!-- 編譯配置 -->
            <name>Central Repository</name>    <!-- 編譯配置 -->
            <url>http://repo.maven.apache.org/maven2</url>    <!-- 編譯配置 -->
            <layout>default</layout>    <!-- 編譯配置 -->
            <snapshots>    <!-- 編譯配置 -->
                <enabled>false</enabled>    <!-- 編譯配置 -->
            </snapshots>
            <releases>    <!-- 編譯配置 -->
                <updatePolicy>never</updatePolicy>    <!-- 編譯配置 -->
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <!-- 編譯配置 -->
    <build>
        <defaultGoal>install</defaultGoal>      <!-- 設定預設的goal或phase 當什麼都沒有指定是執行該目標或階段-->
        <directory>${project.basedir}/target</directory>    <!-- 編譯後的檔案目標位置 路徑都是絕對路徑-->
        <outputDirectory>${project.build.directory}/classes</outputDirectory>     <!-- 編譯後的檔案輸出位置  -->
        <finalName>${project.artifactId}-${project.version}</finalName>    <!-- 編譯打包的檔名稱 -->
        <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>    <!-- 測試編譯後的檔案輸出位置  -->
        <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>    <!-- 需要編譯原始檔存放位置 -->
        <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>    <!-- 需要編譯指令碼原始檔存放位置 -->
        <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>    <!-- 編譯的測試原始檔存放位置  -->
        <resources>     <!-- 指定了工程的資源存放位置,這些資源不會被編譯但是她是捆綁在這個專案中的,如專案要求的配置檔案configuration.xml等,這些檔案需要在打包同時要打入包中 -->
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>    <!-- 工程資源存放位置  -->
                <targetPath>META-INF/plexus</targetPath>    <!-- 打包後資源的位置 -->
                <filtering>false</filtering>
                <includes>         <!-- 指定需要打包的資源 -->
                    <include>configuration.xml</include>
                </includes>
                <excludes>    <!-- 指定不需要打包的資源 -->
                    <exclude>**/*.properties</exclude>
                </excludes>
            </resource>
        </resources>
        <!--
        resources:  is a list of resource elements that each describe what and where to include files associated with this project.
        targetPath: Specifies the directory structure to place the set of resources from a build. Target path defaults to the base directory. A commonly specified target path for resources that will be packaged in a JAR is META-INF.
        filtering:  is true or false, denoting if filtering is to be enabled for this resource. Note, that filter *.properties files do not have to be defined for filtering to occur - resources can also use properties that are by default defined in the POM (such as ${project.version}), passed into the command line using the "-D" flag (for example, "-Dname=value") or are explicitly defined by the properties element. Filter files were covered above.
        directory:  This element's value defines where the resources are to be found. The default directory for a build is ${basedir}/src/main/resources.
        includes:   A set of files patterns which specify the files to include as resources under that specified directory, using * as a wildcard.
        excludes:   The same structure as includes, but specifies which files to ignore. In conflicts between include and exclude, exclude wins.
        testResources: The testResources element block contains testResource elements. Their definitions are similar to resource elements, but are naturally used during test phases. The one difference is that the default (Super POM defined) test resource directory for a project is ${basedir}/src/test/resources. Test resources are not deployed.
        -->
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/test/resources</directory>    <!-- 編譯配置 -->
            </testResource>
        </testResources>
        <filters>
            <filter>filters/filter1.properties</filter>
        </filters>
        <plugins>   <!-- 指定使用的外掛列表 -->
            <plugin>    <!-- 指定一個外掛  -->
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <!--
                dependencies:   Dependencies are seen a lot within the POM, and are an element under all plugins element blocks. The dependencies have the same structure and function as under that base build. The major difference in this case is that instead of applying as dependencies of the project, they now apply as dependencies of the plugin that they are under. The power of this is to alter the dependency list of a plugin, perhaps by removing an unused runtime dependency via exclusions, or by altering the version of a required dpendency. See above under Dependencies for more information.
                executions:     It is important to keep in mind that a plugin may have multiple goals. Each goal may have a separate configuration, possibly even binding a plugin's goal to a different phase altogether. executions configure the execution of a plugin's goals.
                                For example, suppose you wanted to bind the antrun:run goal to the verify phase. We want the task to echo the build directory, as well as avoid passing on this configuration to its children (assuming it is a parent) by setting inherited to false. You would get an execution like this:
                id:             Self explanatory. It specifies this execution block between all of the others. When the phase is run, it will be shown in the form: [plugin:goal execution: id]. In the case of this example: [antrun:run execution: echodir]
                goals:          Like all pluralized POM elements, this contains a list of singular elements. In this case, a list of plugin goals which are being specified by this execution block.
                phase:          This is the phase that the list of goals will execute in. This is a very powerful option, allowing one to bind any goal to any phase in the build lifecycle, altering the default behavior of Maven.
                inherited:      Like the inherited element above, setting this false will supress Maven from passing this execution onto its children. This element is only meaningful to parent POMs.
                configuration:  Same as above, but confines the configuration to this specific list of goals, rather than all goals under the plugin.
-->
                <executions>
                    <execution>
                        <id>echodir</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>verify</phase>
                        <inherited>false</inherited>
                        <configuration>
                            <tasks>
                                <echo>Build Dir: ${project.build.directory}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                    <!-- 以上execution解讀: 繫結一個antrun:run的goal到verify階段,任務是輸出編譯的目錄,避免把這個配置傳到子pom中配置inherited為false -->
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>  <!-- 外掛管理 -->
            <!-- NOTE: These plugins will be removed from future versions of the super POM -->
            <!-- They are kept for the moment as they are very unlikely to conflict with lifecycle mappings (MNG-4453) -->
            <plugins>
                <plugin>    <!-- 編譯配置 -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.0</version>
                    <extensions>false</extensions>  <!-- 是否載入外掛的擴充套件,值:true|false 預設是false -->
                    <inherited>true</inherited> <!-- 這個外掛的configuration(配置)是否要施加到繼承該pom的子pom上 值:true|false 預設true -->
                    <configuration>   <!-- 對單個外掛指定配置,不需要深入瞭解這個外掛怎麼工作的,換句話說就是這個外掛期望的屬性都可以在這裡指定,
                    如果該pom是一個父級pom,這個配置也會被繼承,不管是在 build/plugins 還是在 pluginManagement中,如果子pom的外掛中設定了該configuration,
                      那麼子pom中的外掛配置值就是有效的,子pom中沒有設定,父級中配置了父級的就是有效的-->
                        <classifier>test</classifier> <!-- -->
                    </configuration>
                    <dependencies></dependencies>
                    <executions></executions>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>    <!-- 包含了site階段相應地元素,maven會生成一個定義和配置在reporting元素下的報告,比如:JavaDoc報告,像build中配置外掛一樣的,reporting掌握了相同的能力
     明顯的不同是build中外掛的goal配置在executions塊中,reporting是配置在reportSet元素中,稍微的不同是reporting下的configuration扮演了build外掛的configuration
     相反則不然,也就是build外掛的配置(configuration)不會影響reporting外掛 -->
        <outputDirectory>${project.build.directory}/site</outputDirectory>    <!-- 文件輸出位置 -->
        <!-- 一個非常重要的是一個外掛有很多goal,每個goal可能有分開的配置(configuration),reportSets配置一個report外掛目標的執行,相同就是build的execution則不能繫結一個報告到其他階段 -->
        <plugins>
            <plugin>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.0.1</version>
                <reportSets>
                    <reportSet>
                        <id>sunlink</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                        <inherited>true</inherited>
                        <configuration>
                            <links>
                                <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
                            </links>
                        </configuration>
                    </reportSet>
                    <!--
                    上述reportSet解讀:假如你想配置javadoc:javadoc這個goal來連線到http://java.sun.com/j2se/1.5.0/docs/api/,僅僅只是javadoc(不是maven-javadoc-plugin:jar目標)
                    同時想把這個配置傳遞給它的child,就設定inherited為true
                     -->
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <!-- NOTE: The release profile will be removed from future versions of the super POM -->
        <profile>
            <id>test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <jdk>1.5</jdk>          <!-- jdk版本 -->
                <os>       <!-- 作業系統 -->
                    <name>Windows XP</name>
                    <family>Windows</family>
                    <arch>x86</arch>
                    <version>5.1.2600</version>
                </os>
                <property>
                    <name>sparrow-type</name>
                    <value>African</value>
                </property>
                <file>  <!-- 給定的檔案可能功能檔案的existence來啟用這個profile -->
                    <exists>${basedir}/file2.properties</exists>
                    <missing>${basedir}/file1.properties</missing>
                </file>
            </activation>
            <!-- 備註:activation元素不是profile被啟用的唯一方式,settings.xml檔案中的activeProfile元素可能包含了這個profile的id,通過命令工具它們也可能被啟用 -->
            <!--<build>...</build>-->
            <!--<modules>...</modules>-->
            <!--<repositories>...</repositories>-->
            <!--<pluginRepositories>...</pluginRepositories>-->
            <!--<dependencies>...</dependencies>-->
            <!--<reporting>...</reporting>-->
            <!--<dependencyManagement>...</dependencyManagement>-->
            <!--<distributionManagement>...</distributionManagement>-->
        </profile>
        <!--
        profile 4.0的一個新特性就是工程根據環境來改變設定,這個環境就是那裡將要被編譯。profile包含了可選的activation和對pom作出的該組變化,如果這個profile可以被啟用的話
        如:為測試環境編譯就可能需要指定一個不同的資料庫,然後釋出。或者依賴的包根據不同的jdk版本來從倉庫中獲取
        -->
        <profile>
            <id>release-profile</id>
            <activation>     <!-- activation是profile的關鍵,profile的能力就是根據確定的情況修改基礎的pom的能力,這些情形可以在activation元素中指定,一個和多個指定的標準被遇到是activation就會發生,但正數第一個被遇見時,處理停止並且這個profile被標記為啟用-->
                <property>    <!-- 編譯配置 -->
                    <name>performRelease</name>    <!-- 編譯配置 -->
                    <value>true</value>    <!-- 編譯配置 -->
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <inherited>true</inherited>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <inherited>true</inherited>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <inherited>true</inherited>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
資料參考:http://maven.apache.org/pom.html

相關推薦

使用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/

Maven配置檔案pom.xml詳細解讀

基本內容: POM包括了所有的專案資訊 groupId:專案或者組織的唯一標誌,並且配置時生成路徑也是由此生成,如org.myproject.mojo生成的相對路徑為:/org/myproject/mojo artifactId:專案的通用名稱 version:專案的版本 packaging:打

關於使用maven建立web專案pom.xml中出現錯誤web.xml is missing and is set to true

錯誤提示: web.xml is missing and <failOnMissingWebXml> is set to true   意思就是,web專案需要一個web.xml檔案,而你通過maven的 建立是沒有web.xml,所以需要自己手動生成

為什麼要使用Maven管理專案

為什麼要使用Maven來管理專案?         我們在開發專案的過程中,會使用一些開源框架、第三方的工具等等,這些都是以jar包的方式被專案所引用,並且有些jar包還會依賴其他的jar包,我們同樣需要新增到專案中,所有這些相關的jar包都會作為專案的依賴。通

使用 Maven 管理專案 & 從 0 開始搭建 Maven 專案

maven 是 apache 的一個開源軟體,純 Java 編寫的,專門用於管理 Java 專案的一個工具。   maven 就是一個工具而已,用不用都不耽誤你刷刷的敲程式碼,那為什麼我們還要學習它呢?   那肯定是有很多的好處啊,不知道大家有沒有注意過,一個普通的 SSM 專案一

Maven建立web專案pom.xml最基礎的配置

配置問題 在Maven預設的配置檔案中,jdk的版本預設是1.5的,每次右鍵Update Project的過程中都會將jdk版本給我初始化成jdk 1.5的…..所以很不爽,以下是兩種配置的解決方案. 1.在pom.xml中的配置,這種配置是區域性的,僅對

Maven配置檔案pom.xml詳解

什麼是POM? POM是專案物件模型(Project Object Model)的簡稱,它是Maven專案中的檔案,使用XML表示,名稱叫做pom.xml。在Maven中,當談到Project的時候,不僅僅是一堆包含程式碼的檔案。一個Project往往包含一個配置檔案,包括了與開發者有關的,缺陷

MySql之ALTER命令用法詳細解讀

修改表 pre const 命令使用 add ear 修改 blog rain 本文詳細解讀了MySql語法中Alter命令的用法,這是一個用法比較多的語法,而且功能還是很強大的。 USE learning;(自己要提前建好) CREATE TABLE student

MemCache詳細解讀

參考:https://www.cnblogs.com/xrq730/p/4948707.html MemCache是什麼 MemCache是一個自由、原始碼開放、高效能、分散式的分散式記憶體物件快取系統,用於動態Web應用以減輕資料庫的負載。它通過在記憶體中快取資料和物件來減少讀取資料庫的次數,從而提高了

Maven 的Android專案裡面的jar包本地、library及libs目錄下so檔案如何引用

一.jar包引用(本地) 1.普通eclipse結構專案下的 如下圖直接放入libs目錄下 不做詳解 2.maven 結構下 jar包引用方式 在cmd下 用mvn命令把jar安裝到本地repository中 (mvn環境已經配置好必須) 這句話: mvn inst

Myeclipse6.5 + Maven 開發web工程詳細配置

      前面咱們說了 maven環境變數的配置以及myeclipse中maven外掛的安裝,那麼下面就說一下myeclipse + maven 搭 建web project工程!那就一步一步來看吧:      1、使用Maven建立webapp工程----原因是使用Maven時一般需要遵循一定的目錄結構,

泛型超詳細解讀:泛型基礎

一:什麼是泛型 泛型是jdk5才引進的,泛型其實指得就是引數化型別,使得程式碼可以適應多種型別。像容器,List< T >,大量使用了泛型,它的主要目的之一就是用來指定容器要持有什麼型別的物件。我認為,泛型的好處很多: 1.保證了型別安全

linux進程管理之進程創建

while 變量 call 兩次返回 pen lan under strong () 在linux系統中,許多進程在誕生之初都與其父進程共同用一個存儲空間。但是子進程又可以建立自己的存儲空間,並與父進程“分道揚鑣”,成為與父進程一樣真正意義上的進程。 linux系統運行的

DispNet中Caffe自定義層解讀—— GenerateAugmetationParamters

DispNet中Caffe自定義層解讀(三)—— GenerateAugmetationParamters 這一系列博文記錄了博主在學習DispNet過程中遇到的自定義Caffe層的筆記。這一部分是GenerateAugmentationParameters層,其主要功能是: 。

SVNTortoiseSVN詳細教程--SVN更新及如何解決衝突檔案

一. SVN更新(SVN Update)及如何解決衝突檔案: 1. SVN update: 更新原生代碼與SVN伺服器上最新的版本一致,只要在需要更新的資料夾上點選右鍵或者在檔案下空白處點選右鍵,選擇”SVN Update” (獲取指定版本中

阿里雲伺服器的web專案釋出之路:將web專案釋出到雲伺服器

1.配置阿里雲的安全組,主要是允許8080,80埠的訪問,這樣做的目的主要是為了能讓外網進行訪問,當然,這個地方也能設定專門網段訪問你的公網,配置如下所示 這個地方你也可以通過克隆的方式新增。 8080:被用於WWW代理服務的,可以實現網頁瀏覽,經常在訪問某個網站或使用代理伺服器的

Spring MVC+mybatis 專案入門:旅遊網使用者註冊——控制反轉以及Hibernate Validator資料驗證

註冊原理         其實很簡單,前端頁面顯示一個表單,然後由dispatcher傳遞到controller,controller呼叫資料庫驗證,如果ok,那就寫入資料庫,同時返回註冊成功的檢視,否則可以返回註冊頁,或者是到一個錯誤頁。 依賴注入與控制反轉    

Netty原始碼解讀Channel與Pipeline

Channel是理解和使用Netty的核心。Channel的涉及內容較多,這裡我使用由淺入深的介紹方法。在這篇文章中,我們主要介紹Channel部分中Pipeline實現機制。為了避免枯燥,借用一下《盜夢空間》的“夢境”概念,希望大家喜歡。 一層夢境:Channel實現概覽 在Netty裡,

Spring入門詳細教程

前言 本篇緊接著spring入門詳細教程(二),建議閱讀本篇前,先閱讀第一篇和第二篇。連結如下: Spring入門詳細教程(一) https://www.cnblogs.com/jichi/p/10165538.html Spring入門詳細教程(二) https://www.cnblogs.

記一次基於react、cra2、typescript的pwa專案由開發到部署

該篇文章為本系列最後一篇文章,因為最近樓主忙於畢設,所以這也是一篇被鴿了很久很久的文章。該文章主要講的是該專案的部署部分,包括: 如何將該專案部署到nginx伺服器上。 為它配置證書,讓它執行在https協議上等。 專案回顧 這是一個基於creat-react-app2的pwa專案。可以新