maven打包時包含assembly id的問題

剛接觸maven時,使用 maven-assembly-plugin插件進行打包,發現打包出來的結果總是末尾包含assembly id,不符合既定的規則,一直未百度出結果,因不影響功能,就未深究,最後老大在Google找到了答案,關鍵是

<appendAssemblyId>false</appendAssemblyId>

   <build>
      <finalName>${project.artifactId}</finalName>

      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.6</version>
            <configuration>
               <appendAssemblyId>false</appendAssemblyId>
               <outputDirectory>../target/co_search-${project.version}</outputDirectory>
               <descriptors>
                  <descriptor>../assembly.xml</descriptor>
               </descriptors>
            </configuration>
            <executions>
               <!-- 當執行mvn package時纔會打包 -->
               <execution>
                  <id>make-assembly</id>
                  <phase>package</phase>
                  <goals>
                     <goal>single</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>


爛筆頭

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章