开发者

unpack dependecies once with maven dependecy plugin

Hi i've figured out what to do to explode a zip file in my project directory But i would like to do it just one time. i mean if the diretory already exist not explode it a second time. Here is the way i do it today

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <!--Import qooxdoo sdk and add it to target directory-->
              开发者_C百科      <execution>
                        <id>extract-qooxdoo-sdk</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
                            <outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>>2.2</version>
                <executions>
                    <!--Import qooxdoo sdk and add it to target directory-->
                    <execution>
                        <id>extract-qooxdoo-sdk</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
                            <outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

thanks for your help


i would suggest to use a profile to check if the folder exists. But i would suggest to put that folder into a different folder for example to target folder....

<profiles>
  <profile>
    <id>qo</id>
    <activation>
      <file>
        <missing>${project.basedir}/qooxdoo-sdk</missing>
      </file>
    </activation>
    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.2</version>
          <executions>
            <!--Import qooxdoo sdk and add it to target directory-->
            <execution>
              <id>extract-qooxdoo-sdk</id>
              <phase>process-resources</phase>
              <goals>
                <goal>unpack-dependencies</goal>
              </goals>
              <configuration>
                <includeArtifactIds>qooxdoo-sdk</includeArtifactIds>
                <outputDirectory>${project.basedir}/qooxdoo-sdk</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