You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Asmann, Roland" <Ro...@adesso.at> on 2010/12/07 11:14:17 UTC

Multiple JDKs

Hi all,

I was wondering if anybody ever had this problem...

I have a customer who is running a machine with a SUN JDK and one with 
an IBM JDK. Now, we've noticed there are some differences between the 
two, so I thought it would be best to release their artefacts for both 
JDKs... Question is, can I do this somehow with Maven in a single 
release-cycle or do I need to make separate releases?

Also, they currently have a problem in that they need SUN JDK 6 for most 
project, where one single module MUST be built with SUN JDK 5 because of 
a change in some classes. They are currently running the compiler-plugin 
with a bootclasspath for JDK 5, which isn't beautiful but works. Is 
there a way to have a single module use a different JDK from the others?

Thanks,

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Jörg Schaible <jo...@scalaris.com>.
Hi Roland

Asmann, Roland wrote:

[snip]

>>  > If you use toolchains, it should not matter what JRE you use to run
>> Maven,
>>  > the compiler plugin will use the toolchain you specify.
>>  >
>>  > The question you need to ask yourself is which JDK should the
>> toolchain be
>>  > driving, and I cannot answer that... if animal-sniffer says that they
>>  > are only using the public JRE api then it does not matter which JDK
>>  > you use.
>>
>> It does, if the JDK is not compatible. And this is the case for some
>> parts of JDBC 3 vs. 4 (included in Java 6).
> 
> Which appears to be the case here.
>>
>>  > And if you have surefire running with both JREs then you should be
>>  > safe anyway
>>
>> If your module e.g. implements a JDBC Connector this is simply not
>> possible (see commons-dbcp as precedence).
> 
> Any suggestions on how to solve this? The thing is that we really want
> to have the same version on both artifacts, since they are (more or
> less) the same.

We had the same problem for an artifact and took more or less the same 
solution like dbcp: One project with two "version lines" for the release - 
1.x for Java 5/JDBC 3 and 2.x for Java 6/JDBC 4. The code is the same, but 
compiling with Java 5 activated a profile that did filter the source code of 
the project before compiling (different source directory configured 
abviously) and set a different value for the property containing the 
project's version. The code filter used comments like (IIRC):

=========== %< =============
/*JDBC4**/

... code depending on JDBC 4

//*JDBC4*/
=========== %< =============

and replaced the starting comment with '/*JDBC4' and the ending comment with 
'JDBC4*/' when building for Java 5. However, this filter plugin is an 
internal one processing regular expressions on files, but I am quite sure 
there are some freely available that can do the same (or use antrunner 
plugin with an ant task).

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by "Asmann, Roland" <Ro...@adesso.at>.
On 07.12.2010 14:33, Jörg Schaible wrote:
> Hi Stephen,
>
> Stephen Connolly wrote:
>
>  > On 7 December 2010 10:37, Asmann, Roland <Ro...@adesso.at> wrote:
>  >
>  >> On 07.12.2010 11:29, Stephen Connolly wrote:
>  >> > On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at>
>  >> wrote:
>  >> >
>  >> > > Hi all,
>  >> > >
>  >> > > I was wondering if anybody ever had this problem...
>  >> > >
>  >> > > I have a customer who is running a machine with a SUN JDK and one
>  >> > > with an IBM JDK. Now, we've noticed there are some differences
>  >> > > between the two, so I thought it would be best to release their
>  >> > > artefacts for both JDKs... Question is, can I do this somehow with
>  >> > > Maven in a single release-cycle or do I need to make separate
>  >> > > releases?
>  >> > >
>  >> > >
>  >> > I would consider running the tests twice and have just one set of
>  >> > artifacts... Otherwise you will have a nightmare of a dependency
>  >> management.
>  >> >
>  >> > Run the tests first with ibm and second with sun/oracle that way you
>  >> > know your artifacts work on both JREs
>  >> >
>  >> OK, so that means I should configure my surefire to run with different
>  >> JDKs?
>  >> Also, with which JDK would you suggest that I run the complete build?
>  >>
>  >
>  > If you use toolchains, it should not matter what JRE you use to run
> Maven,
>  > the compiler plugin will use the toolchain you specify.
>  >
>  > The question you need to ask yourself is which JDK should the
> toolchain be
>  > driving, and I cannot answer that... if animal-sniffer says that they are
>  > only using the public JRE api then it does not matter which JDK you use.
>
> It does, if the JDK is not compatible. And this is the case for some parts
> of JDBC 3 vs. 4 (included in Java 6).

Which appears to be the case here.
>
>  > And if you have surefire running with both JREs then you should be safe
>  > anyway
>
> If your module e.g. implements a JDBC Connector this is simply not possible
> (see commons-dbcp as precedence).

