You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Andreas Sewe <se...@st.informatik.tu-darmstadt.de> on 2010/06/09 10:09:06 UTC

[classlib] HARMONY-6546: Make JARs available to Maven repository?

Hi all,

Mark Hindess asked me to state my case on this list, so here I am: I 
yesterday filed <https://issues.apache.org/jira/browse/HARMONY-6546>, a 
request to make the JARs of the Harmony JRE available to a central Maven 
repository.

Here are my use cases for this: While tons of libraries are available in 
such repositories (if you don't like Maven, substitute the build 
management tool of your choice), this is not true of the JRE's; these 
JARs are simply assumed to exist and are typically not an explicit 
dependency of your project. Occasionally, however, you need control not 
of the JRE you run on, but of the one you compile against. 
Crosscompiling the Scala library (scalac itself ran on OpenJDK when I 
did the tests) against the Apache Harmony JRE exposed 
<https://issues.apache.org/jira/browse/HARMONY-6533>, for example. 
Similarly, a tool like <http://mojo.codehaus.org/animal-sniffer> would 
benefit from the JRE being available as a managed dependency. Currently, 
generating a API signature for a JRE different than the one you run on 
requires a lot of manual steps: 
<http://mojo.codehaus.org/animal-sniffer-maven-plugin/examples/generating-java-signatures.html>.

In summary, doing tests (which are akin to testing with different 
compilers in the C/C++ world) to ensure compatibility across JREs is 
difficult in the Java world; the JARs of *any* JRE are simply not 
available as a "normal" project dependency. (In fact, you cannot put the 
rt.jar of Sun's/Oracle's JRE in Maven central due to some click-through 
license of theirs.)

And here's where the Apache Harmony project could IMHO help out: upload 
the classlib's JARs to Maven central. As you have already figured the 
dependencies in your JRE for OSGi, you just need to turn them into Maven 
POMs. The resulting artifacts would then have coordinates 
(groupId:artifactId:packaging:classifier:version) like 
org.apache.harmony:luni:jar:linux-x86:6.0-M2.

Mark wrote HARMONY-6546:
> Some of the jars are quite tightly coupled with the portlibrary, vmi, etc. so would be difficult/impossible to deploy on a non-Harmony compatible VM.
>
> I'm curious how platform dependent jars - and corresponding native dlls - can be managed in maven repositories. 

Platform dependent JARs are not a problem; that's what the classifier 
dimension of the Maven coordinates is for. Whether you want to deploy 
the corresponding native DLLs to a Maven repository is a different 
question, however, as they are not needed for the use cases I outlined 
above. Furthermore, things like this might be useless on a non-Harmony 
compatible VM. That's an issue I am well aware of. (I do some Jikes RVM 
hacking for a PhD. :-) But having the JARs available would still be 
useful, I think.

Your thoughts?

Best wishes,

Andreas Sewe

Re: [classlib] HARMONY-6546: Make JARs available to Maven repository?

Posted by sebb <se...@gmail.com>.
On 09/06/2010, Andreas Sewe <se...@st.informatik.tu-darmstadt.de> wrote:
> Hi Tim,
>
>
> > From your description it sounds like you are not so much interested in
> > the implementation details of the Harmony JAR files, but you are looking
> > for "compile against JARs" for a full Java SE API.  Is that right?
> >
>
>  right. Unfortunately, grabbing the JARs of a full Java SE API is a lot
> harder with tools like Maven than grabbing the JARs of a plain-old library.
> The Sun/Oracle puts a click-through license in your way, which obviously
> blocks automated build tools like Maven. And GNU Classpath is not even
> distributed in binary form. It's always ./configure; make first. :-(
>
>  The Apache Harmony distribution is much nicer in this respect. The only
> thing that causes grief, besides it being not available in, say, Maven
> central, is that you have dozens of JARs with no dependency information your
> build tool understands (unless in OSGi-land). And manually building that
> classpath "to compile against" is not fun. I've been there...

For Maven builds, one can easily define a profile which changes the
compiler for builds and/or tests.

One just needs to install the Harmony JDK or JRE; no messing with
Maven dependencies.

We use this in Apache Commons for building components that are
targetted at Java 1.3 and 1.4 whilst still being able to run a version
of Maven which requires 1.5+.

