Date   

Re: Request for Maven Java EE 8 artifact

Ondrej Mihályi
 

Hi Bill,

Since the API artifact is distributed as a maven artifact, does it make sense to consider non-maven scenarios? It shouldn't be a problem to configure the Java EE maven project to produce both a lightweight artifact without dependencies and a fat shaded JAR, which would be distributed for people not using maven.

From a maven user's perspective, it's always been very weird to depend on a single shaded JAR artifact, without an option to depend on a non-shaded JAR that pulls in transitive dependencies. Most other projects provide both types of artifacts, the shaded fat one usually suffixed with -with-dependencies, e.g. javaee-api-with-dependencies.jar

I would strongly recommend going in line with the common practice of delivering both types of API artifacts. Of course, vendors can provide their own non-shaded API artifacts, but having a standard one would make life a lot easier for maven users.

Ondro

2017-08-31 23:08 GMT+02:00 Bill Shannon <bill.shannon@...>:

Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!

Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>







Re: Request for Maven Java EE 8 artifact

Bill Shannon
 

I think you should take this up with the owners of the next release.

Ondrej Mihályi wrote on 08/31/2017 03:10 PM:

Hi Bill,

Since the API artifact is distributed as a maven artifact, does it make sense to consider non-maven scenarios? It shouldn't be a problem to configure the Java EE maven project to produce both a lightweight artifact without dependencies and a fat shaded JAR, which would be distributed for people not using maven.

From a maven user's perspective, it's always been very weird to depend on a single shaded JAR artifact, without an option to depend on a non-shaded JAR that pulls in transitive dependencies. Most other projects provide both types of artifacts, the shaded fat one usually suffixed with -with-dependencies, e.g. javaee-api-with-dependencies.jar

I would strongly recommend going in line with the common practice of delivering both types of API artifacts. Of course, vendors can provide their own non-shaded API artifacts, but having a standard one would make life a lot easier for maven users.

Ondro

2017-08-31 23:08 GMT+02:00 Bill Shannon <bill.shannon@...>:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!

Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>








Re: Request for Maven Java EE 8 artifact

Guillermo González de Agüero
 

I can imagine the answer, but is there a possibility that we could provide a pull request for this now?


Regards,

Guillermo González de Agüero


El vie., 1 de septiembre de 2017 0:20, Bill Shannon <bill.shannon@...> escribió:
I think you should take this up with the owners of the next release.


Ondrej Mihályi wrote on 08/31/2017 03:10 PM:
Hi Bill,

Since the API artifact is distributed as a maven artifact, does it make sense to consider non-maven scenarios? It shouldn't be a problem to configure the Java EE maven project to produce both a lightweight artifact without dependencies and a fat shaded JAR, which would be distributed for people not using maven.

From a maven user's perspective, it's always been very weird to depend on a single shaded JAR artifact, without an option to depend on a non-shaded JAR that pulls in transitive dependencies. Most other projects provide both types of artifacts, the shaded fat one usually suffixed with -with-dependencies, e.g. javaee-api-with-dependencies.jar

I would strongly recommend going in line with the common practice of delivering both types of API artifacts. Of course, vendors can provide their own non-shaded API artifacts, but having a standard one would make life a lot easier for maven users.

Ondro

2017-08-31 23:08 GMT+02:00 Bill Shannon <bill.shannon@...>:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!

Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>








Re: Request for Maven Java EE 8 artifact

Guillermo González de Agüero
 

I hope we have a chance to decide ;)


El jue., 31 de agosto de 2017 23:15, Kevin Sutter <kwsutter@...> escribió:
>  In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.

There's going to be a Java EE 9?  ;-)

On Thu, Aug 31, 2017 at 4:08 PM, Bill Shannon <bill.shannon@...> wrote:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!


Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>







Re: Request for Maven Java EE 8 artifact

Bill Shannon
 

No, sorry.

Guillermo González de Agüero wrote on 08/31/2017 03:35 PM:

I can imagine the answer, but is there a possibility that we could provide a pull request for this now?


Regards,

Guillermo González de Agüero

El vie., 1 de septiembre de 2017 0:20, Bill Shannon <bill.shannon@...> escribió:
I think you should take this up with the owners of the next release.


Ondrej Mihályi wrote on 08/31/2017 03:10 PM:
Hi Bill,

Since the API artifact is distributed as a maven artifact, does it make sense to consider non-maven scenarios? It shouldn't be a problem to configure the Java EE maven project to produce both a lightweight artifact without dependencies and a fat shaded JAR, which would be distributed for people not using maven.

