Trouble with javax.annotation [message #1852319] |
Tue, 10 May 2022 14:23 |
Lee Carver Messages: 3 Registered: July 2009 |
Junior Member |
|
|
I'm working through packaging a simple Eclipse RCP, and struggling to get it packaged and released with Tycho. It appears the javax.annotation module that ships with the 2022-03 SDK exports a javax.annotation package. When I try to build a release from the command line, with Maven and Tycho, the build reports a non-API error.
This means that the IDE recognizes and builds with the @PostConstruct annotation for views, but the same software elements fail to compile under Maven/Tyson with the following error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.7.1:compile (default-compile) on project com.pnambic.devtools.depan.app: Compilation failure: Compilation failure:
[ERROR] /Users/lcarver/Projects/depan-2/git/depan2/DepanApp/src/com/pnambic/devtools/depan/app/parts/SamplePart.java:[5]
[ERROR] import javax.annotation.PostConstruct;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The type 'PostConstruct' is not API (restriction on classpath entry '/Users/lcarver/.m2/repository/p2/osgi/bundle/javax.annotation/1.3.5.v20200909-1856/javax.annotation-1.3.5.v20200909-1856.jar')
I get similar but inconsistent errors in the IDE .. sometimes .. for some target definitions that include the Eclipse Update site. When this happens, the IDE report are similar to
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
When this happens, the build dependencies show a javax.annotation module that does not include the java.annotation package. It does show the other two children packages as exported (javax.annotation.security, javax.annotation.sql), but the critical @PostConstruct is "non-API".
|
|
|
Powered by
FUDForum. Page generated in 0.43480 seconds