Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 375554

Summary: Be able to specify the jdt.core used for compiling
Product: [Technology] CBI Reporter: Paul Webster <pwebster>
Component: prototypeAssignee: CBI Dummy user <cbi.prototype-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, igor, thanh.ha
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 372792, 397852    

Description Paul Webster CLA 2012-03-28 11:12:16 EDT
As part of regular builds we regularly update the ECJ used to compile eclipse.  This is required both to pick up fixes and to thoroughly test the jdt.core compiler.

We would need to be able to specify an ECJ somehow while running a build, either as a property or perhaps specifying in the pom so it can be picked up.

PW
Comment 1 Paul Webster CLA 2012-09-19 15:20:43 EDT
From bug 389454

----
You can force Tycho to use the latest JDT version with the following
configuration:


<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>tycho-compiler-plugin</artifactId>
  <dependencies>
    <dependency>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>org.eclipse.jdt.core</artifactId>
      <version>3.8.1.v20120531-0637</version>
    </dependency>
  </dependencies>
</plugin>
Comment 2 Paul Webster CLA 2012-09-20 08:58:59 EDT
Thanh, if this is all it takes can we add this to the root POM.  I'd wait until after we've sorted out the root file/doc.

PW
Comment 3 Paul Webster CLA 2012-09-24 13:25:30 EDT
Igor, does this only work for org.eclipse.tycho/org.eclipse.jdt.core ?  So something published through tycho?

PW
Comment 4 Thanh Ha CLA 2012-09-24 13:37:54 EDT
(In reply to comment #1)
> From bug 389454
> 
> ----
> You can force Tycho to use the latest JDT version with the following
> configuration:
> 
> 
> <plugin>
>   <groupId>org.eclipse.tycho</groupId>
>   <artifactId>tycho-compiler-plugin</artifactId>
>   <dependencies>
>     <dependency>
>       <groupId>org.eclipse.tycho</groupId>
>       <artifactId>org.eclipse.jdt.core</artifactId>
>       <version>3.8.1.v20120531-0637</version>
>     </dependency>
>   </dependencies>
> </plugin>

I pushed this change to R3 and R4 maintenance branches.

http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?h=R3_8_maintenance&id=3dd1b92cd93ea53bcc59bdfe321e82971a9d8b0a

http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?h=R4_2_maintenance&id=7e0bf57eb56a9093d5fc89d041826b7085c32a17
Comment 5 Igor Fedorenko CLA 2012-09-24 14:24:49 EDT
(In reply to comment #3)
> Igor, does this only work for org.eclipse.tycho/org.eclipse.jdt.core ?  So
> something published through tycho?
> 
> PW

No, Tycho is not involved here. Any version of jdt.core resolvable from a maven repository using maven artifact coordinate will work.
Comment 6 Igor Fedorenko CLA 2012-09-24 14:25:55 EDT
(In reply to comment #4)
> (In reply to comment #1)
> > From bug 389454
> > 
> > ----
> > You can force Tycho to use the latest JDT version with the following
> > configuration:
> > 
> > 
> > <plugin>
> >   <groupId>org.eclipse.tycho</groupId>
> >   <artifactId>tycho-compiler-plugin</artifactId>
> >   <dependencies>
> >     <dependency>
> >       <groupId>org.eclipse.tycho</groupId>
> >       <artifactId>org.eclipse.jdt.core</artifactId>
> >       <version>3.8.1.v20120531-0637</version>
> >     </dependency>
> >   </dependencies>
> > </plugin>
> 
> I pushed this change to R3 and R4 maintenance branches.
> 
> http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/
> commit/?h=R3_8_maintenance&id=3dd1b92cd93ea53bcc59bdfe321e82971a9d8b0a
> 
> http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/
> commit/?h=R4_2_maintenance&id=7e0bf57eb56a9093d5fc89d041826b7085c32a17

To be clear, from this point on, it is platform team responsibility to maintain version of jdt.core used by the platform build. Any new version we include in Tycho will be ignored.
Comment 7 Paul Webster CLA 2012-09-24 14:37:34 EDT
(In reply to comment #5)
> 
> No, Tycho is not involved here. Any version of jdt.core resolvable from a
> maven repository using maven artifact coordinate will work.

OK, that makes sense.

PW
Comment 8 Paul Webster CLA 2012-10-23 11:11:09 EDT
Seems this is fixed.

PW
Comment 9 David Williams CLA 2013-01-09 21:09:42 EST
Can you educate me ... you say "Any version of jdt.core resolvable from a maven repository using maven artifact coordinate will work." 

How would we then specify "Kepler M4 version"? Doubt that exists in "a maven repository"? 

Appreciate any advice. 

This is a required use case since we in Platform typically update the compiler each milestone ... with the compiler from the previous milestone ... as a way to test the compiler through a development cycle. 

Thanks,
Comment 10 David Williams CLA 2013-01-09 21:50:21 EST
I'll also note here, while it may be controversial, or "not for everyone", we are actually using the M4 compiler for our PDE based Juno SR2 releases, as mentioned in bug 396690. 

So ... if some wanted to use CBI to really duplicate our SR2 release, the compiler used should not be the "3.8.1" version that is currently specified, but the Kepler M4 version. 

[The rationale for using an "unreleased compiler" (besides being easier :) is that a) there's often improvements and fixes that are important to pick up, and b) fair confidence that it is "correct" (i.e. might miss or hit warnings it shouldn't, but, the byte codes them selves be correct). And would be even more correct once released, so future maintenance/service could be safely updated to released compiler.]
Comment 11 Igor Fedorenko CLA 2013-01-10 09:44:38 EST
Here is what I recommend you do.

* Setup a hosted maven repository. This does not have to be anything fancy, a stable location somewhere on download.eclipse.org is sufficient. For example, I use technology/m2e/maven to host CBI signing plugin.

* Deploy jdt.core version that you need to use to the hosted repository you setup using file:// protocol. See exact command below.

* Add new <pluginRepository> element to CBI parent pom.xml with http:// URL of the hosted repository

* Add new <pluginManagement> plugins/plugin element with configuration similar to comment #1 to CBI parent pom.xml file.



JDTVERSION=3.9.0.v20121208-144805
mvn deploy:deploy-file -Durl=file:///tmp/cbi-jdt \
  -DgroupId=org.eclipse.cbi.tycho \
  -DartifactId=org.eclipse.jdt.core \
  -Dversion=${JDTVERSION} \
  -Dfile=org.eclipse.jdt.core_${JDTVERSION}.jar \
  -Dsources=org.eclipse.jdt.core.source_${JDTVERSION}.jar