From a maven user's perspective, it's always been very weird to depend on a single shaded JAR artifact, without an option to depend on a non-shaded JAR that pulls in transitive dependencies. Most other projects provide both types of artifacts, the shaded fat one usually suffixed with -with-dependencies, e.g. javaee-api-with-dependencies.jar

I would strongly recommend going in line with the common practice of delivering both types of API artifacts. Of course, vendors can provide their own non-shaded API artifacts, but having a standard one would make life a lot easier for maven users.

Ondro

2017-08-31 23:08 GMT+02:00 Bill Shannon <bill.shannon@...>:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!

Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>









Re: Request for Maven Java EE 8 artifact

Jason Greene
 

JEE ? ;)

On Aug 31, 2017, at 4:30 PM, Bill Shannon <bill.shannon@...> wrote:

Or whatever you guys end up calling it.

Not my problem!  :-)

Kevin Sutter wrote on 08/31/2017 02:14 PM:
>  In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.

There's going to be a Java EE 9?  ;-)

On Thu, Aug 31, 2017 at 4:08 PM, Bill Shannon <bill.shannon@...> wrote:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!


Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>








Re: Request for Maven Java EE 8 artifact

Jeff Genender
 

Love it!!

Jeff


On Aug 31, 2017, at 9:02 PM, Jason Greene <jason.greene@...> wrote:

JEE ? ;)

On Aug 31, 2017, at 4:30 PM, Bill Shannon <bill.shannon@...> wrote:

Or whatever you guys end up calling it.

Not my problem!  :-)

Kevin Sutter wrote on 08/31/2017 02:14 PM:
>  In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.

There's going to be a Java EE 9?  ;-)

On Thu, Aug 31, 2017 at 4:08 PM, Bill Shannon <bill.shannon@...> wrote:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!


Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>








Re: Request for Maven Java EE 8 artifact

Bill Shannon
 

That's it!  Clearly you guys don't appreciate what we're giving you!  The deal is off!!!

:-)

Jeff Genender wrote on 08/31/2017 09:13 PM:

Love it!!

Jeff


On Aug 31, 2017, at 9:02 PM, Jason Greene <jason.greene@...> wrote:

JEE ? ;)

On Aug 31, 2017, at 4:30 PM, Bill Shannon <bill.shannon@...> wrote:

Or whatever you guys end up calling it.

Not my problem!  :-)

Kevin Sutter wrote on 08/31/2017 02:14 PM:
>  In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.

There's going to be a Java EE 9?  ;-)

On Thu, Aug 31, 2017 at 4:08 PM, Bill Shannon <bill.shannon@...> wrote:
Java EE 8 is essentially done.

Your suggested fix would result in an API jar file that's not usable by people who aren't using Maven.

If some application server provides a beta API that's not exactly Java EE, it should probably provide an API jar file in its own namespace so that users will know that what they're getting is not Java EE.

In any event, I'm going to leave this as an issue to be dealt with for Java EE 9.  Maybe then it will all just be modules and we won't have to worry about this!


Guillermo González de Agüero wrote on 08/31/2017 02:06 AM:
Hi Bill,

Sorry, I wasn't able to look at the JAR contents the other day and I only checked the POM.

What we have now is, as you said, a JAR which contains all the API classes on it. Its pom declares all its dependencies at optional. But those dependencies there are useless for the end user, since they are shaded into the JAR, so I cannot exclude them.

Imagine I'm working on a Java EE 7 application server that I've patched to use CDI 2.0. What I'd like to do is:

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


However, with the CDI 1.2 classes being bundled inside the Java EE API JAR, Maven can't remove them, and the compiler will find two versions of the same classes. If I try to use a method added in 2.0 to an existing class it doesn't compile as it happens to find the 1.2 version first.

The solution would be to remove all content from the Java EE API jar, and just mark all its dependencies as optional=false. That way, any application dependent on it will get all the APIs directly, while being able to exclude specific parts of it. Specific implementations could then be removed since the artifact would only depend on other already compiled artifacts.

This usecase will be more important as we move to more composable and customizable runtimes. Also, it's common for vendors to release beta versions of their server with just a few updated specs. There's an open source application server that is still not Java EE 7 certified as it lacks JPA 2.1 support, but everything else is there. I could exclude the JPA 2.1 API artifact and include the 2.0 one in that case. The way it works now, I'd have to put the Java EE 7 dependency and be careful not to use any JPA 2.1 added methods or classes.

My examples were on Java EE 7 which obviously cannot be changed at this point, but hopefelly we can make it for Java EE 8?


Regards,

Guillermo González de Agüero


