在maven依赖插件中,只有当我把参数传给他时,如何解包



有人知道我如何用术语来解包工件吗?

这意味着给他一个布尔参数,决定是否打开某个工件的包装。

我尝试使用跳过标志,但没有成功。

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.9</version>
                <executions>
                  <execution>
                    <id>get-rpm</id>
                    <phase>compile</phase>
                    <goals>
                      <goal>copy</goal>
                    </goals>
                    <configuration>
                      <artifactItems>
                        <artifactItem>
                          <groupId>com.XX.XXX</groupId>
                          <artifactId>XXX-ONPREM</artifactId>
                          <version>${BUILD_NUMBER}</version>
                          <type>rpm</type>
                          <classifier>rpm</classifier>
                          <overWrite>true</overWrite>
                          <outputDirectory>${project.build.directory}</outputDirectory>
                          <destFileName>${PACKAGE_NAME}</destFileName>
                        </artifactItem>
                      </artifactItems>
                      <!-- other configurations here -->
                    </configuration>
                  </execution>
                  <execution>
                    <id>get-third-parties</id>
                    <phase>compile</phase>
                    <goals>
                      <goal>unpack</goal>
                    </goals>
                    <configuration>
                      <artifactItems>
                        <artifactItem>
                          <groupId>com.XX.XXX</groupId>
                          <artifactId>thirdparties-sources</artifactId>
                          <version>${third-parties.version}</version>
                          <type>zip</type>
                          <skip>true</skip>
                          <overWrite>true</overWrite>
                          <outputDirectory>${project.build.directory}/3rd-parties</outputDirectory>
                        </artifactItem>
                      </artifactItems>
                      <!-- other configurations here -->
                    </configuration>
                  </execution>

所以我想明白了,您只需将跳过标志放在正确的位置,我已经把它放在配置之后了。

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.9</version>
                <executions>
                  <execution>
                    <id>get-rpm</id>
                    <phase>compile</phase>
                    <goals>
                      <goal>copy</goal>
                    </goals>
                    <configuration>
                      <artifactItems>
                        <artifactItem>
                          <groupId>com.XX.XXX</groupId>
                          <artifactId>AGM-ONPREM</artifactId>
                          <version>${BUILD_NUMBER}</version>
                          <type>rpm</type>
                          <classifier>rpm</classifier>
                          <overWrite>true</overWrite>
                          <outputDirectory>${project.build.directory}</outputDirectory>
                          <destFileName>${PACKAGE_NAME}</destFileName>
                        </artifactItem>
                      </artifactItems>
                      <!-- other configurations here -->
                    </configuration>
                  </execution>
                  <execution>
                    <id>get-third-parties</id>
                    <phase>compile</phase>
                    <goals>
                      <goal>unpack</goal>
                    </goals>
                    <configuration>
                      <skip>${SKIP_3rd}</skip>
                      <artifactItems>
                        <artifactItem>
                          <groupId>com.XX.XXX</groupId>
                          <artifactId>thirdparties-sources</artifactId>
                          <version>${third-parties.version}</version>
                          <type>zip</type>
                          <overWrite>true</overWrite>
                          <outputDirectory>${project.build.directory}/3rd-parties</outputDirectory>
                        </artifactItem>
                      </artifactItems>
                      <!-- other configurations here -->
                    </configuration>
                  </execution>

相关内容

  • 没有找到相关文章

最新更新