Any suggestions on how to solve this? The thing is that we really want 
to have the same version on both artifacts, since they are (more or 
less) the same.
>
>  >> > > Also, they currently have a problem in that they need SUN JDK 6 for
>  >> most
>  >> > > project, where one single module MUST be built with SUN JDK 5
>  >> > > because
>  >> of
>  >> > > a change in some classes. They are currently running the
>  >> compiler-plugin
>  >> > > with a bootclasspath for JDK 5, which isn't beautiful but works. Is
>  >> > > there a way to have a single module use a different JDK from the
>  >> others?
>  >> > >
>  >> >
>  >> > Have a look at toolchains. Google is your friend. Toolchains support
>  >> > has been available for a while now, I know because I helped get it
> into
>  >> > a
>  >> number
>  >> > of plugins.
>  >> >
>  >> > Another thing you might consider is using
>  >> > animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
>  >> > signatures you use are only public
>  >> > signatures and not internal classes that are not part of the published
>  >> JRE
>  >> > API
>  >> >
>  >> Well, according to the customer they are definitely compiling against
>  >> the API. They say there is a change in some DB drivers or something (at
>  >> least something related to Oracle)... Have to inspect that a little
>  >> further myself though...
>  >>
>  >
>  > Might be the DB driver that is depending on non-public JRE classes
>
> Oracle provides two different drivers - one supporting JDBC 3, the other one
> JDBC 4.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

Re: Multiple JDKs

Posted by Jörg Schaible <jo...@scalaris.com>.
Hi Stephen,

Stephen Connolly wrote:

> On 7 December 2010 10:37, Asmann, Roland <Ro...@adesso.at> wrote:
> 
>> On 07.12.2010 11:29, Stephen Connolly wrote:
>> > On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at>
>> wrote:
>> >
>> >  > Hi all,
>> >  >
>> >  > I was wondering if anybody ever had this problem...
>> >  >
>> >  > I have a customer who is running a machine with a SUN JDK and one
>> >  > with an IBM JDK. Now, we've noticed there are some differences
>> >  > between the two, so I thought it would be best to release their
>> >  > artefacts for both JDKs... Question is, can I do this somehow with
>> >  > Maven in a single release-cycle or do I need to make separate
>> >  > releases?
>> >  >
>> >  >
>> > I would consider running the tests twice and have just one set of
>> > artifacts... Otherwise you will have a nightmare of a dependency
>> management.
>> >
>> > Run the tests first with ibm and second with sun/oracle that way you
>> > know your artifacts work on both JREs
>> >
>> OK, so that means I should configure my surefire to run with different
>> JDKs?
>> Also, with which JDK would you suggest that I run the complete build?
>>
> 
> If you use toolchains, it should not matter what JRE you use to run Maven,
> the compiler plugin will use the toolchain you specify.
> 
> The question you need to ask yourself is which JDK should the toolchain be
> driving, and I cannot answer that... if animal-sniffer says that they are
> only using the public JRE api then it does not matter which JDK you use.

It does, if the JDK is not compatible. And this is the case for some parts 
of JDBC 3 vs. 4 (included in Java 6).

> And if you have surefire running with both JREs then you should be safe
> anyway

If your module e.g. implements a JDBC Connector this is simply not possible 
(see commons-dbcp as precedence).

>> >  > Also, they currently have a problem in that they need SUN JDK 6 for
>> most
>> >  > project, where one single module MUST be built with SUN JDK 5
>> >  > because
>> of
>> >  > a change in some classes. They are currently running the
>> compiler-plugin
>> >  > with a bootclasspath for JDK 5, which isn't beautiful but works. Is
>> >  > there a way to have a single module use a different JDK from the
>> others?
>> >  >
>> >
>> > Have a look at toolchains. Google is your friend. Toolchains support
>> > has been available for a while now, I know because I helped get it into
>> > a
>> number
>> > of plugins.
>> >
>> > Another thing you might consider is using
>> > animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
>> > signatures you use are only public
>> > signatures and not internal classes that are not part of the published
>> JRE
>> > API
>> >
>> Well, according to the customer they are definitely compiling against
>> the API. They say there is a change in some DB drivers or something (at
>> least something related to Oracle)... Have to inspect that a little
>> further myself though...
>>
> 
> Might be the DB driver that is depending on non-public JRE classes

Oracle provides two different drivers - one supporting JDBC 3, the other one 
JDBC 4.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Stephen Connolly <st...@gmail.com>.
On 7 December 2010 10:37, Asmann, Roland <Ro...@adesso.at> wrote:

> On 07.12.2010 11:29, Stephen Connolly wrote:
> > On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at>
> wrote:
> >
> >  > Hi all,
> >  >
> >  > I was wondering if anybody ever had this problem...
> >  >
> >  > I have a customer who is running a machine with a SUN JDK and one with
> >  > an IBM JDK. Now, we've noticed there are some differences between the
> >  > two, so I thought it would be best to release their artefacts for both
> >  > JDKs... Question is, can I do this somehow with Maven in a single
> >  > release-cycle or do I need to make separate releases?
> >  >
> >  >
> > I would consider running the tests twice and have just one set of
> > artifacts... Otherwise you will have a nightmare of a dependency
> management.
> >
> > Run the tests first with ibm and second with sun/oracle that way you know
> > your artifacts work on both JREs
> >
> OK, so that means I should configure my surefire to run with different
> JDKs?
> Also, with which JDK would you suggest that I run the complete build?
>

If you use toolchains, it should not matter what JRE you use to run Maven,
the compiler plugin will use the toolchain you specify.