El mié., 30 de agosto de 2017 23:46, Bill Shannon <bill.shannon@...> escribió:
The Maven project that builds the API jar file does so by recompiling all the javax.* source files.  Because some of these source files have static dependencies on non-javax.* classes, those classes are needed when compiling.  Those other classes are not included in the API jar file.

Is this causing a problem for you, or does it just seem weird?

Guillermo González de Agüero wrote on 08/22/17 08:44 AM:
Excuse me all for flooding.

The JSF dependency I was seeing is Mojarra implementation, which I don't think belongs there:

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

That's present in both the web and full poms. I guess that one can be removed and then only a javax.* JavaMail would be needed.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:40, Guillermo González de Agüero <z06.guillermo@...> escribió:
Sorry Lukas, didn't look at the content of the POM. Looks like you already took care of this. That's just great.

I see some implementation APIs there though for JSF and JavaMail. Could that APIs be also uploaded to Maven Central as you did with JPA (btw, that one also needs to be updated on the Pom)?

Thanks a lot for this Lukas.


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:31, Guillermo González de Agüero <z06.guillermo@...> escribió:
Thanks, now I see.

The last one seems to be from June. Could you please consider mi suggestion about the artifact layout?


Regards,

Guillermo González de Agüero

El mar., 22 de agosto de 2017 17:11, Lukas Jungmann <lukas.jungmann@...> escribió:
On 8/22/17 12:25 PM, Guillermo González de Agüero wrote:
> I can't see it on
> https://maven.java.net/content/repositories/snapshots/javax/ and I
> haven't heard of any snapshots being published. I thought that would
> need to wait until all specs were final.

try https://maven.java.net/content/repositories/promoted/javax/javaee-api/

thanks,
--lukas

>
>
> Regards,
>
> Guillermo González de Agüero
>
> El mar., 22 de agosto de 2017 11:48, Werner Keil <werner.keil@...
> <mailto:werner.keil@...>> escribió:
>
>     Shouldn't there be a snapshot version e.g. in java.net/maven
>     <http://java.net/maven>? (java.net <http://java.net> still exists at
>     least for that purpose)
>
>     Regards,
>     Werner
>
>









Platform wide guideline for build-in annotation literals?

Arjan Tijms
 

Hi,

CDI 2.0 introduced a number of very convenient build-in annotation literals, for many of the annotations it owns and for some it doesn't own (JSR 330).

See: http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#built_in_annotation_literals

I think something like this would be a prime candidate for an umbrella spec guideline so:

1. All specs do this for their relevant annotations (e.g. @Transactional in JTA, @ViewScoped in JSF, @RememberMe in Security, @Named in AtInject, etc)
2. All specs do this in a consistent way

Thoughts?

Kind regards,
Arjan Tijms


Re: Platform wide guideline for build-in annotation literals?

Michael Remijan
 

I'd say if there is an umbrella spec with these kinds of annotations then then it must be a requirement for the other specs to implement them.  Otherwise, leave the annotations within the individual specs so that it's more clear that the annotation only applies to code in that spec.  Once you move it to an umbrella spec, I'd just naturally assume it's able to be used anywhere.



On Tuesday, September 19, 2017, 6:45:08 AM CDT, Arjan Tijms <arjan.tijms@...> wrote:


Hi,

CDI 2.0 introduced a number of very convenient build-in annotation literals, for many of the annotations it owns and for some it doesn't own (JSR 330).

See: http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#built_in_annotation_literals

I think something like this would be a prime candidate for an umbrella spec guideline so:

1. All specs do this for their relevant annotations (e.g. @Transactional in JTA, @ViewScoped in JSF, @RememberMe in Security, @Named in AtInject, etc)
2. All specs do this in a consistent way

Thoughts?

Kind regards,
Arjan Tijms


Re: Platform wide guideline for build-in annotation literals?

Arjan Tijms
 

Sorry, that's not what I meant ;)

What I meant was that each annotation should of course stay within their respective spec. I.e. @Transactional should of course stay in JTA.

But the annotation literal support should be somewhat mandated by the umbrella spec, so that all specs provide those for their annotations (where applicable) and all specs do it in the same way.

For instance, CDI now has:

RequestScoped requestScopedLiteral = RequestScoped.Literal.INSTANCE;

So JSF should get:

ViewScoped viewScopedLiteral = ViewScoped.Literal.INSTANCE;

And not say:

ViewScoped viewScopedLiteral = ViewScoped.getAnnotation();

or 

ViewScoped viewScopedLiteral = ViewScoped.of(ViewScoped.class);

