I have my system set up to compile jee6 code from the command line (no IDE). I recently tried to compile some code that uses javax.enterprise.context.RequestedScope. The code compiled fine from the command prompt but when I tried to build the application using Maven I keep getting javax.enterprise.context package not found error.
What gives? I thought Maven was using the same javac I’m using. Why can javac find the package but Maven can’t? Do I need to add dependencies for java packages?
Or…is there a way to tell Maven to use the current class files when building or does Maven have to compile when it builds?
Thanks.
Try adding the Java EE 6 jar to your Maven dependencies:
This will add the Java EE classes to your compile-time classpath.