1

I am trying to run an Maven Ant Task with plugin version 2.1.3 and for some reason running into this error:

[javac] Compiling 101 source files to /home/raido/Workspace2/foobar/classes
[javac] error: error reading /home/raido/.m2/repository/foobar/1.0/foobar-1.0.pom; error in opening zip file
[javac] 1 error

Why is it trying to read a xml file as an zip file and how can I avoid this? The file itself is perfectly fine and readable.

That part from the build.xml file:

<target name="compile" depends="init">
    <mkdir dir="${build.dir}" />
    <mkdir dir="${classes.dir}" />
    <javac classpathref="compile.dependency.path" debug="on"
        encoding="UTF-8" 
        deprecation="on" destdir="${classes.dir}"
        includes="bar/**/*.java" optimize="off"
        srcdir="${src.dir}" />
</target>

The error is targeted to the closing sign > on the srcdir row i.e. the whole tag.

Raidok
  • 774
  • 8
  • 19

3 Answers3

3

It might be corrupt zip. you can remove the foobar/1.0/ dir from your maven repos and let maven download new fresh version

jmj
  • 237,923
  • 42
  • 401
  • 438
  • It is a custom POM file and isn't in any other repository than my local one but I'll upload it to a remote location and let maven download it then. But what do you mean by _corrupt zip_? It's just a plain folder with a XML file in it. – Raidok Oct 24 '11 at 07:38
  • may be you can simply copy and paste the pom and jar and other files into your local maven repos for a quick fix – jmj Oct 24 '11 at 08:41
1

Show us your definition of compile.dependency.path. Seems like the pattern there is not quite correct and allows .pom files (if it's **/**, for example), which will clearly not work.

carlspring
  • 31,231
  • 29
  • 115
  • 197
1

I finally figured it out. The problem was that the main ant file had a specific task that produced JAR-s of the modules but I hadn't done it. This shows how important documentation sometimes is which this project doesn't have at all!

Raidok
  • 774
  • 8
  • 19