The question you need to ask yourself is which JDK should the toolchain be
driving, and I cannot answer that... if animal-sniffer says that they are
only using the public JRE api then it does not matter which JDK you use.
And if you have surefire running with both JREs then you should be safe
anyway


> >
> >  > Also, they currently have a problem in that they need SUN JDK 6 for
> most
> >  > project, where one single module MUST be built with SUN JDK 5 because
> of
> >  > a change in some classes. They are currently running the
> compiler-plugin
> >  > with a bootclasspath for JDK 5, which isn't beautiful but works. Is
> >  > there a way to have a single module use a different JDK from the
> others?
> >  >
> >
> > Have a look at toolchains. Google is your friend. Toolchains support has
> > been available for a while now, I know because I helped get it into a
> number
> > of plugins.
> >
> > Another thing you might consider is using
> > animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
> > signatures you use are only public
> > signatures and not internal classes that are not part of the published
> JRE
> > API
> >
> Well, according to the customer they are definitely compiling against
> the API. They say there is a change in some DB drivers or something (at
> least something related to Oracle)... Have to inspect that a little
> further myself though...
>

Might be the DB driver that is depending on non-public JRE classes


> >
> >  >
> >  > Thanks,
> >  >
> >  > --
> >  > Roland Asmann
> >  > Senior Software Engineer
> >  >
> >  > adesso Austria GmbH
> >  > Floridotower 26. Stock T +43 1 2198790-27
> >  > Floridsdorfer Hauptstr. 1 F +43 1 2198790-927
> >  > A-1210 Wien M +43 664 88657566
> >  > E roland.asmann@adesso.at
> >  > W www.adesso.at
> >  >
> >  > -------------------------------------------------------------
> >  > >>> business. people. technology. <<<
> >  > -------------------------------------------------------------
> >  >
> >  > ---------------------------------------------------------------------
> >  > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >  > For additional commands, e-mail: users-help@maven.apache.org
> >  >
> >  >
> >
>
> --
> Roland Asmann
> Senior Software Engineer
>
> adesso Austria GmbH
> Floridotower 26. Stock              T +43 1 2198790-27
> Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
> A-1210 Wien                         M +43 664 88657566
>                                    E roland.asmann@adesso.at
>                                    W www.adesso.at
>
> -------------------------------------------------------------
>             >>> business. people. technology. <<<
> -------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multiple JDKs

Posted by "Asmann, Roland" <Ro...@adesso.at>.
On 07.12.2010 11:29, Stephen Connolly wrote:
> On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at> wrote:
>
>  > Hi all,
>  >
>  > I was wondering if anybody ever had this problem...
>  >
>  > I have a customer who is running a machine with a SUN JDK and one with
>  > an IBM JDK. Now, we've noticed there are some differences between the
>  > two, so I thought it would be best to release their artefacts for both
>  > JDKs... Question is, can I do this somehow with Maven in a single
>  > release-cycle or do I need to make separate releases?
>  >
>  >
> I would consider running the tests twice and have just one set of
> artifacts... Otherwise you will have a nightmare of a dependency management.
>
> Run the tests first with ibm and second with sun/oracle that way you know
> your artifacts work on both JREs
>
OK, so that means I should configure my surefire to run with different JDKs?
Also, with which JDK would you suggest that I run the complete build?
>
>  > Also, they currently have a problem in that they need SUN JDK 6 for most
>  > project, where one single module MUST be built with SUN JDK 5 because of
>  > a change in some classes. They are currently running the compiler-plugin
>  > with a bootclasspath for JDK 5, which isn't beautiful but works. Is
>  > there a way to have a single module use a different JDK from the others?
>  >
>
> Have a look at toolchains. Google is your friend. Toolchains support has
> been available for a while now, I know because I helped get it into a number
> of plugins.
>
> Another thing you might consider is using
> animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
> signatures you use are only public
> signatures and not internal classes that are not part of the published JRE
> API
>
Well, according to the customer they are definitely compiling against 
the API. They say there is a change in some DB drivers or something (at 
least something related to Oracle)... Have to inspect that a little 
further myself though...
>
>  >
>  > Thanks,
>  >
>  > --
>  > Roland Asmann
>  > Senior Software Engineer
>  >
>  > adesso Austria GmbH
>  > Floridotower 26. Stock T +43 1 2198790-27
>  > Floridsdorfer Hauptstr. 1 F +43 1 2198790-927
>  > A-1210 Wien M +43 664 88657566
>  > E roland.asmann@adesso.at
>  > W www.adesso.at
>  >
>  > -------------------------------------------------------------
>  > >>> business. people. technology. <<<
>  > -------------------------------------------------------------
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>  > For additional commands, e-mail: users-help@maven.apache.org
>  >
>  >
>

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 09/12/2010 1:57 PM, Asmann, Roland wrote:
> I don't like it. 2 Projects means that we have to share code somehow...
> Besides, if it was just a simple JAR-file, it would be OK. We have about
> 7 modules, and I don't really feel like duplicating all of them.
>
You must have heard of libraries?  Java runs on libraries
You put your code into projects that make JDK independent libraries.
Do not even think about duplicating source code. Very bad idea.

