0

When I attempt to deploy artifacts, I get a ClassFormatError for my projects that do have tests:

[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ ssh-exec ---
[INFO] Concurrency config is {threadCount=10, parallel=methods, configurableParallelComputerPresent=false}
[INFO] Surefire report directory: /home/walterjwhite/storage/projects/software/active/stable/task/impl/ssh-exec/target/surefire-reports
org.apache.maven.surefire.booter.SurefireExecutionException: Incompatible magic value 4022320623 in class file test-classes/com/walterjwhite/task/impl/ssh/exec/RemoteCommandExecutorTest; nested exception is java.lang.ClassFormatError: Incompatible magic value 4022320623 in class file test-classes/com/walterjwhite/task/impl/ssh/exec/RemoteCommandExecutorTest
java.lang.ClassFormatError: Incompatible magic value 4022320623 in class file test-classes/com/walterjwhite/task/impl/ssh/exec/RemoteCommandExecutorTest

Has anyone else come across this problem?

Thanks,

Walter

Walter
  • 1,290
  • 2
  • 21
  • 46

1 Answers1

0

There are a couple of links related to incompatible magic value - perhaps one of them applies in this case.

Essentially the class file is corrupt in some way.

Link 1 Link 2

Community
  • 1
  • 1
Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Thanks for the links, I stumbled upon them earlier; however, I disabled resource filtering, jalopy formatting, and dependency unpacking. The odd thing is that this problem only occurs for the deploy goal. Even if I run tests (mvn clean test, mvn clean package, mvn clean install), those work fine. It is just the deploy phase that is broken. – Walter Dec 23 '10 at 16:12
  • Hmm, I noticed something strange, I see recursion in my target directory. In the test-classes folder, there is a jar that was built, then again you will see classes, surefire ... Since surefire is using the classpath as that directory, it is one of those class files that is screwing it up. How did this happen in the first place? – Walter Dec 23 '10 at 16:32
  • Ah, it must be my resources plugin. It appears to be invoked again. – Walter Dec 23 '10 at 16:35
  • Ok, I found it. I configured the resources plugin in a parent pom to filter over copied resources. I know there was a reason I did that, but I don't recall at present. This appears to be a basic problem to me - if your resources are already there (the project is built), then shouldn't the resources plugin overwrite the existing files if it is going to copy files at all? – Walter Dec 23 '10 at 17:00