2

I have defined maven assembly plugin and have set pom to execute the plugin(assembly.xml) in "compile" phase. assembly.xml - it gets the jars/files using "dependencySet" and I replace few files with my local set using "fileSet".

With Maven assembly plugin 2.2 beta 2 it would replace the files. With version 2.2 or 2.2.1 of assembly plugin, a) it says "already added, skipping" and does not overwrite. b) if I modify the phase to "generate-resources" instead of "compile" in the pom, it shows the 'already added, skipping" message and anyways replaces/overwrites the files.

Would like to know, what has changed between versions and why the phase change would make it work. Also it would be helpful if someone can explain what exactly happens in "compile" phase (that it doesn't overwrite). Is there a workaround for my issue?

Thanks in advance for the help!

Included the snippet:

`<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2</version>
  <executions>
    <execution>
      <id>create-install-image-layout</id>
      <phase>compile</phase>
      <goals>
        <goal>directory-single</goal>
      </goals>
      <configuration>
        <descriptors>
           <descriptor>src/main/assembly/assembly.xml</descriptor>                                              
        </descriptors>                                     
        <ignoreDirFormatExtensions>false</ignoreDirFormatExtensions>
      </configuration>
    </execution>
  </executions>
 </plugin>`
4

2 回答 2

1

目标目录单被标记为已弃用。此外,最新版本的 maven-assembly-plugin 是 2.2.2 而不是 2.2。此外,为了任何目的创建档案,正确的阶段将是包阶段,而不是编译源代码的编译阶段。

于 2011-12-08T13:25:50.967 回答
0

你在执行什么目标?你是先执行干净吗?它可能会跳过编译阶段,因为代码已经编译。

于 2011-04-26T18:43:34.940 回答