Question

I would like to use the new @NonNull annotation from Eclipse Juno but the project I'm working on is based on Maven and is deployed with Jenkins.

Is there any way that my annotations won't break the code for other developers who don't use Eclipse and for Jenkins?

P.S.: Null-checking of method parameters does not even work with Eclipse and the Maven plugin (the Maven plugin compiles without problems but there is no error thrown when a method gets called with a null parameter even if annotated by @NonNull).

P.S.: Seeinng that my thread is a few months old, has anything better surfaced to get NonNull annotations with Maven?

Was it helpful?

Solution

There is a Eclipse Bug raised to track publishing these annotations on to Maven Central.

The only work around I see for now is manually downloading the jar and then publishing it to your internal Maven repo.

UPDATE: To use it in maven builds consider using Eclipse JDT instead of javac. This could help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top