or ...

ViewScoped should of course stay within JSF and nothing should ever move to the umbrella spec. The umbrella spec should only establish a rule saying that annotation literals are to be done via [annotation class].Literal.INSTANCE;

Hope it's more clear now ;)

Kind regards,
Arjan Tijms

 


Re: Platform wide guideline for build-in annotation literals?

Bill Shannon
 

The CDI expert group didn't raise this at the platform level, and they didn't even do this consistently for their annotations, so I'm not clear on what their intent is with these annotation instances.  How would applications use them?  If there's a reason applications need to be able to create annotation instances, wouldn't it be better if it worked the same whether or not the annotation has members?  Maybe this really belongs in the JDK...

Arjan Tijms wrote on 9/19/17 9:00 AM:

Sorry, that's not what I meant ;)

What I meant was that each annotation should of course stay within their respective spec. I.e. @Transactional should of course stay in JTA.

But the annotation literal support should be somewhat mandated by the umbrella spec, so that all specs provide those for their annotations (where applicable) and all specs do it in the same way.

For instance, CDI now has:

RequestScoped requestScopedLiteral = RequestScoped.Literal.INSTANCE;

So JSF should get:

ViewScoped viewScopedLiteral = ViewScoped.Literal.INSTANCE;

And not say:

ViewScoped viewScopedLiteral = ViewScoped.getAnnotation();

or 

ViewScoped viewScopedLiteral = ViewScoped.of(ViewScoped.class);

or ...

ViewScoped should of course stay within JSF and nothing should ever move to the umbrella spec. The umbrella spec should only establish a rule saying that annotation literals are to be done via [annotation class].Literal.INSTANCE;

Hope it's more clear now ;)

Kind regards,
Arjan Tijms

 



Re: Platform wide guideline for build-in annotation literals?

Arjan Tijms
 

On Tue, Sep 19, 2017 at 12:09 pm, Bill Shannon wrote:
The CDI expert group didn't raise this at the platform level, and they didn't even do this consistently for their annotations
I'm not sure if there's any inconsistency, other than creating literals for the JSR 330 spec and including them in 299. Or is that what you're referring to?


, so I'm not clear on what their intent is with these annotation instances.  How would applications use them?
They're mostly used for the various builders that CDI has for dynamically adding annotations to beans. CDI already has a helper class for that that makes it somewhat easier (https://docs.jboss.org/cdi/api/2.0/javax/enterprise/util/AnnotationLiteral.html), but even with the helper class it's still a bit verbose.

For a practical example see: http://arjan-tijms.omnifaces.org/2017/08/dynamically-adding-interceptor-to-build.html

It's also used for lookups, as in this code:

myGreetings.select(NamedLiteral.of("northern")).get();

For the full context see: https://github.com/javaee-samples/javaee8-samples/blob/master/cdi/qualified-lookup/src/test/java/org/javaee8/cdi/qualified/lookup/QualifiedLookupTest.java#L41

In that latter example a bean is selected that has the @Named("northern") annotation applied to it.

If there's a reason applications need to be able to create annotation instances, wouldn't it be better if it worked the same whether or not the annotation has members? 
Perhaps, but without members the annotation instance is a totally static singleton, like enum values basically. With members this is obviously not the case.

Maybe this really belongs in the JDK...
Possibly indeed, but not sure how feasible it is to get that in.

For now Java EE support throughout all applicable specs (basically the specs that already leverage CDI) isn't that hard at all. Had I learned about this annotation literals a tiny bit earlier I could have added them trivially to JSF and Java EE security (if the spec lead and EG would have agreed, of course).

Kind regards,
Arjan Tijms







Arjan Tijms wrote on 9/19/17 9:00 AM:

Sorry, that's not what I meant ;)

What I meant was that each annotation should of course stay within their respective spec. I.e. @Transactional should of course stay in JTA.

But the annotation literal support should be somewhat mandated by the umbrella spec, so that all specs provide those for their annotations (where applicable) and all specs do it in the same way.

For instance, CDI now has:

RequestScoped requestScopedLiteral = RequestScoped.Literal.INSTANCE;

So JSF should get:

ViewScoped viewScopedLiteral = ViewScoped.Literal.INSTANCE;

And not say:

ViewScoped viewScopedLiteral = ViewScoped.getAnnotation();

or 

ViewScoped viewScopedLiteral = ViewScoped.of(ViewScoped.class);

or ...

ViewScoped should of course stay within JSF and nothing should ever move to the umbrella spec. The umbrella spec should only establish a rule saying that annotation literals are to be done via [annotation class].Literal.INSTANCE;

