Hello,

I just upgraded to NB 23 (from 19), and it looks good
and feels faster and more refined, good job!

Now, I am also trying to finally migrate my old NB7 ant
ear build to maven.
(I assume there is still no kind of assistance for that, so I created
a project from wildfly-jakartaee-ear-archetype and adjusted manually)

So I got the ejb module to compile alright and among the things I
need is the jpa metamodel generation.

So my pom has:

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-jpamodelgen</artifactId>
            <version>5.2.16.Final</version>
            <scope>provided</scope>
        </dependency>

and the build works fine from command line using mvn clean package.

The build also works fine using the NB "clean" maven run, but afterwards
all usages of metamodel classes are marked red.

So e.g. I have a class
xxx.Role
and it's used in a xxx.RoleDAO but the
import xxx.Role_;
is marked red - "symbol Role_ not found".

I see

$ ls -l `find . -name "Role_.*"`
./xxx-ejb/target/classes/xxx/entity/Role_.class
./xxx-ejb/target/generated-sources/annotations/xxx/entity/Role_.java

and, the "Role_.java" is shown in the project view under
"Generated sources (annotations") in gray
and I can even open and look at the code,
but when I "Go to type", Role is known but Role_ is not.

Funny, I got the error resolved for a short time by moving the classes
mv ./xxx-ejb/target/classes ./xxx-ejb/target/generated-sources

I'm not sure if this is a misconfiguration, a version incompatibility,
a NB bug, or even the infamous NETBEANS-4191 cache issues that has been
plaguing me for the past 10 years, with the workaround "touch the
sources in the ant build afterwards" working most of the time.
But, manually touching source or classes files changes nothing in this
case.

So - how do you use jpa metamodelgen with NB and my?

Any input and discussion appreciated.

Cheers Tom.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to