Your JDK dependent projects will very likely have no code at all and 
only a few dependencies on your libraries, unless you have JDK dependent 
modules for special test cases.


> Besides, the only difference we really have is that we trigger Maven
> with a different JDK, so we wouldn't even need profiles! I just don't
> want to have 2 different versions for the project.
>
> I think I'll try something with the invoker-plugin, that would at least
> work for normal builds... Need to check it it would work on releases as
> well...
>
If you like complexity, go ahead.

There is no need to make such a complex system.
Get it working with a simple structure and then after 6 months of 
working your way around Maven with the simple set up then tackle some 
optimization projects.
At least you will get your project working with Maven and start 
optimizing with a working build that does what you want even if it is 
not "optimal" (in your eyes at least).

Ron
> On 09-12-10 19:23, Jon Paynter wrote:
>> good point there.
>>
>> id opt for the simple solution too.
>>
>> On Thu, Dec 9, 2010 at 10:18 AM, Ron Wheeler<rwheeler@artifact-software.com
>>   >  wrote:
>>
>>   >  On 09/12/2010 1:08 PM, Jon Paynter wrote:
>>   >
>>   >>  why 2 projects?
>>   >>  it seems 1 maven project with profiles and a batch script will work
>>   >>
>>   >>  something like so:
>>   >>  mvn deploy -P SunProfileName
>>   >>  mvn deploy -P IBMProfileName
>>   >>
>>   >  If it works, I would have no objection but 2 projects will work for sure
>>   >  and everyone knows how to set up a simple project.
>>   >  The same can not be said about profiles and they seem to encourage
>> complex
>>   >  solutions that generate lots of traffic and frustrated Maven users here.
>>   >
>>   >  Sometimes it is a lot easier to do 2 simple things that are 90% identical
>>   >  than 1 complex thing that has no redundant code.
>>   >
>>   >  Ron
>>   >
>>   >
>>   >  On Thu, Dec 9, 2010 at 5:15 AM, Ron Wheeler
>>   >>  <rw...@artifact-software.com>wrote:
>>   >>
>>   >>  On 09/12/2010 7:52 AM, Asmann, Roland wrote:
>>   >>>
>>   >>>  On 09.12.2010 11:29, Stephen Connolly wrote:
>>   >>>>
>>   >>>>  you need to add an exclusion on the dependency that is being
>> brought in
>>   >>>>>  by
>>   >>>>>  profile activation.
>>   >>>>>
>>   >>>>>  It was a mistake that profiles include the<dependency>  section as
>>   >>>>>  there
>>   >>>>>  is
>>   >>>>>  all manor of issues.
>>   >>>>>
>>   >>>>>  The profile gets activated based on the environment where maven is
>>   >>>>>  running,
>>   >>>>>  not the environment where the artifact is deployed.
>>   >>>>>
>>   >>>>>  If you have 3rd party deps that use profile activation to pull in
>>   >>>>>  dependencies, you will need to define exclusions on those
>>   >>>>>  dependencies...
>>   >>>>>  that will stabilise your build.
>>   >>>>>
>>   >>>>>  If your build uses profile activation to pull in dependencies,
>> that is
>>   >>>>>  your
>>   >>>>>  bad, take it out
>>   >>>>>
>>   >>>>>  -Stephen
>>   >>>>>
>>   >>>>>  No, this is NOT the solution, since I will need the artifact on both
>>   >>>>>  SUN
>>   >>>>>
>>   >>>>  and JDK machines. The problem is that when I build with only one of
>>   >>>>  those, I can also only deploy it to one of those! Therefor, I need to
>>   >>>>  build one artifact with IBM JDK, which will then be deployed to
>> the IBM
>>   >>>>  JDK server, and one with SUN, which will likewise be deployed to
>> the SUN
>>   >>>>  server.
>>   >>>>
>>   >>>>  I understand that I can build both versions on either JDK by either
>>   >>>>  adding or excluding dependencies, the fact is that I don't want to do
>>   >>>>  this manually, but let Maven handle it (as it can!) depending on which
>>   >>>>  JDK I build.
>>   >>>>
>>   >>>>
>>   >>>>  Like I said before, the real problem is that I want to have my release
>>   >>>
>>   >>>>  build BOTH artifacts at once, and I am not sure how I could
>> achieve this
>>   >>>>  goal...
>>   >>>>
>>   >>>>  2 maven projects and a batch script.
>>   >>>>
>>   >>>  Ron
>>   >>>
>>   >>>
>>   >>>  ---------------------------------------------------------------------
>>   >>>  To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>   >>>  For additional commands, e-mail: users-help@maven.apache.org
>>   >>>
>>   >>>
>>   >>>
>>   >
>>   >  ---------------------------------------------------------------------
>>   >  To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>   >  For additional commands, e-mail: users-help@maven.apache.org
>>   >
>>   >
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by "Asmann, Roland" <Ro...@adesso.at>.
I don't like it. 2 Projects means that we have to share code somehow... 
Besides, if it was just a simple JAR-file, it would be OK. We have about 
7 modules, and I don't really feel like duplicating all of them.

Besides, the only difference we really have is that we trigger Maven 
with a different JDK, so we wouldn't even need profiles! I just don't 
want to have 2 different versions for the project.

