<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Maven 構建知識庫

      Maven 構建知識庫

      1. 安裝本地jar或者pom到構建倉庫

       mvn install:install-file -Dfile=cs-1.1.3-SNAPSHOT.jar -DgroupId=com.bireturn -DartifactId=cs -Dversion=1.1.3-SNAPSHOT -Dpackaging=jar
       mvn install:install-file -Dfile=cs-1.1.3-SNAPSHOT.pom -DgroupId=com.bireturn -DartifactId=cs -Dversion=1.1.3-SNAPSHOT -Dpackaging=pom
      

      2. Maven依賴當前項目相對jar

      <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492-->
      <dependency>
          <version>1</version>
          <groupId>com.herbert</groupId>
          <artifactId>projectLocal.jar</artifactId>
          <scope>system</scope>
          <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/projectLocal.jar</systemPath>
      </dependency>
      

      3. Maven構建編譯依賴本地jar

      <plugin>
          <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492-->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
              <compilerArguments>
                  <extdirs>${basedir}/src/main/resources/lib/bo;${basedir}/src/main/resources/lib/cognos</extdirs>
              </compilerArguments>
          </configuration>
      </plugin>
      
      

      4. Maven構建運行外部程序

      <plugin>
          <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492-->
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
              <execution>
                  <id>copy api to others project</id>
                  <phase>package</phase>
                  <goals>
                      <goal>exec</goal>
                  </goals>
                  <configuration>
                      <executable>cmd</executable>
                      <arguments>
                          <argument>/c echo done copy version .</argument>
                          <argument>&amp;&amp; copy /Y ${project.build.directory}\${project.artifactId}.jar D:\\lib\${project.artifactId}.jar </argument>
                      </arguments>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      

      5. Maven構建運行class程序

      <plugin>
          <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492-->
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
              <execution>
                  <id>convert version code</id>
                  <phase>prepare-package</phase>
                  <goals>
                      <goal>java</goal>
                  </goals>
                  <configuration>
                      <includeProjectDependencies>true</includeProjectDependencies>
                      <includePluginDependencies>true</includePluginDependencies>
                      <mainClass>com.herbert.common.HkDoConvertVersionCode</mainClass>
                      <arguments>
                          <argument>微信小游戲地心俠士</argument>
                      </arguments>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      

      6. Maven構建自定義zip文件

      <plugin>
          <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492-->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.3.0</version>
          <executions>
              <execution>
                  <id>rootZip-assembly</id>
                  <phase>package</phase>
                  <goals>
                      <goal>single</goal>
                  </goals>
                  <configuration>
                      <finalName>${name}</finalName>
                      <appendAssemblyId>false</appendAssemblyId>
                      <descriptors>
                          <descriptor>./rootZip-assembly.xml</descriptor>
                      </descriptors>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      

      rootZip-assembly.xml 文件內容

      <assembly>
          <id>bin-1</id>
          <formats>
              <format>zip</format>
          </formats>
          <includeBaseDirectory>false</includeBaseDirectory>
          <fileSets>
              <fileSet>
                  <directory>src/main/webapp/WEB-INF</directory>
                  <outputDirectory>/herbert/WEB-INF</outputDirectory>
                  <excludes>
                      <exclude>cfgHome/hkInitPath/initCmd/**</exclude>
                      <exclude>cfgHome/hkInitPath/command/*.command</exclude>
                  </excludes>
              </fileSet>
              <fileSet>
                  <directory>target/classes</directory>
                  <outputDirectory>/herbert/WEB-INF/classes</outputDirectory>
              </fileSet>
              <fileSet>
                  <directory>src/main/webapp/apps_res</directory>
                  <outputDirectory>/herbert/apps_res</outputDirectory>
              </fileSet>
             	<fileSet>
      			     <directory>src/scripts</directory>
      			     <outputDirectory>/</outputDirectory>
      			     <filtered>true</filtered>
      		   </fileSet>
          </fileSets>
          <dependencySets>
      		<dependencySet>
      			<outputDirectory>/lib</outputDirectory>
      			<scope>runtime</scope>
      			<excludes>
      				<exclude>${project.groupId}:${project.artifactId}</exclude>
      			</excludes>
      		</dependencySet>
      		<dependencySet>
      			<outputDirectory>/</outputDirectory>
      			<includes>
      				<include>${project.groupId}:${project.artifactId}</include>
      			</includes>
      		</dependencySet>
      	</dependencySets>
      </assembly>  
      

      復制文件時可以對某些文件內容做替換,比如src/scripts 文件中的一個文件內容,打包后,對應參數會替換成具體的值

      java -jar -Dloader.path=resources,lib ${project.artifactId}-${project.version}.jar shutdown
      

      7. 篩選項目不同的class單獨構建一個jar文件

      <plugin>
           <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492--> 
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <executions>
              <execution>
                  <id>api</id>
                  <phase>package</phase>
                  <goals>
                      <goal>jar</goal>
                  </goals>
                  <configuration>
                      <classifier>herbert-dxxs-api</classifier>
                      <archive>
                          <manifest>
                              <addClasspath>false</addClasspath>
                          </manifest>
                      </archive>
                      <includes>
                          <include>**/com/dxxs/DataImport*.class</include>
                          <include>**/com/dxxs/DeleteFile*.class</include>
                          <include>**/com/dxxs/DownFile*.class</include>
                          <include>**/com/dxxs/ExcelConvert*.class</include>
                          <include>**/com/dxxs/FileListener*.class</include>
                          <include>**/com/dxxs/FileUpaload*.class</include>
                          <include>**/com/dxxs/UploadFileInfo*.class</include>
                      </includes>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      

      8. Maven構建的一些全局變量

      • 內置屬性(Maven預定義屬性,用戶可以直接使用)

        • ${basedir}表示項目的根路徑,即包含pom.xml文件的目錄
        • ${version}表示項目版本
        • ${project.basedir}同$
        • ${project.baseUri}表示項目文件地址
        • ${maven.build.timestamp}表示項目構建開始時間
        • ${maven.build.timestamp.format}表示${maven.build.timestamp}的展示格式,默認值為yyyyMMdd-HHmm
      • pom屬性(使用pom屬性可以引用到pom.xml文件中對應元素的值)

        • ${project.build.sourceDirectory}表示主源碼路徑,默認為src/main/java/
        • ${project.build.testSourceDirectory}表示測試源碼路徑,默認為src/test/java/
        • ${project.build.directory}表示項目構建輸出目錄,默認為target/
        • ${project.outputDirectory}表示項目測試代碼編譯輸出目錄,默認為target/classes/
        • ${project.groupId}表示項目的groupId
        • ${project.artifactId}表示項目的artifactId
        • ${project.version}表示項目的version,同$
        • ${project.build.finalName}表示項目打包輸出文件的名稱,默認為${project.artifactId}$
      • 自定義屬性(在pom.xml文件的標簽下定義的Maven屬性)

      定義屬性:

      <project>
         <properties>
             <mysql.version>5.6.32</mysql.version>
         </properties>
      </project>
      

      使用屬性:

      <!--小游戲 地心俠士 公眾號:小滿小慢 QQ:464884492-->
      <dependency>
          <groupId>mysql</groupId>
           <artifactId>mysql-connector-java</artifactId>
           <version>${mysql.version}</version>
      </dependency>
      
      • setting.xml文件屬性(與pom屬性同理,用戶可以用settings.開頭的屬性引用setting.xml文件的xml元素值)

        • ${settings.localRepository}表示本地倉庫的地址
      • Java系統屬性(所有的Java屬性都可以使用Maven屬性引用)

        • mvn help:system 可以查看所有的Java屬性
          System.getProperties() 可以得到所有的Java屬性
          ${user.home} 表示用戶目錄
      • 環境變量屬性(所有的環境變量都可以以env.開頭的Maven屬性引用)

        • mvn help:system 可查看所有的環境變量
        • ${env.JAVA_HOME} 表示JAVA_HOME環境變量的值

      9. Maven只構建父工程或只構建子工程

      只構建父工程
      mvn package -N

      只構建子工程,多個子工程逗號分隔
      mvn package -pl 子模塊名稱

      posted @ 2025-08-08 17:27  _herbert  閱讀(24)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲高潮喷水无码AV电影 | 国产精品中文字幕第一页| 亚洲成色精品一二三区| 亚洲一区二区精品动漫| 国产欧美日韩亚洲一区二区三区 | 91午夜福利在线观看精品| 久久毛片少妇高潮| 99中文字幕精品国产| 亚洲高清偷拍一区二区三区| 永久免费AV无码网站YY| 永久免费无码av在线网站| 撕开奶罩揉吮奶头高潮av| 熟女熟妇乱女乱妇综合网| 一区二区不卡国产精品| 中文字幕av一区二区| 亚洲精品国产综合麻豆久久99| 国产高清不卡视频| a男人的天堂久久a毛片| 亚洲v欧美v日韩v国产v| 国产在线视频不卡一区二区| 精品亚洲国产成人av| 国产午夜福利视频在线| 成人国产av精品免费网| 亚洲色欲在线播放一区二区三区 | 97人人超碰国产精品最新| 日韩精品一卡二卡在线观看| 中文字幕乱码一区二区免费| 人妻系列无码专区免费| 亚洲国产在一区二区三区| 2022最新国产在线不卡a| 口爆少妇在线视频免费观看| 黔西| 久久精品国产中文字幕| 亚洲永久一区二区三区在线 | 好爽毛片一区二区三区四| 亚洲春色在线视频| 国产精品久久久久久免费软件| 国产女同一区二区在线| 99国内精品久久久久久久| 高清偷拍一区二区三区| 国产精品亚洲av三区色|