Use 1.6 JRE globally

2008-01-16 Thread Olivier Serve
Hi _o/

I have a little project that requires a JDK 1.6 (it uses some 1.6 specific 
APIs).
I have both Java 1.5 and 1.6 installed on my system to do some tests.

Using the following, I can build the artifact.
--8--
project
  ...
  build
plugins
  plugin
artifactIdmaven-compiler-plugin/artifactId
configuration
  compilerVersion1.6/compilerVersion
  forktrue/fork
  source1.6/source
  target1.6/target
/configuration
  /plugin
/plugins
  /build
  ...
/project
--8--

However, the tests fail to execute with a Bad version number in .class file.
OK, the surefire plugin must be using the 1.5 JRE to execute the tests and thus 
fails.
There must be a way to tell it to use a 1.6 JRE and that would solve my problem.

But I find it quite a bad precatice to have to state in two locations that I 
need a 1.6 jre.
Is there a way to tell maven to use a JRE 1.6 for all Java-related things in a 
single location ?
-- 
Cordialement,
Olivier SERVE

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Use 1.6 JRE globally

2008-01-16 Thread Olivier Serve
Le mercredi 16 janvier 2008, Michael a écrit :
 Olivier Serve wrote:
  Hi _o/
  
  I have a little project that requires a JDK 1.6 (it uses some 1.6 specific 
  APIs).
  I have both Java 1.5 and 1.6 installed on my system to do some tests.
  
  Using the following, I can build the artifact.
  --8--
  project
...
build
  plugins
plugin
  artifactIdmaven-compiler-plugin/artifactId
  configuration
compilerVersion1.6/compilerVersion
forktrue/fork
source1.6/source
target1.6/target
  /configuration
/plugin
  /plugins
/build
...
  /project
  --8--
  
  However, the tests fail to execute with a Bad version number in .class 
  file.
  OK, the surefire plugin must be using the 1.5 JRE to execute the tests and 
  thus fails.
  There must be a way to tell it to use a 1.6 JRE and that would solve my 
  problem.
  
  But I find it quite a bad precatice to have to state in two locations that 
  I need a 1.6 jre.
  Is there a way to tell maven to use a JRE 1.6 for all Java-related things 
  in a single location ?
 
 set JAVA_HOME JRE_HOME correctly

No, because doing this will make the build non-reproducible on other 
environments as I will lose the 1.6 requirement.
-- 
Cordialement,
Olivier SERVE

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Use 1.6 JRE globally

2008-01-16 Thread Olivier Serve
Le mercredi 16 janvier 2008, Hayes, Peter a écrit :
 You may want to look at using the enforcer plugin :
 
 http://maven.apache.org/plugins/maven-enforcer-plugin/
 
 This would allow you to guarantee that the jdk running is the build's 
 required JDK.

 As to your initial question, I agree that the only way to set the JDK versino 
 globally in Maven is to execute Maven with the JDK home set to the VM you 
 require.  Otherwise you are going to have to configure individual plugins 
 (like surefire) to point to the path of the VM that you require.  This is not 
 portable and should be avoided.

Thank you, solved \o/

 
 Pete 
 
 -Original Message-
 From: Michael [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, January 16, 2008 11:51 AM
 To: Maven Users List
 Subject: Re: Use 1.6 JRE globally
 
 Olivier Serve wrote:
  Le mercredi 16 janvier 2008, Michael a écrit :
  Olivier Serve wrote:
  Hi _o/
 
  I have a little project that requires a JDK 1.6 (it uses some 1.6 
  specific APIs).
  I have both Java 1.5 and 1.6 installed on my system to do some tests.
 
  Using the following, I can build the artifact.
  --8--
  project
...
build
  plugins
plugin
  artifactIdmaven-compiler-plugin/artifactId
  configuration
compilerVersion1.6/compilerVersion
forktrue/fork
source1.6/source
target1.6/target
  /configuration
/plugin
  /plugins
/build
...
  /project
  --8--
 
  However, the tests fail to execute with a Bad version number in .class 
  file.
  OK, the surefire plugin must be using the 1.5 JRE to execute the tests 
  and thus fails.
  There must be a way to tell it to use a 1.6 JRE and that would solve my 
  problem.
 
  But I find it quite a bad precatice to have to state in two locations 
  that I need a 1.6 jre.
  Is there a way to tell maven to use a JRE 1.6 for all Java-related things 
  in a single location ?
  set JAVA_HOME JRE_HOME correctly
  
  No, because doing this will make the build non-reproducible on other 
  environments as I will lose the 1.6 requirement.
 
 you could set i temporary for the each maven instance
 



-- 
Cordialement,

Olivier SERVE
Ingénieur en développement de solutions de sécurité
Bull, Architect of an Open World TM
Tél : 02 41 93 55 16
http://www.bull.com

Ce message contient des informations confidentielles, couvertes par le
secret professionnel ou réservées exclusivement à leur destinataire. Toute
lecture, utilisation, diffusion ou divulgation sans autorisation expresse
est rigoureusement interdite.
Si vous n'en êtes pas le destinataire, merci de prendre contact avec
l'expéditeur et de détruire ce message.

This e-mail contains material that is confidential for the sole use of the
intended recipient. Any review, reliance or distribution by others or
forwarding without express permission is strictly prohibited.
If you are not the intended recipient, please contact the sender and delete
all copies.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Use 1.6 JRE globally

2008-01-16 Thread Olivier Serve
Le mercredi 16 janvier 2008, Ian Springer a écrit :
 
  set JAVA_HOME JRE_HOME correctly
  
 
  No, because doing this will make the build non-reproducible on other 
  environments as I will lose the 1.6 requirement.

 
 You can use the enforcer plugin in your pom to specify that your project 
 requires Java 1.6. See 
 http://maven.apache.org/plugins/maven-enforcer-plugin/usage.html.

Yes, I've seen that.
Thanks for having confirmed.
-- 
Cordialement,
Olivier SERVE

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Meta-Project and module sharing

2007-12-10 Thread Olivier Serve
Hello \o_

We have a big project with a custom ant-based build system but it's a pain to 
maintain.
So, I'm taking a look at maven2 to see if it fits our requirements.

Today, we have 7 separate components (different servers) that use some shared 
libraries (utilities, protocol implementations, clients...).
Each component or library has its own 'project'. A typical project has the 
following layout:
Project
 |- src/
 |- classes/
 |- conf/
 |- www/
 |- libs/
 `- build.xml and config properties

All the libraries used by a component are 'linked' under libs/ using an 
svn:externals property.
This allows us to share the libraries in the SVN repository and at the same 
time just checkout a component as an Eclipse project to get
all the libraries it depends on.

I'd like to mimic that behaviour using maven2.
I thought i could use the 'modules' structure :
Component
 |- component/
 |   `- pom.xml
 |- lib1/
 |   `- pom.xml
 |- lib2/
 |   `- pom.xml
 `- pom.xml
using the same svn:externals as before for the libs.
However, it seems the modules MUST refer to their parent in their pom.xml.
As the libraries are shared amongst the components, that's not feasible for 
them.

Is there a way to work around that or is it total stupidity ?

Actually, we have component - library and library - library dependencies.
Maybe there is a better way to define dependencies that I don't know ?

Thanks for any reply _o/
--
Olivier SERVE

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]