I think I'll try something with the invoker-plugin, that would at least 
work for normal builds... Need to check it it would work on releases as 
well...


On 09-12-10 19:23, Jon Paynter wrote:
> good point there.
>
> id opt for the simple solution too.
>
> On Thu, Dec 9, 2010 at 10:18 AM, Ron Wheeler <rwheeler@artifact-software.com
>  > wrote:
>
>  > On 09/12/2010 1:08 PM, Jon Paynter wrote:
>  >
>  >> why 2 projects?
>  >> it seems 1 maven project with profiles and a batch script will work
>  >>
>  >> something like so:
>  >> mvn deploy -P SunProfileName
>  >> mvn deploy -P IBMProfileName
>  >>
>  > If it works, I would have no objection but 2 projects will work for sure
>  > and everyone knows how to set up a simple project.
>  > The same can not be said about profiles and they seem to encourage
> complex
>  > solutions that generate lots of traffic and frustrated Maven users here.
>  >
>  > Sometimes it is a lot easier to do 2 simple things that are 90% identical
>  > than 1 complex thing that has no redundant code.
>  >
>  > Ron
>  >
>  >
>  > On Thu, Dec 9, 2010 at 5:15 AM, Ron Wheeler
>  >> <rw...@artifact-software.com>wrote:
>  >>
>  >> On 09/12/2010 7:52 AM, Asmann, Roland wrote:
>  >>>
>  >>> On 09.12.2010 11:29, Stephen Connolly wrote:
>  >>>>
>  >>>> you need to add an exclusion on the dependency that is being
> brought in
>  >>>>> by
>  >>>>> profile activation.
>  >>>>>
>  >>>>> It was a mistake that profiles include the<dependency> section as
>  >>>>> there
>  >>>>> is
>  >>>>> all manor of issues.
>  >>>>>
>  >>>>> The profile gets activated based on the environment where maven is
>  >>>>> running,
>  >>>>> not the environment where the artifact is deployed.
>  >>>>>
>  >>>>> If you have 3rd party deps that use profile activation to pull in
>  >>>>> dependencies, you will need to define exclusions on those
>  >>>>> dependencies...
>  >>>>> that will stabilise your build.
>  >>>>>
>  >>>>> If your build uses profile activation to pull in dependencies,
> that is
>  >>>>> your
>  >>>>> bad, take it out
>  >>>>>
>  >>>>> -Stephen
>  >>>>>
>  >>>>> No, this is NOT the solution, since I will need the artifact on both
>  >>>>> SUN
>  >>>>>
>  >>>> and JDK machines. The problem is that when I build with only one of
>  >>>> those, I can also only deploy it to one of those! Therefor, I need to
>  >>>> build one artifact with IBM JDK, which will then be deployed to
> the IBM
>  >>>> JDK server, and one with SUN, which will likewise be deployed to
> the SUN
>  >>>> server.
>  >>>>
>  >>>> I understand that I can build both versions on either JDK by either
>  >>>> adding or excluding dependencies, the fact is that I don't want to do
>  >>>> this manually, but let Maven handle it (as it can!) depending on which
>  >>>> JDK I build.
>  >>>>
>  >>>>
>  >>>> Like I said before, the real problem is that I want to have my release
>  >>>
>  >>>> build BOTH artifacts at once, and I am not sure how I could
> achieve this
>  >>>> goal...
>  >>>>
>  >>>> 2 maven projects and a batch script.
>  >>>>
>  >>> Ron
>  >>>
>  >>>
>  >>> ---------------------------------------------------------------------
>  >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>  >>> For additional commands, e-mail: users-help@maven.apache.org
>  >>>
>  >>>
>  >>>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>  > For additional commands, e-mail: users-help@maven.apache.org
>  >
>  >
>

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Jon Paynter <ki...@gmail.com>.
good point there.

id opt for the simple solution too.

On Thu, Dec 9, 2010 at 10:18 AM, Ron Wheeler <rwheeler@artifact-software.com
> wrote:

