osundblad / intellij-annotations-instrumenter-maven-plugin

IntelliJ IDEA annotations instrumenter maven plugin
Other
38 stars 11 forks source link

Unable to instrument javax.annotation #20

Closed dwightmulcahy closed 7 years ago

dwightmulcahy commented 7 years ago

I have a large project that has a mix of org.jetbrains.annotations and javax.annotation for notNull and nullable (don't ask).

I can't seem to get the javax.annotation annotations to instrument just the org.jetbrains.annotations.

with just the org.jetbrains.annotations I get the files that have it instrumented...

[INFO] --- notnull-instrumenter-maven-plugin:0.6.6:instrument (default) @ myproject ---
[info] Using the following NotNull annotations:
[info]   org.jetbrains.annotations.NotNull
[info] Using the following Nullable annotations:
[info]   org.jetbrains.annotations.Nullable
[info] Instrumented 2 files with NotNull assertions

with just the javax.annotation get none of the files instrumented... (there are 50+)...

[INFO] --- notnull-instrumenter-maven-plugin:0.6.6:instrument (default) @ pegasus ---
[info] Using the following NotNull annotations:
[info]   javax.annotation.NotNull
[info] Using the following Nullable annotations:
[info]   javax.annotation.Nullable
[info] Instrumented 0 files with NotNull assertions

I've set up my pom.xml file with the default but added the configuration section as such:

    <!--https://github.com/osundblad/intellij-annotations-instrumenter-maven-plugin-->
    <plugin>
        <groupId>se.eris</groupId>
        <artifactId>notnull-instrumenter-maven-plugin</artifactId>
        <version>0.6.6</version>
        ...
        <configuration>
            <notNull>
                <!--<param>org.jetbrains.annotations.NotNull</param>-->
                <param>javax.annotation.NotNull</param>
            </notNull>
            <nullable>
                <!--<param>org.jetbrains.annotations.Nullable</param>-->
                <param>javax.annotation.Nullable</param>
            </nullable>
        </configuration>
    </plugin>

I've done <implicit>true</implicit> but that covers everything (200+ files) and is unrealistic for me at this point.

I'm I doing something wrong or is this scenario unsupported at this point?

atorstling commented 7 years ago

Hi Dwight,

I see that you are specifying javax.annotation.NotNull, whereas I believe it's named javax.annotation.Nonnull. Could that be the problem? Alternatively, there is javax.validation.constraints.NotNull.

dwightmulcahy commented 7 years ago

Ugh... that was it. Thanks...