Does it work in a simple ant script.

On 4-May-08, at 9:47 AM, Steinar Bang wrote:

Steinar Bang <[EMAIL PROTECTED]>:

[snip! Things that didn't work]

I added a <delete> of the original jar file, before the zip task, and
then it worked.  Ie.
<unzip>
<replace>
<delete>
<zip>

So it was probably something about zip and overwriting of the existing
file that caused the flaky behaviour. Why it sometimes worked, and why
a <sleep> worked for some projects, is still a mystery.

The entire <plugin> config for each project, looks like this now:
  <plugin>
   <artifactId>maven-antrun-plugin</artifactId>
   <executions>
    <execution>
     <id>fix-snapshot-bundle-version</id>
     <goals>
      <goal>run</goal>
     </goals>
     <phase>verify</phase>
     <configuration>
      <tasks>
<unzip src="${project.build.directory}/${artifactId}_$ {version}.jar" dest="${project.build.directory}" /> <replace file="${project.build.directory}/META-INF/ MANIFEST.MF" token="-SNAPSHOT" value=".SNAPSHOT" /> <delete file="${project.build.directory}/${artifactId}_$ {version}.jar" /> <zip destfile="${project.build.directory}/${artifactId}_$ {version}.jar"> <fileset dir="${project.build.directory}" includes="META-INF/ **" />
       </zip>
      </tasks>
     </configuration>
    </execution>
   </executions>
  </plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

A language that doesn’t affect the way you think about programming is not worth knowing.

-— Alan Perlis




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to