> On 09/12/2010 1:08 PM, Jon Paynter wrote:
>
>> why 2 projects?
>> it seems 1 maven project with profiles and a batch script will work
>>
>> something like so:
>> mvn deploy -P SunProfileName
>> mvn deploy -P IBMProfileName
>>
> If it works, I would have no objection but 2 projects will work for sure
> and everyone knows how to set up a simple project.
> The same can not be said about profiles and they seem to encourage complex
> solutions that generate lots of traffic and frustrated Maven users here.
>
> Sometimes it is a lot easier to do 2 simple things that are 90% identical
> than 1 complex thing that has no redundant code.
>
> Ron
>
>
>  On Thu, Dec 9, 2010 at 5:15 AM, Ron Wheeler
>> <rw...@artifact-software.com>wrote:
>>
>>  On 09/12/2010 7:52 AM, Asmann, Roland wrote:
>>>
>>>  On 09.12.2010 11:29, Stephen Connolly wrote:
>>>>
>>>>  you need to add an exclusion on the dependency that is being brought in
>>>>> by
>>>>> profile activation.
>>>>>
>>>>> It was a mistake that profiles include the<dependency>   section as
>>>>> there
>>>>> is
>>>>> all manor of issues.
>>>>>
>>>>> The profile gets activated based on the environment where maven is
>>>>> running,
>>>>> not the environment where the artifact is deployed.
>>>>>
>>>>> If you have 3rd party deps that use profile activation to pull in
>>>>> dependencies, you will need to define exclusions on those
>>>>> dependencies...
>>>>> that will stabilise your build.
>>>>>
>>>>> If your build uses profile activation to pull in dependencies, that is
>>>>> your
>>>>> bad, take it out
>>>>>
>>>>> -Stephen
>>>>>
>>>>>  No, this is NOT the solution, since I will need the artifact on both
>>>>> SUN
>>>>>
>>>> and JDK machines. The problem is that when I build with only one of
>>>> those, I can also only deploy it to one of those! Therefor, I need to
>>>> build one artifact with IBM JDK, which will then be deployed to the IBM
>>>> JDK server, and one with SUN, which will likewise be deployed to the SUN
>>>> server.
>>>>
>>>> I understand that I can build both versions on either JDK by either
>>>> adding or excluding dependencies, the fact is that I don't want to do
>>>> this manually, but let Maven handle it (as it can!) depending on which
>>>> JDK I build.
>>>>
>>>>
>>>>   Like I said before, the real problem is that I want to have my release
>>>
>>>> build BOTH artifacts at once, and I am not sure how I could achieve this
>>>> goal...
>>>>
>>>>  2 maven projects and a batch script.
>>>>
>>> Ron
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multiple JDKs

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 09/12/2010 1:08 PM, Jon Paynter wrote:
> why 2 projects?
> it seems 1 maven project with profiles and a batch script will work
>
> something like so:
> mvn deploy -P SunProfileName
> mvn deploy -P IBMProfileName
If it works, I would have no objection but 2 projects will work for sure 
and everyone knows how to set up a simple project.
The same can not be said about profiles and they seem to encourage 
complex solutions that generate lots of traffic and frustrated Maven 
users here.

Sometimes it is a lot easier to do 2 simple things that are 90% 
identical than 1 complex thing that has no redundant code.

Ron

> On Thu, Dec 9, 2010 at 5:15 AM, Ron Wheeler
> <rw...@artifact-software.com>wrote:
>
>> On 09/12/2010 7:52 AM, Asmann, Roland wrote:
>>
>>> On 09.12.2010 11:29, Stephen Connolly wrote:
>>>
>>>> you need to add an exclusion on the dependency that is being brought in
>>>> by
>>>> profile activation.
>>>>
>>>> It was a mistake that profiles include the<dependency>   section as there
>>>> is
>>>> all manor of issues.
>>>>
>>>> The profile gets activated based on the environment where maven is
>>>> running,
>>>> not the environment where the artifact is deployed.
>>>>
>>>> If you have 3rd party deps that use profile activation to pull in
>>>> dependencies, you will need to define exclusions on those dependencies...
>>>> that will stabilise your build.
>>>>
>>>> If your build uses profile activation to pull in dependencies, that is
>>>> your
>>>> bad, take it out
>>>>
>>>> -Stephen
>>>>
>>>>   No, this is NOT the solution, since I will need the artifact on both SUN
>>> and JDK machines. The problem is that when I build with only one of
>>> those, I can also only deploy it to one of those! Therefor, I need to
>>> build one artifact with IBM JDK, which will then be deployed to the IBM
>>> JDK server, and one with SUN, which will likewise be deployed to the SUN
>>> server.
>>>
>>> I understand that I can build both versions on either JDK by either
>>> adding or excluding dependencies, the fact is that I don't want to do
>>> this manually, but let Maven handle it (as it can!) depending on which
>>> JDK I build.
>>>
>>>
>>   Like I said before, the real problem is that I want to have my release
>>> build BOTH artifacts at once, and I am not sure how I could achieve this
>>> goal...
>>>
>>>   2 maven projects and a batch script.
>> Ron
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Jon Paynter <ki...@gmail.com>.
why 2 projects?
it seems 1 maven project with profiles and a batch script will work

something like so:
mvn deploy -P SunProfileName
mvn deploy -P IBMProfileName

On Thu, Dec 9, 2010 at 5:15 AM, Ron Wheeler
<rw...@artifact-software.com>wrote:

> On 09/12/2010 7:52 AM, Asmann, Roland wrote:
>
>> On 09.12.2010 11:29, Stephen Connolly wrote:
>>
>>> you need to add an exclusion on the dependency that is being brought in
>>> by
>>> profile activation.
>>>
>>> It was a mistake that profiles include the<dependency>  section as there
>>> is
>>> all manor of issues.
>>>
>>> The profile gets activated based on the environment where maven is
>>> running,
>>> not the environment where the artifact is deployed.
>>>
>>> If you have 3rd party deps that use profile activation to pull in
>>> dependencies, you will need to define exclusions on those dependencies...
>>> that will stabilise your build.
>>>
>>> If your build uses profile activation to pull in dependencies, that is
>>> your
>>> bad, take it out
>>>
>>> -Stephen
>>>
>>>  No, this is NOT the solution, since I will need the artifact on both SUN
>> and JDK machines. The problem is that when I build with only one of
>> those, I can also only deploy it to one of those! Therefor, I need to
>> build one artifact with IBM JDK, which will then be deployed to the IBM
>> JDK server, and one with SUN, which will likewise be deployed to the SUN
>> server.
>>
>> I understand that I can build both versions on either JDK by either
>> adding or excluding dependencies, the fact is that I don't want to do
>> this manually, but let Maven handle it (as it can!) depending on which
>> JDK I build.
>>
>>
>  Like I said before, the real problem is that I want to have my release
>> build BOTH artifacts at once, and I am not sure how I could achieve this
>> goal...
>>
>>  2 maven projects and a batch script.
>
> Ron
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multiple JDKs

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 09/12/2010 7:52 AM, Asmann, Roland wrote:
> On 09.12.2010 11:29, Stephen Connolly wrote:
>> you need to add an exclusion on the dependency that is being brought in by
>> profile activation.
>>
>> It was a mistake that profiles include the<dependency>  section as there is
>> all manor of issues.
>>
>> The profile gets activated based on the environment where maven is running,
>> not the environment where the artifact is deployed.
>>
>> If you have 3rd party deps that use profile activation to pull in
>> dependencies, you will need to define exclusions on those dependencies...
>> that will stabilise your build.
>>
>> If your build uses profile activation to pull in dependencies, that is your
>> bad, take it out
>>
>> -Stephen
>>
> No, this is NOT the solution, since I will need the artifact on both SUN
> and JDK machines. The problem is that when I build with only one of
> those, I can also only deploy it to one of those! Therefor, I need to
> build one artifact with IBM JDK, which will then be deployed to the IBM
> JDK server, and one with SUN, which will likewise be deployed to the SUN
> server.
>
> I understand that I can build both versions on either JDK by either
> adding or excluding dependencies, the fact is that I don't want to do
> this manually, but let Maven handle it (as it can!) depending on which
> JDK I build.
>

> Like I said before, the real problem is that I want to have my release
> build BOTH artifacts at once, and I am not sure how I could achieve this
> goal...
>
2 maven projects and a batch script.

Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by "Asmann, Roland" <Ro...@adesso.at>.
On 09.12.2010 11:29, Stephen Connolly wrote:
> you need to add an exclusion on the dependency that is being brought in by
> profile activation.
>
> It was a mistake that profiles include the <dependency> section as there is
> all manor of issues.
>
> The profile gets activated based on the environment where maven is running,
> not the environment where the artifact is deployed.
>
> If you have 3rd party deps that use profile activation to pull in
> dependencies, you will need to define exclusions on those dependencies...
> that will stabilise your build.
>
> If your build uses profile activation to pull in dependencies, that is your
> bad, take it out
>
> -Stephen
>
No, this is NOT the solution, since I will need the artifact on both SUN 
and JDK machines. The problem is that when I build with only one of 
those, I can also only deploy it to one of those! Therefor, I need to 
build one artifact with IBM JDK, which will then be deployed to the IBM 
JDK server, and one with SUN, which will likewise be deployed to the SUN 
server.

I understand that I can build both versions on either JDK by either 
adding or excluding dependencies, the fact is that I don't want to do 
this manually, but let Maven handle it (as it can!) depending on which 
JDK I build.

Like I said before, the real problem is that I want to have my release 
build BOTH artifacts at once, and I am not sure how I could achieve this 
goal...

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Stephen Connolly <st...@gmail.com>.
you need to add an exclusion on the dependency that is being brought in by
profile activation.

It was a mistake that profiles include the <dependency> section as there is
all manor of issues.

The profile gets activated based on the environment where maven is running,
not the environment where the artifact is deployed.

If you have 3rd party deps that use profile activation to pull in
dependencies, you will need to define exclusions on those dependencies...
that will stabilise your build.

If your build uses profile activation to pull in dependencies, that is your
bad, take it out

-Stephen

On 9 December 2010 10:14, Asmann, Roland <Ro...@adesso.at> wrote:

