Open glassfishrobot opened 7 years ago
@deglans Commented After many research it's same to be javaee-api the most correct answer...
@deglans Commented Sorry, i have accidentally close the issue...
@bshannon Commented If you're building a Java EE application for deployment to a Java EE application server, then compiling against the javaee-api jar file is the right thing to do. Be sure to list it as a "provided" dependency since you don't want that jar file included in your application at runtime.
@deglans Commented Do you mean this (https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html):
provided
This is much likecompile
, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scopeprovided
because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.
So the pom.xml become:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
Is that right? I think this explanation should be included in the tutorial....
@bshannon Commented Yes.
I'm using NetBeans 8.2 and Java EE 8. I'm followed the tutorial but at the "Creating the dukes-age Application Using the Maven Archetype" point there is a problem, this line give error:
Because there are multiple match to the package javax.ws.rs through the "Search Dependency at Maven Repositories for javax.ws.rs" I get this:
so what I should choose? I think that the tutorial should explain this point.
I give to Oracle and all Users the right to post, access, discuss, use, publish, disseminate, and refine mine Submissions.