Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] How m2e can select a specific jdk version when working with several jdk versions?

m2e-dev is the mailing list we use to discuss m2e and m2e extension
development [1]. Please forward any further question there.

To implement support for this you first need to configure m2e
development environment as explained in wiki [2]. The same wiki outlines
our general contribution requirements, legal paperwork eclipse.org
requires, etc.

org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator is the
class that configures project JRE. Currently this is done strictly based
on project target jre version, which is determined from
maven-compiler-plugin source&target parameters. You will need to change
this behaviour for projects that have forked=true and use non-default
executable. In the happy case, it should be possible to match executable
path to one of workspace JREs, but you will also need to decide what to
do with non-happy cases. For example, what should happen if there is no
workspace JRE that matches the executable path? What if there is more
than one JRE?

Another option is to provide the new behaviour via m2e extension. This
way you can keep the code very specific to your environment and not
worry about non-happy cases I mentioned above. There is some info on
wiki [3] about development m2e extensions, but you will need to
implement IJavaProjectConfigurator.

[1] https://dev.eclipse.org/mailman/listinfo/m2e-dev
[2] http://wiki.eclipse.org/M2E_Development_Environment
[3] http://wiki.eclipse.org/M2E/Extension_Development

--
Regards,
Igor

On 2014-04-17, 7:45, Laurent TOURREAU wrote:
I am interested about m2e-dev. Can you tell me more?

Regards
Laurent

-----Original Message-----
From: m2e-users-bounces@xxxxxxxxxxx [mailto:m2e-users-bounces@xxxxxxxxxxx]
Sent: jeudi 17 avril 2014 12:41
To: m2e-users@xxxxxxxxxxx
Subject: Re: [m2e-users] How m2e can select a specific jdk version when working with several jdk versions?

This is not currently supported by m2e but is probably relatively easy to implement. I can give you pointers on m2e-dev if you are interested.

--
Regards,
Igor

On 2014-04-17, 3:18, Laurent TOURREAU wrote:
Hi Igor

Indeed I have 4 modules : A, B, C , D

pom.xml for module A:
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
              <verbose>true</verbose>
              <fork>true</fork>
              <executable>C:\Program Files\Java\jdk1.6.0_24\bin\javac</executable>
              <compilerVersion>1.6</compilerVersion>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </plugin>

pom.xml for module B, C and D:
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </plugin>

The exact JDK6 update version requirement concern only module A (we absolute need update 24 and nothing else). For other modules we use the most recent JDK6 version we can work (update 37 at the moment in our company).

In my PC I have both jdk1.6.0_24 and jdk1.6.0_37 installed respectively in:
C:\Program Files\Java\jdk1.6.0_24
C:\Program Files\Java\jdk1.6.0_37

I use Maven 3.1.1 which is installed in C:\Program Files\Apache
Software Foundation\Maven Environment variables are set as it:
M2 = C:\Program Files\Apache Software Foundation\Maven\bin M2_HOME =
C:\Program Files\Apache Software Foundation\Maven JAVA_HOME =
C:\Program Files\Java\jdk1.6.0_37 PATH=..;M2%;...

If I type mvn -v, I get this:
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a;
2013-09-17 17:22:2
2+0200)
Maven home: C:\Program Files\Apache Software Foundation\Maven Java
version: 1.6.0_37, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_37\jre Default locale:
fr_FR, platform encoding: UTF-8 OS name: "windows 7", version: "6.1",
arch: "amd64", family: "windows"

In Eclipse , I set C:\Program Files\Apache Software Foundation\Maven directory as the installation used to launch Maven (External installation) in Windows -> Preferences -> Maven -> Installation pane.

Laurent


This message and any attachments (the "message") is intended solely
for the intended addressees and is confidential.
If you receive this message in error,or are not the intended
recipient(s), please delete it and any copies from your systems and
immediately notify the sender. Any unauthorized view, use that does
not comply with its purpose, dissemination or disclosure, either whole
or partial, is prohibited. Since the internet cannot guarantee the
integrity of this message which may not be reliable, BNP PARIBAS (and its subsidiaries) shall not be liable for the message if modified, changed or falsified.
Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------
------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") sont
etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en
avertir immediatement l'expediteur. Toute lecture non autorisee, toute
utilisation de ce message qui n'est pas conforme a sa destination,
toute diffusion ou toute publication, totale ou partielle, est
interdite. L'Internet ne permettant pas d'assurer l'integrite de ce
message electronique susceptible d'alteration, BNP Paribas (et ses
filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese ou il aurait ete modifie, deforme ou falsifie.
N'imprimez ce message que si necessaire, pensez a l'environnement.

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top