Hope it's more clear now ;)

Kind regards,
Arjan Tijms

 


Re: Platform wide guideline for build-in annotation literals?

Bill Shannon
 

Arjan Tijms wrote on 09/19/17 01:29 PM:
On Tue, Sep 19, 2017 at 12:09 pm, Bill Shannon wrote:
The CDI expert group didn't raise this at the platform level, and they didn't even do this consistently for their annotations
I'm not sure if there's any inconsistency, other than creating literals for the JSR 330 spec and including them in 299. Or is that what you're referring to?
Some of the annotations have literals and some do not.  There may be some rationale for why only some of the annotations need literals, but it wasn't explained.


, so I'm not clear on what their intent is with these annotation instances.  How would applications use them?
They're mostly used for the various builders that CDI has for dynamically adding annotations to beans. CDI already has a helper class for that that makes it somewhat easier (https://docs.jboss.org/cdi/api/2.0/javax/enterprise/util/AnnotationLiteral.html), but even with the helper class it's still a bit verbose.

For a practical example see: http://arjan-tijms.omnifaces.org/2017/08/dynamically-adding-interceptor-to-build.html

It's also used for lookups, as in this code:

myGreetings.select(NamedLiteral.of("northern")).get();

For the full context see: https://github.com/javaee-samples/javaee8-samples/blob/master/cdi/qualified-lookup/src/test/java/org/javaee8/cdi/qualified/lookup/QualifiedLookupTest.java#L41

In that latter example a bean is selected that has the @Named("northern") annotation applied to it.
Hopefully this is very much an advanced case and not something that typical applications will need to do.

If there's a reason applications need to be able to create annotation instances, wouldn't it be better if it worked the same whether or not the annotation has members? 
Perhaps, but without members the annotation instance is a totally static singleton, like enum values basically. With members this is obviously not the case.
If an annotation evolves to have members, would you still want a static instance?  Wouldn't it be simpler if there was always just one way to get an instance?

Maybe this really belongs in the JDK...
Possibly indeed, but not sure how feasible it is to get that in.

For now Java EE support throughout all applicable specs (basically the specs that already leverage CDI) isn't that hard at all. Had I learned about this annotation literals a tiny bit earlier I could have added them trivially to JSF and Java EE security (if the spec lead and EG would have agreed, of course).
Depending on each spec to do it means that some won't.

This is not the first thing about annotations that we wished every spec would handle.  I really wish we could push more of this into the JDK, or find a way to centralize all of this in a place that would apply to all Java EE uses of annotations automatically.

Lacking that, a "design pattern" as you suggest might be the best approach.  Another item for the future Eclipse project to address!  :-)


Javadoc for Java EE 8?

Kevin Sutter
 

In the past, the javadoc for Java EE was housed on docs.oracle.com like this for Java EE 7:

https://docs.oracle.com/javaee/7/api/

But, I can't find a corresponding site for Java EE 8.

Thanks, Kevin


Re: Javadoc for Java EE 8?

Ivar Grimstad
 

On Tue, Nov 28, 2017 at 5:41 PM Kevin Sutter <kwsutter@...> wrote:
In the past, the javadoc for Java EE was housed on docs.oracle.com like this for Java EE 7:

https://docs.oracle.com/javaee/7/api/

But, I can't find a corresponding site for Java EE 8.

Thanks, Kevin

--

Java Champion, JCP EC/EG Member, EE4J PMC, JUG Leader


Re: Javadoc for Java EE 8?

Jody Grassel
 

You can find it at https://javaee.github.io/javaee-spec/javadocs/


Re: Javadoc for Java EE 8?

Kevin Sutter
 

Thanks, Ivar...  Even Google couldn't find this for me...


Re: Javadoc for Java EE 8?

reza_rahman <reza_rahman@...>
 

We have discussed this issue offline with Oracle if I remember correctly. The suggestion was to redirect the old URLs that Google, etc pick up to the new location. I believe the outcome was that this will need to be tackled by the EE4J effort somehow (not really sure how without cooperation from Oracle).

Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone

-------- Original message --------
From: Kevin Sutter <kwsutter@...>
Date: 11/28/17 12:02 PM (GMT-05:00)
To: javaee-spec@javaee.groups.io
Subject: Re: [javaee-spec] Javadoc for Java EE 8?

Thanks, Ivar...  Even Google couldn't find this for me...


Re: Javadoc for Java EE 8?

David Delabassee
 

FWIW, https://javaee.github.io is an easy to remember URL for 'key' Java EE resources.

--David