>  I hope this clarifies things.
>
>  Andreas Sewe
>

Re: [classlib] HARMONY-6546: Make JARs available to Maven repository?

Posted by Andreas Sewe <se...@st.informatik.tu-darmstadt.de>.
Hi Tim,

> From your description it sounds like you are not so much interested in
> the implementation details of the Harmony JAR files, but you are looking
> for "compile against JARs" for a full Java SE API.  Is that right?

right. Unfortunately, grabbing the JARs of a full Java SE API is a lot 
harder with tools like Maven than grabbing the JARs of a plain-old 
library. The Sun/Oracle puts a click-through license in your way, which 
obviously blocks automated build tools like Maven. And GNU Classpath is 
not even distributed in binary form. It's always ./configure; make 
first. :-(

The Apache Harmony distribution is much nicer in this respect. The only 
thing that causes grief, besides it being not available in, say, Maven 
central, is that you have dozens of JARs with no dependency information 
your build tool understands (unless in OSGi-land). And manually building 
that classpath "to compile against" is not fun. I've been there...

I hope this clarifies things.

Andreas Sewe

Re: [classlib] HARMONY-6546: Make JARs available to Maven repository?

Posted by Tim Ellison <t....@gmail.com>.
On 09/Jun/2010 09:09, Andreas Sewe wrote:
> Hi all,
> 
> Mark Hindess asked me to state my case on this list, so here I am: I
> yesterday filed <https://issues.apache.org/jira/browse/HARMONY-6546>, a
> request to make the JARs of the Harmony JRE available to a central Maven
> repository.
> 
> Here are my use cases for this: While tons of libraries are available in
> such repositories (if you don't like Maven, substitute the build
> management tool of your choice), this is not true of the JRE's; these
> JARs are simply assumed to exist and are typically not an explicit
> dependency of your project. Occasionally, however, you need control not
> of the JRE you run on, but of the one you compile against.
> Crosscompiling the Scala library (scalac itself ran on OpenJDK when I
> did the tests) against the Apache Harmony JRE exposed
> <https://issues.apache.org/jira/browse/HARMONY-6533>, for example.
> Similarly, a tool like <http://mojo.codehaus.org/animal-sniffer> would
> benefit from the JRE being available as a managed dependency. Currently,
> generating a API signature for a JRE different than the one you run on
> requires a lot of manual steps:
> <http://mojo.codehaus.org/animal-sniffer-maven-plugin/examples/generating-java-signatures.html>.
> 
> 
> In summary, doing tests (which are akin to testing with different
> compilers in the C/C++ world) to ensure compatibility across JREs is
> difficult in the Java world; the JARs of *any* JRE are simply not
> available as a "normal" project dependency. (In fact, you cannot put the
> rt.jar of Sun's/Oracle's JRE in Maven central due to some click-through
> license of theirs.)
> 
> And here's where the Apache Harmony project could IMHO help out: upload
> the classlib's JARs to Maven central. As you have already figured the
> dependencies in your JRE for OSGi, you just need to turn them into Maven
> POMs. The resulting artifacts would then have coordinates
> (groupId:artifactId:packaging:classifier:version) like
> org.apache.harmony:luni:jar:linux-x86:6.0-M2.
> 
> Mark wrote HARMONY-6546:
>> Some of the jars are quite tightly coupled with the portlibrary, vmi,
>> etc. so would be difficult/impossible to deploy on a non-Harmony
>> compatible VM.
>>
>> I'm curious how platform dependent jars - and corresponding native
>> dlls - can be managed in maven repositories. 
> 
> Platform dependent JARs are not a problem; that's what the classifier
> dimension of the Maven coordinates is for. Whether you want to deploy
> the corresponding native DLLs to a Maven repository is a different
> question, however, as they are not needed for the use cases I outlined
> above. Furthermore, things like this might be useless on a non-Harmony
> compatible VM. That's an issue I am well aware of. (I do some Jikes RVM
> hacking for a PhD. :-) But having the JARs available would still be
> useful, I think.

Hi Andreas.

>From your description it sounds like you are not so much interested in
the implementation details of the Harmony JAR files, but you are looking
for "compile against JARs" for a full Java SE API.  Is that right?

Regards,
Tim