0

I have a gradle project like this:

root
  |
  |---- projectA
  |   |
  |   |----main
  |
  |---- projectB
  |   |
  |   |----test
 ...

projectA is upgrading springboot 1.0 to 2.0
projectA gradle.build is like this:

...
jar {
    enabled = true
}
...

and projectB test is depend on project A
projectB gradle.build is like this:

...
dependencies {
    testCompile project(':projectA')
}
...

a compile error happened when running ./gradlew :projectB:test
bad signature ¾4s9

the error message is:

xxx.TestSupport.java:20: error: cannot access QueryManager
bad class file xxx/xxx/QueryManager.class
bad signature ¾4s9

the TestSupport.java is in projectB
the QueryManager is in projectA. And the querymanager class use lombok and ea.async.

the TestSupport.java's content is:

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = {
        MysqlConfigurationSelector.class
},
properties = {"query.mysql.nio.enable=true","query.mysql.port=9011"})
@RunWith(SpringRunner.class)
@ActiveProfiles("test")
public abstract class TestSupport {}

I have searched a lot but I couldn't find anything helpful.

Nikolai Shevchenko
  • 7,083
  • 8
  • 33
  • 42
dayu
  • 1
  • 2
  • Could you please share the contents of the possible erroneous class? – António Ribeiro May 07 '20 at 09:38
  • the error message is:'xxx.TestSupport.java:20: error: cannot access QueryManager', the TestSupport.java is in projectB, the QueryManager is in projectA. And the querymanager class use lombok and ea.async. @aribeiro – dayu May 07 '20 at 10:04
  • Apparently the issue is with the QueryManager.class file. Have you tried to compile projectA on its own first, to see if the error also appears? – António Ribeiro May 07 '20 at 15:46
  • I've tried. './gradlew :projectA:jar' build successful@aribeiro – dayu May 08 '20 at 02:28
  • Could you please share the contents of your `TestSupport.java` file? – António Ribeiro May 08 '20 at 09:40
  • @aribeiro contents is appended – dayu May 09 '20 at 08:57
  • 1
    Make sure that you build the app with up-to-date JDK version. Unlike Spring Boot 1 Spring Boot 2 requires Java 8+ – Nikolai Shevchenko May 09 '20 at 10:15
  • @dayu why is your test class an `abstract` class? Also, in your test class, I can't see any reference to your `QueryManager` class. – António Ribeiro May 09 '20 at 11:07
  • 1
    @aribeiro and Nikolai, I have solved the problem, the eaAsync lib ((https://github.com/electronicarts/ea-async) newest version 1.2.3 make the compile error. when downgrade to 1.0.5, the problem solved. thanks for your help and time – dayu May 12 '20 at 06:23
  • @dayu that's awesome! Then please post your solution as an answer and mark it as correct. Glad to be of help. – António Ribeiro May 12 '20 at 09:12

1 Answers1

0

I have solved the problem. the eaAsync lib ((github.com/electronicarts/ea-async) newest version 1.2.3 make the compile error. when downgrade to 1.0.5, the problem solved.

dayu
  • 1
  • 2