You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Brett Porter <br...@apache.org> on 2005/06/13 01:57:31 UTC
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based
on RC3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stephen Colebourne wrote:
| Brett Porter wrote:
|
|> | Some jar files are build with JDK1.5 (according to the manifest).
commons-jelly-1.0.jar/commons-jelly-tags-xml-1.1.jar.
|>
|> But compiled for JDK 1.3, as Simon mentioned.
|
|
| See my digester mail on this topic. IMHO, using the flag is insufficient.
Are you saying it will bind to something identical code would bind to
differently on JDK 1.3, or code that compiles on 1.5 may not run on 1.3
because it also wouldn't compile there?
If it is the former, do you have a fragment of code that exhibits this?
You mentioned append(StringBuffer), but I can't think why it would bind
to that unless you passed it a string buffer.
In the latter case, admittedly, it is safer to compile against the
runtime you are targetting, as it will fail if you have used something
you weren't supposed to. But if you know it does compile on that JDK,
then it would be safe to compile on any.
You can use Maven to compile on a different JDK than that running the
app, using the maven.compile.executable property:
http://maven.apache.org/reference/plugins/java/properties.html
|
|> | A nice to have would be the conversion to windows line endings of
some files. At least the README and LICENSE at the top level would be nice.
|>
|> done
|
|
| RC4 still has unix line endings in the zips for README and LICENSE.
But this won't stop a release.
That must be in the source, I guess I only did it for the binary
distribution.
Also, on your point about "maven site" not working on the source tree,
"maven xdoc" would to generate the documentation without reports, which
is probably what I'd want users to run, but it is not as well known of.
We should include the other files.
I won't block the release on these, so I'll add them both to JIRA.
Thanks,
Brett
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCrMvrOb5RoQhMkRMRAnDAAJ9jnaGQ+1+xU0XULZp1WmQs7fsVaACgs/B/
6x8Zk5QsN/mJIHfhEUM4S6I=
=qh+J
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based
on RC3
Posted by Brett Porter <br...@apache.org>.
Phil,
Right - I should have pointed that out about forking. Really, the plugin
should automatically fork if executable is set...
For the manifest, this just indicates that the executing JVM was used to
build the JAR and manifest. It doesn't seem that useful to fork this
with an old JDK - you could write those manifest entries yourself based
on the JDK you selected.
In Maven 2, I'd hope that you would be able to select an entire external
tool chain and apply it consistently so this doesn't happen.
Cheers,
Brett
Phil Steitz wrote:
><snip/>
>
>
>>You can use Maven to compile on a different JDK than that running the
>>app, using the maven.compile.executable property:
>>http://maven.apache.org/reference/plugins/java/properties.html
>>
>>
>>
>
>Thanks, Brett! That seems to work, with the full path to the jdk
>javac executable as the value, but I seem to need to also specify
>maven.compile.fork=true
>to get it to take effect and pick up the 1.3 compile failure that I
>just discovered in [math] :-(
>
>When I remove the problem and do "maven jar" however, with this setup,
>I end up with Build-Jdk in the manifest showing the version of the jdk
>that launched maven. Any way around this?
>
>Phil
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based on RC3
Posted by Phil Steitz <ph...@gmail.com>.
<snip/>
>
> You can use Maven to compile on a different JDK than that running the
> app, using the maven.compile.executable property:
> http://maven.apache.org/reference/plugins/java/properties.html
>
Thanks, Brett! That seems to work, with the full path to the jdk
javac executable as the value, but I seem to need to also specify
maven.compile.fork=true
to get it to take effect and pick up the 1.3 compile failure that I
just discovered in [math] :-(
When I remove the problem and do "maven jar" however, with this setup,
I end up with Build-Jdk in the manifest showing the version of the jdk
that launched maven. Any way around this?
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source
Posted by Stephen Colebourne <sc...@btopenworld.com>.
Phil Steitz wrote:
> Thanks all for clarifying the issues here. Assuming the unit tests
> have good coverage, what would be the risks of the following strategy:
>
> 0. Test compile and unit tests using generated ant build running under
> minimum jdk
> 1. Build release jar using 1.4/5 JDK with compile target set
> 2. Compile and run unit tests under minimum JDK against the release jar
This is as good as you will get if you wish to compile under the latest JDK.
Personally, I doubt that the javac changes in the later version are
worth ths effort. Although some bugs may have been fixed in javac, the
chances are that others have been introduced - so why not just use the
correct javac version, with the nice side effect of the correct manifest
version.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source
Posted by Phil Steitz <ph...@gmail.com>.
Thanks all for clarifying the issues here. Assuming the unit tests
have good coverage, what would be the risks of the following strategy:
0. Test compile and unit tests using generated ant build running under
minimum jdk
1. Build release jar using 1.4/5 JDK with compile target set
2. Compile and run unit tests under minimum JDK against the release jar
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source
Posted by Simon Kitching <sk...@apache.org>.
On Tue, 2005-06-14 at 15:24 +1000, Brett Porter wrote:
> Firstly, I still believe if you've got sufficient testing, this isn't
> really necessary, and this discussion is getting a little carried away.
The problem is that testing is supposed to be done by the unit tests.
But the unit tests won't pick this up, even when testers download the
source onto a machine with jdk1.3 and run "maven test".
The only way this would be picked up is if someone downloads a RC jar
file pre-built and then runs it in an application that uses the class
that has the problem. And that can't be relied upon for commons projects
with fairly small user bases.
Having problems that aren't found by the unit tests isn't good.
> There are very limited cases where this is a problem in the current JDKs
> (theoretically there could be more, but it seems so far that
> StringBuffer one is the primary one).
Yes, but that one problem is a nasty one. It is not at all unlikely for
code to pass a StringBuffer object to a PrintStream.
>
> Using compile.executable is going to be sufficient in Maven.
Yes, I think so too. I can't think of any problems with this approach.
I certainly wouldn't like to move back to Ant builds, and don't see any
reason why that would be necessary as long as maven.compile.executable
is available.
> The other issue is what is generated in the manifest under
> Build-jdk. Well, that's not even documented in
> http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest.
> It appears to be something Ant and Maven both set, but the JAR tools
> doesn't. It should *not* be used as an indication of what JDK it was
> designed to run on. So I don't see this as a problem.
I agree. It's a nice-to-have but not necessary. The project
documentation should describe what JVM is supported.
Of course if this suggestion were implemented then this would be solved
completely:
http://marc.theaimsgroup.com/?l=turbine-maven-dev&m=111870499228817&w=2
>
> Let's not forget the downsides of using JDK 1.3 to compile the sources.
> That's now an EOL'd JDK. Someone has already mentioned (I have no idea
> if it is true), that a newer javac could have less bugs and generate
> better bytecode even when targetting an older JVM. Not to mention the
> massive inconvenience it is to maintain a separate JDK, and to swtich to
> it for certain builds and not others.
True, newer javac versions should be better. That's why I wanted to
avoid compiling on old systems - but I believe the StringBuffer example
proves that it's just not avoidable.
>
> Wouldn't it be nice if javac could utilise all those @since tags in
> rt.jar to do this for you? :)
Agreed!
I've been thinking about enhancing clirr to detect exactly these sorts
of issues. The @since tags just aren't reliable enough, but it should be
possible to compare two rt.jar files with clirr and generate a list of
methods added, then flag code which calls an "added" method.
>
> IMO, I think compile.source|target is good enough, as long as you have
> enough coverage and someone is testing on the JDKs you intend to target.
Unfortunately I can't agree - for commons projects at least. Maybe for
bigger projects with more thorough release cycles such as Tomcat and
Maven it can be assumed that someone out there will test a binary
download against all the supported JVMs.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source
Posted by Brett Porter <br...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Firstly, I still believe if you've got sufficient testing, this isn't
really necessary, and this discussion is getting a little carried away.
There are very limited cases where this is a problem in the current JDKs
(theoretically there could be more, but it seems so far that
StringBuffer one is the primary one).
Using compile.executable is going to be sufficient in Maven. Ant can't
offer you any more here, except that you can actually run it under the
lower JDK. That's not necessary to guarantee the classes work under
them. The other issue is what is generated in the manifest under
Build-jdk. Well, that's not even documented in
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest.
It appears to be something Ant and Maven both set, but the JAR tools
doesn't. It should *not* be used as an indication of what JDK it was
designed to run on. So I don't see this as a problem.
Let's not forget the downsides of using JDK 1.3 to compile the sources.
That's now an EOL'd JDK. Someone has already mentioned (I have no idea
if it is true), that a newer javac could have less bugs and generate
better bytecode even when targetting an older JVM. Not to mention the
massive inconvenience it is to maintain a separate JDK, and to swtich to
it for certain builds and not others.
Wouldn't it be nice if javac could utilise all those @since tags in
rt.jar to do this for you? :)
IMO, I think compile.source|target is good enough, as long as you have
enough coverage and someone is testing on the JDKs you intend to target.
- - Brett
Phil Steitz wrote:
|Ecch is right. Do you think that setting the maven.compile.executable
|property is good enough or do you think we need to have ant build the
|jars?
|
|Phil
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCrmoPOb5RoQhMkRMRAlzQAKC36j4Kh7X7AC/nKLVTXjk2s0UJnACdH8Hl
NHNTg9LKG1/gzbradySKuB0=
=GSqX
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source
Posted by Phil Steitz <ph...@gmail.com>.
Ecch is right. Do you think that setting the maven.compile.executable
property is good enough or do you think we need to have ant build the
jars?
Phil
On 6/13/05, Simon Kitching <sk...@apache.org> wrote:
> On Mon, 2005-06-13 at 13:15 +0100, Stephen Colebourne wrote:
> > --- Simon Kitching <sk...@apache.org> wrote:
> > [snip theorectical example of problem using
> > PrintStream]
> >
> > One real example is StringBuffer.append(StringBuffer)
> > as I said before. The problem is exactly as Simon
> > described, around overloaded methods.
>
> Hmm..yes.
> StringBuffer.append(Object) since 1.0 ??
> StringBuffer.append(StringBuffer) since 1.4
>
> That is definitely a real possibility for problems.
>
> I think I'm convinced that Stephen is right, and that releases should
> always be compiled using the lowest JVM supported for the release. Ecch.
>
> Regards,
>
> Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source
Posted by Simon Kitching <sk...@apache.org>.
On Mon, 2005-06-13 at 13:15 +0100, Stephen Colebourne wrote:
> --- Simon Kitching <sk...@apache.org> wrote:
> [snip theorectical example of problem using
> PrintStream]
>
> One real example is StringBuffer.append(StringBuffer)
> as I said before. The problem is exactly as Simon
> described, around overloaded methods.
Hmm..yes.
StringBuffer.append(Object) since 1.0 ??
StringBuffer.append(StringBuffer) since 1.4
That is definitely a real possibility for problems.
I think I'm convinced that Stephen is right, and that releases should
always be compiled using the lowest JVM supported for the release. Ecch.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based on RC3
Posted by Stephen Colebourne <sc...@btopenworld.com>.
--- Simon Kitching <sk...@apache.org> wrote:
[snip theorectical example of problem using
PrintStream]
One real example is StringBuffer.append(StringBuffer)
as I said before. The problem is exactly as Simon
described, around overloaded methods.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0
based on RC3
Posted by Simon Kitching <sk...@apache.org>.
On Mon, 2005-06-13 at 13:08 +1000, Brett Porter wrote:
> Hi Hans,
>
> This is exactly what I meant. Thanks for confirming that it has worked
> this time on JDK 1.3. The question I'm still uncertain of is whether it
> is possible that JDK 1.5, with -target 1.3 but it's own rt.jar, would
> ever generate bytecode that won't work on 1.3, even if the source itself
> would have compiled as is on 1.3. I can't think of such a case, but
> Stephen raised it as a potential issue and I'm hoping he can clarify if
> that's what he meant with an example.
Here's one theoretical problem.
java 1.3:
class String {...}
class PrintStream {
public void println(String s) {...}
}
java 1.5:
class String implements CharSequence {...}
class PrintStream {
public void println(String s) {...}
// nb: this method doesn't actually exist
public void println(CharSequence s) {...}
}
User Code:
class HelloWorld {
....
String s = new String("Hello, world");
System.out.println(s);
}
When compiling under 1.3, the HelloWorld.class file will definitely have
a call to PrintStream.println(String).
When compiling under 1.5, the HelloWorld.class file might end up
containing a call to PrintStream.println(CharSequence).
Thus the source compiles and runs under 1.3. But when compiled under 1.5
it fails to run under 1.3 because "PrintStream.println(CharSequence)"
doesn't exist.
I think it's fairly unlikely. However it's possible as resolving calls
to overloaded methods is done at compile time; the .class file contains
a reference to a method with a specific signature so that the linking
process doesn't need to go around computing the best signature match
etc.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based
on RC3
Posted by Brett Porter <br...@apache.org>.
Hi Hans,
This is exactly what I meant. Thanks for confirming that it has worked
this time on JDK 1.3. The question I'm still uncertain of is whether it
is possible that JDK 1.5, with -target 1.3 but it's own rt.jar, would
ever generate bytecode that won't work on 1.3, even if the source itself
would have compiled as is on 1.3. I can't think of such a case, but
Stephen raised it as a potential issue and I'm hoping he can clarify if
that's what he meant with an example.
- Brett
Hans Gilde wrote:
>Well, targeting the 1.3 class file definition won't prevent it from using
>the rt.jar in your 1.5 JDK... thus possible compiling against an API that is
>in 1.3. In fact, this is not the case and I tried it... but just pointing it
>out.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based on RC3
Posted by Phil Steitz <ph...@gmail.com>.
Thanks, Simon!
On 6/25/05, Simon Kitching <sk...@apache.org> wrote:
> On Sat, 2005-06-25 at 21:34 -0700, Phil Steitz wrote:
> > Before I roll an RC, I need consensus on how we should be doing this.
> > I see three alternatives, with the PITA level increasing in order:
> >
> > 1. Don't worry, be happy - just set maven.compile.target=1.3 and use
> > maven dist under 1.4 (or 1.5) to generate the jars and roll the
> > distros.
> >
> > 2. Add the following to project.properties
> > # Fill in path to build JDK or specify this in local build.properties
> > # When building distribution jars, should use JDK 1.3
> > # maven.compile.executable=
> > maven.compile.fork=true
> > maven.compile.target=1.3
> > maven.jar.manifest=MANIFEST.MF
> > then specify maven.compile.executable in build.properties and add a
> > MANIFEST.MF file containing one line:
> > Build-Jdk: 1.3
> > (maven will merge that one line into the manifest that it generates,
> > making it correct).
>
> Option 2 looks good to me. (I presume you mean setting
> maven.compile.executable in project.properties).
No, I meant build.properties, since that is where at least I put local
stuff (things like maven.username and other local stuff) and maven
will pick this up. I think commons-build has a
build.properties.sample with this kind of thing.
>
> > I am by no means a jdk expert, but from what has been said above, it
> > looks to me like 1 and 2 both carry some risk (the risk in 2 being due
> > to lack of classpath control). It would seem, though, that if the
> > tests all pass when compiled and run under 1.3 against the 1.4 jar,
> > the risk in even 1. is small (assuming path coverage is good).
>
> I don't understand what you mean by "lack of classpath control".
I think someone mentioned that maven.compile.executable just sets the
path to the javac executable. The java classpath used could still
include, e.g. rt.jar from the "parent" jdk. I don't think maven
exposes properties like ant.bootclasspath and ant.classpath that allow
you to control the classpath used when compiling the jar. It is quite
possible that I have this wrong, but it makes sense to me (since maven
builds the classpath from the POM).
>
> I would agree that compiling the core code under 1.4 or 1.5 then
> compiling and running the tests under 1.3 is sufficient to assure 1.3
> compatibility. However I'm not sure that a simple and reliable way of
> doing that can be found.
Well, I have done it manually for math 1.1. It would have to be sort
of a release validation step. I just hack the maven-generated
build.xml to add the release jar to the classpath, omit compiling the
code, compile the tests and run the test goal, executing ant with
.antrc specifying the different jdks. I suppose I could commit the
test-jar.xml and we could just always do this as part of validation.
Actually, I have often thought that running the tests against the
release jars (not the compiled classes) would be a good general
release validation practice. I remember runniing into a funny
velocity problem last year that did not show up in the tests because
the there were some classes ommitted from the release jars.
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0
based on RC3
Posted by Simon Kitching <sk...@apache.org>.
On Sat, 2005-06-25 at 21:34 -0700, Phil Steitz wrote:
> Before I roll an RC, I need consensus on how we should be doing this.
> I see three alternatives, with the PITA level increasing in order:
>
> 1. Don't worry, be happy - just set maven.compile.target=1.3 and use
> maven dist under 1.4 (or 1.5) to generate the jars and roll the
> distros.
>
> 2. Add the following to project.properties
> # Fill in path to build JDK or specify this in local build.properties
> # When building distribution jars, should use JDK 1.3
> # maven.compile.executable=
> maven.compile.fork=true
> maven.compile.target=1.3
> maven.jar.manifest=MANIFEST.MF
> then specify maven.compile.executable in build.properties and add a
> MANIFEST.MF file containing one line:
> Build-Jdk: 1.3
> (maven will merge that one line into the manifest that it generates,
> making it correct).
Option 2 looks good to me. (I presume you mean setting
maven.compile.executable in project.properties).
> I am by no means a jdk expert, but from what has been said above, it
> looks to me like 1 and 2 both carry some risk (the risk in 2 being due
> to lack of classpath control). It would seem, though, that if the
> tests all pass when compiled and run under 1.3 against the 1.4 jar,
> the risk in even 1. is small (assuming path coverage is good).
I don't understand what you mean by "lack of classpath control".
I would agree that compiling the core code under 1.4 or 1.5 then
compiling and running the tests under 1.3 is sufficient to assure 1.3
compatibility. However I'm not sure that a simple and reliable way of
doing that can be found. Option 2 does carry the disadvantages of
shipping code compiled with a potentially inferior compiler but I still
think it's the best of the available options.
The later choices are just too horrible to contemplate.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: maven.compile.source was: [vote] Release Commons Jelly 1.0 based on RC3
Posted by Phil Steitz <ph...@gmail.com>.
To see if the code generated by 1.3 or 1.4 javac behaved any
differently, I compiled jars using both and ran the math tests against
these jars under 1.3, 1.4. Tests all passed (once 1.4 dependencies
had been removed from code and tests) and the elapsed time was not
significantly different (no consistent directional difference). Of
course, this is not a scientific test, though it does support the
hypothesis that compiling math jars, at least, using 1.3 will not
result in degraded performance.
Before I roll an RC, I need consensus on how we should be doing this.
I see three alternatives, with the PITA level increasing in order:
1. Don't worry, be happy - just set maven.compile.target=1.3 and use
maven dist under 1.4 (or 1.5) to generate the jars and roll the
distros.
2. Add the following to project.properties
# Fill in path to build JDK or specify this in local build.properties
# When building distribution jars, should use JDK 1.3
# maven.compile.executable=
maven.compile.fork=true
maven.compile.target=1.3
maven.jar.manifest=MANIFEST.MF
then specify maven.compile.executable in build.properties and add a
MANIFEST.MF file containing one line:
Build-Jdk: 1.3
(maven will merge that one line into the manifest that it generates,
making it correct).
3. Add a hand-coded build-jar.xml and build the jar with Ant using
.antrc or the command line to set the jdk. Then pre-goal dist in
maven.xml to replace the maven-generated jar with the ant jar.
Unfortunatly, I can't get maven to fork a new Ant process (so it picks
up .antrc), so the dist has to be done in two steps.
4. Abandon maven altogether for the dist, hand-coding the whole mess
in Ant (ugh!)
I am by no means a jdk expert, but from what has been said above, it
looks to me like 1 and 2 both carry some risk (the risk in 2 being due
to lack of classpath control). It would seem, though, that if the
tests all pass when compiled and run under 1.3 against the 1.4 jar,
the risk in even 1. is small (assuming path coverage is good).
So...which of these is the best, or is there a better way that I have missed?
tia,
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: maven.compile.source was: [vote] Release Commons Jelly 1.0
based on RC3
Posted by Simon Kitching <sk...@apache.org>.
On Mon, 2005-06-13 at 13:12 +0100, Stephen Colebourne wrote:
> --- Simon Kitching <sk...@apache.org> wrote:
> > An option is to put something like this in the
> > project.properties:
> >
> > maven.junit.fork=true
> > maven.junit.jvm=/path/to/jvm12/bin/java
> >
> > The code then gets compiled with the very best javac
> > implementation
> > available (eg 1.5), but unit-tested using the lowest
> > JVM supported. As
> > long as the unit tests have good coverage this
> > should detect any
> > problems with code calling methods not available on
> > the target JVM.
>
> This works if maven runs its tests using the jar.
> Often, the tests are run from a directory of class
> files just compiled for the test.
Sorry, I didn't follow that. Why does it matter whether the test classes
are in a jar or not?
>
> Of course, I should point out that this doesn't really
> gain you anything. Since you must have the lower JDK
> on your box to run the tests, why not compile using
> the lower JDK too. That way, you get the correct
> manifest in the jar - something that I often look at.
What it means is that the actual released code is compiled using the
best java compiler available. Javac should improve with each release.
The manifest will indeed show the java version used to compile the code,
rather than the minimum java version supported by the product. I've been
meaning to request that maven2 include a dependency tag in the pom to
specify supported java version; that could also be used to insert that
info into the manifest.
Note that I'm not disagreeing with Stephen's recommendation of compiling
with the oldest jvm supported; I'm just suggesting another option.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: maven.compile.source was: [vote] Release Commons Jelly 1.0 based on RC3
Posted by Stephen Colebourne <sc...@btopenworld.com>.
--- Simon Kitching <sk...@apache.org> wrote:
> An option is to put something like this in the
> project.properties:
>
> maven.junit.fork=true
> maven.junit.jvm=/path/to/jvm12/bin/java
>
> The code then gets compiled with the very best javac
> implementation
> available (eg 1.5), but unit-tested using the lowest
> JVM supported. As
> long as the unit tests have good coverage this
> should detect any
> problems with code calling methods not available on
> the target JVM.
This works if maven runs its tests using the jar.
Often, the tests are run from a directory of class
files just compiled for the test.
Of course, I should point out that this doesn't really
gain you anything. Since you must have the lower JDK
on your box to run the tests, why not compile using
the lower JDK too. That way, you get the correct
manifest in the jar - something that I often look at.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: maven.compile.source was: [vote] Release Commons Jelly 1.0
based on RC3
Posted by Simon Kitching <sk...@apache.org>.
On Sun, 2005-06-12 at 22:12 -0400, Hans Gilde wrote:
> Well, targeting the 1.3 class file definition won't prevent it from using
> the rt.jar in your 1.5 JDK... thus possible compiling against an API that is
> in 1.3. In fact, this is not the case and I tried it... but just pointing it
> out.
Just a thought...
An option is to put something like this in the project.properties:
maven.junit.fork=true
maven.junit.jvm=/path/to/jvm12/bin/java
The code then gets compiled with the very best javac implementation
available (eg 1.5), but unit-tested using the lowest JVM supported. As
long as the unit tests have good coverage this should detect any
problems with code calling methods not available on the target JVM.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: maven.compile.source was: [vote] Release Commons Jelly 1.0 based
on RC3
Posted by Hans Gilde <hg...@gmail.com>.
Well, targeting the 1.3 class file definition won't prevent it from using
the rt.jar in your 1.5 JDK... thus possible compiling against an API that is
in 1.3. In fact, this is not the case and I tried it... but just pointing it
out.
-----Original Message-----
From: Brett Porter [mailto:brett@apache.org]
Sent: Sunday, June 12, 2005 7:58 PM
To: Jakarta Commons Developers List
Subject: Re: maven.compile.source was: [vote] Release Commons Jelly 1.0
based on RC3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stephen Colebourne wrote:
| Brett Porter wrote:
|
|> | Some jar files are build with JDK1.5 (according to the manifest).
commons-jelly-1.0.jar/commons-jelly-tags-xml-1.1.jar.
|>
|> But compiled for JDK 1.3, as Simon mentioned.
|
|
| See my digester mail on this topic. IMHO, using the flag is insufficient.
Are you saying it will bind to something identical code would bind to
differently on JDK 1.3, or code that compiles on 1.5 may not run on 1.3
because it also wouldn't compile there?
If it is the former, do you have a fragment of code that exhibits this?
You mentioned append(StringBuffer), but I can't think why it would bind
to that unless you passed it a string buffer.
In the latter case, admittedly, it is safer to compile against the
runtime you are targetting, as it will fail if you have used something
you weren't supposed to. But if you know it does compile on that JDK,
then it would be safe to compile on any.
You can use Maven to compile on a different JDK than that running the
app, using the maven.compile.executable property:
http://maven.apache.org/reference/plugins/java/properties.html
|
|> | A nice to have would be the conversion to windows line endings of
some files. At least the README and LICENSE at the top level would be nice.
|>
|> done
|
|
| RC4 still has unix line endings in the zips for README and LICENSE.
But this won't stop a release.
That must be in the source, I guess I only did it for the binary
distribution.
Also, on your point about "maven site" not working on the source tree,
"maven xdoc" would to generate the documentation without reports, which
is probably what I'd want users to run, but it is not as well known of.
We should include the other files.
I won't block the release on these, so I'll add them both to JIRA.
Thanks,
Brett
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCrMvrOb5RoQhMkRMRAnDAAJ9jnaGQ+1+xU0XULZp1WmQs7fsVaACgs/B/
6x8Zk5QsN/mJIHfhEUM4S6I=
=qh+J
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org