> On 07.12.2010 11:29, Stephen Connolly wrote:
> > On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at>
> wrote:
> >
> >  > Hi all,
> >  >
> >  > I was wondering if anybody ever had this problem...
> >  >
> >  > I have a customer who is running a machine with a SUN JDK and one with
> >  > an IBM JDK. Now, we've noticed there are some differences between the
> >  > two, so I thought it would be best to release their artefacts for both
> >  > JDKs... Question is, can I do this somehow with Maven in a single
> >  > release-cycle or do I need to make separate releases?
> >  >
> >  >
> > I would consider running the tests twice and have just one set of
> > artifacts... Otherwise you will have a nightmare of a dependency
> management.
>
> I already have this... Yesterday I found out that one of my dependencies
> has a profile that is activated when I use the IBM JDK for building...
> This mad the EAR undeployable on the SUN JDK, because this dependency
> (jaxp) is probably included in the JDK for SUN.
>
> So, I think my best solution would be to run Maven twice on all my
> projects -- once for SUN and once for IBM. Only question is, can I do
> this in a single go and how can I do this in the release-phase...
> >
> > Run the tests first with ibm and second with sun/oracle that way you know
> > your artifacts work on both JREs
>
> As I pointed out, this will not solve my problem completely, because I
> need 2 artifacts!
> >
> >
> >  > Also, they currently have a problem in that they need SUN JDK 6 for
> most
> >  > project, where one single module MUST be built with SUN JDK 5 because
> of
> >  > a change in some classes. They are currently running the
> compiler-plugin
> >  > with a bootclasspath for JDK 5, which isn't beautiful but works. Is
> >  > there a way to have a single module use a different JDK from the
> others?
> >  >
> >
> > Have a look at toolchains. Google is your friend. Toolchains support has
> > been available for a while now, I know because I helped get it into a
> number
> > of plugins.
>
> If this can do what I want, then it might indeed be worth looking at.
> I'll give it a go in bit, I think I have some time today.
> >
> > Another thing you might consider is using
> > animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
> > signatures you use are only public
> > signatures and not internal classes that are not part of the published
> JRE
> > API
> >
> >
>
> --
> Roland Asmann
> Senior Software Engineer
>
> adesso Austria GmbH
> Floridotower 26. Stock              T +43 1 2198790-27
> Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
> A-1210 Wien                         M +43 664 88657566
>                                    E roland.asmann@adesso.at
>                                    W www.adesso.at
>
> -------------------------------------------------------------
>             >>> business. people. technology. <<<
> -------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multiple JDKs

Posted by "Asmann, Roland" <Ro...@adesso.at>.
On 07.12.2010 11:29, Stephen Connolly wrote:
> On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at> wrote:
>
>  > Hi all,
>  >
>  > I was wondering if anybody ever had this problem...
>  >
>  > I have a customer who is running a machine with a SUN JDK and one with
>  > an IBM JDK. Now, we've noticed there are some differences between the
>  > two, so I thought it would be best to release their artefacts for both
>  > JDKs... Question is, can I do this somehow with Maven in a single
>  > release-cycle or do I need to make separate releases?
>  >
>  >
> I would consider running the tests twice and have just one set of
> artifacts... Otherwise you will have a nightmare of a dependency management.

I already have this... Yesterday I found out that one of my dependencies 
has a profile that is activated when I use the IBM JDK for building... 
This mad the EAR undeployable on the SUN JDK, because this dependency 
(jaxp) is probably included in the JDK for SUN.

So, I think my best solution would be to run Maven twice on all my 
projects -- once for SUN and once for IBM. Only question is, can I do 
this in a single go and how can I do this in the release-phase...
>
> Run the tests first with ibm and second with sun/oracle that way you know
> your artifacts work on both JREs

As I pointed out, this will not solve my problem completely, because I 
need 2 artifacts!
>
>
>  > Also, they currently have a problem in that they need SUN JDK 6 for most
>  > project, where one single module MUST be built with SUN JDK 5 because of
>  > a change in some classes. They are currently running the compiler-plugin
>  > with a bootclasspath for JDK 5, which isn't beautiful but works. Is
>  > there a way to have a single module use a different JDK from the others?
>  >
>
> Have a look at toolchains. Google is your friend. Toolchains support has
> been available for a while now, I know because I helped get it into a number
> of plugins.

If this can do what I want, then it might indeed be worth looking at. 
I'll give it a go in bit, I think I have some time today.
>
> Another thing you might consider is using
> animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
> signatures you use are only public
> signatures and not internal classes that are not part of the published JRE
> API
>
>

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple JDKs

Posted by Stephen Connolly <st...@gmail.com>.
On 7 December 2010 10:14, Asmann, Roland <Ro...@adesso.at> wrote:

> Hi all,
>
> I was wondering if anybody ever had this problem...
>
> I have a customer who is running a machine with a SUN JDK and one with
> an IBM JDK. Now, we've noticed there are some differences between the
> two, so I thought it would be best to release their artefacts for both
> JDKs... Question is, can I do this somehow with Maven in a single
> release-cycle or do I need to make separate releases?
>
>
I would consider running the tests twice and have just one set of
artifacts... Otherwise you will have a nightmare of a dependency management.

Run the tests first with ibm and second with sun/oracle that way you know
your artifacts work on both JREs


> Also, they currently have a problem in that they need SUN JDK 6 for most
> project, where one single module MUST be built with SUN JDK 5 because of
> a change in some classes. They are currently running the compiler-plugin
> with a bootclasspath for JDK 5, which isn't beautiful but works. Is
> there a way to have a single module use a different JDK from the others?
>

Have a look at toolchains. Google is your friend. Toolchains support has
been available for a while now, I know because I helped get it into a number
of plugins.

Another thing you might consider is using
animal-sniffer-maven-plugin@mojothat way you can verify that the JRE
signatures you use are only public
signatures and not internal classes that are not part of the published JRE
API


>
> Thanks,
>
> --
> Roland Asmann
> Senior Software Engineer
>
> adesso Austria GmbH
> Floridotower 26. Stock              T +43 1 2198790-27
> Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
> A-1210 Wien                         M +43 664 88657566
>                                    E roland.asmann@adesso.at
>                                    W www.adesso.at
>
> -------------------------------------------------------------
>             >>> business. people. technology. <<<
> -------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>