Java EE 5 APIs now in a Maven repository...
Bonjour, comment Java?
Finally, the Java EE 5 API jar has been published via a Maven
repository:
Check
href="https://maven-repository.dev.java.net/nonav/repository/javaee/">https://maven-repository.dev.java.net/nonav/repository/javaee/
So if you get this api jar file, you can compile the following class:
import javax.jms.Queue;
import javax.persistence.Entity;
import javax.mail.Session;
public class Foo {
public static void main(String[] args) {
Queue queue = null;
Session.getInstance(null);
}
}
In a Maven project defined by this pom file: (notice the scope value
which is 'provided')
? class="xml-pi-start">xml class="xml-pi-content">version="1.0" encoding="UTF-8" class="xml-pi-start">?>
class="xml-tag"><project class="xml-attribute">xmlns class="xml-attribute">= class="xml-value">"http://maven.apache.org/POM/4.0.0"
class="xml-attribute">xmlns:xsi class="xml-attribute">= class="xml-value">"http://www.w3.org/2001/XMLSchema-instance"
class="xml-attribute">xsi:schemaLocation class="xml-attribute">= class="xml-value">"http://maven.apache.org/POM/4.0.0 " title="http://maven.apache.org/maven-v4_0_0.xsd"">http://maven.apache.org/maven-v4_0_0.xsd" class="xml-tag">>
class="xml-tag"> <modelVersion class="xml-tag">>4.0.0 class="xml-tag"></modelVersion class="xml-tag">>
class="xml-tag"> <groupId class="xml-tag">>foo class="xml-tag"></groupId class="xml-tag">>
class="xml-tag"> <artifactId class="xml-tag">>bar class="xml-tag"></artifactId class="xml-tag">>
class="xml-tag"> <version class="xml-tag">>1.0-SNAPSHOT class="xml-tag"></version class="xml-tag">>
class="xml-tag"> <packaging class="xml-tag">>jar class="xml-tag"></packaging class="xml-tag">>
class="xml-tag"> <description class="xml-tag">>Java source code generation library class="xml-tag"></description class="xml-tag">> class="xml-tag">
<dependencies class="xml-tag">>
class="xml-tag"> <dependency class="xml-tag">>
class="xml-tag"> <groupId class="xml-tag">>javaee class="xml-tag"></groupId class="xml-tag">>
class="xml-tag"> <artifactId class="xml-tag">>javaee-api class="xml-tag"></artifactId class="xml-tag">>
class="xml-tag"> <version class="xml-tag">>5 class="xml-tag"></version class="xml-tag">>
class="xml-tag"> <scope class="xml-tag">>provided class="xml-tag"></scope class="xml-tag">>
class="xml-tag"> </dependency class="xml-tag">>
class="xml-tag"> </dependencies class="xml-tag">>
class="xml-tag"></project>You can compile you code with this jar, but of course you cannnot run
your application with it since it contains only the Java EE 5
APIs and does not contain any method bodies. If you try to
run, you would get this exception:
Exception in thread "main" java.lang.ClassFormatError:
style="font-style: italic;">
Absent Code
attribute in method that is not native or abstract in class file
javax/mail/Session
In order to execute a Java EE 5 application, you'll still need a Java
EE 5 container, like for example the href="https://glassfish.dev.java.net">GlassFish application
server.
Ludo
- Login or register to post comments
- Printer-friendly version
- ludo's blog
- 20499 reads





