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

Bug 385967

Summary: [CBI] ./eclipse.platform.ua/org.eclipse.help.webapp/ compiles JSPs using customBuildCallbacks
Product: [Eclipse Project] Platform Reporter: Krzysztof Daniel <krzysztof.daniel>
Component: User AssistanceAssignee: Paul Webster <pwebster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, jan.sievers, john.arthorne, krzysztof.daniel, pwebster, thanh.ha
Version: 4.3   
Target Milestone: 3.8.2   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 372792, 396082    
Attachments:
Description Flags
jsp.patch
none
jsp.patch v2
none
jsp.patch v3
none
jsp.patch v4 none

Description Krzysztof Daniel CLA 2012-07-25 12:16:41 EDT
this will not work with tycho.
Comment 1 Jan Sievers CLA 2012-11-15 15:57:39 EST
jetty's jspc maven plugin [1] may be able to do the same thing that is done in custom callback buildJSPs.xml [2] from pom.xml instead.

[1] http://wiki.eclipse.org/Jetty/Feature/Jetty_Jspc_Maven_Plugin
[2] http://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.help.webapp/buildJSPs.xml
Comment 2 Paul Webster CLA 2013-01-07 15:17:27 EST
Thanh, are we running buildJSPs now?

PW
Comment 3 Thanh Ha CLA 2013-01-07 15:24:19 EST
(In reply to comment #2)
> Thanh, are we running buildJSPs now?
> 
> PW

No not yet. I can look into creating a patch for this sometime this week.
Comment 4 Thanh Ha CLA 2013-01-10 14:10:23 EST
(In reply to comment #1)
> jetty's jspc maven plugin [1] may be able to do the same thing that is done
> in custom callback buildJSPs.xml [2] from pom.xml instead.
> 
> [1] http://wiki.eclipse.org/Jetty/Feature/Jetty_Jspc_Maven_Plugin
> [2]
> http://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.
> help.webapp/buildJSPs.xml

I tried using the jetty-jspc-maven-plugin but it seems maven can't find it with the repos we have defined. It is not clear to me where the repo for this plugin is, does anyone know?
Comment 5 Jan Sievers CLA 2013-01-10 14:57:00 EST
> It is not clear to me where the repo for
> this plugin is, does anyone know?

http://search.maven.org/#search%7Cga%7C1%7Cjetty%20jspc
Comment 6 Thanh Ha CLA 2013-01-10 15:07:08 EST
(In reply to comment #5)
> > It is not clear to me where the repo for
> > this plugin is, does anyone know?
> 
> http://search.maven.org/#search%7Cga%7C1%7Cjetty%20jspc

Thanks Jan, that helps. Appears that my problem was I was using 7.0.0 like it suggests in the example but it worked after I picked a newer version like 8.1.8.v20121106.
Comment 7 Thanh Ha CLA 2013-01-10 16:12:46 EST
Created attachment 225476 [details]
jsp.patch

Work in progress patch... The attached patch seems to create a new jsp folder which includes a bunch of classes that were not included before in the final jar (see below).

Need to understand what buildJSP.xml produces and figure out what's the jetty-jspc-maven-plugin is missing if any.

The wiki page discusses using the maven-war-plugin as well. Do we need this?



% diff /tmp/b /tmp/a
3a4,7
>    creating: jsp/
>    creating: jsp/basic/
>    creating: jsp/advancedstate/
>    creating: jsp/advanced/
14a19,69
>   inflating: jsp/basic/indexToolbar_jsp.class  
>   inflating: jsp/basic/searchView_jsp.class  
>   inflating: jsp/basic/searchToolbar_jsp.class  
>   inflating: jsp/basic/toolbar_jsp.class  
>   inflating: jsp/basic/header_jsp.class  
>   inflating: jsp/basic/tabs_jsp.class  
>   inflating: jsp/basic/help_jsp.class  
>   inflating: jsp/basic/tocView_jsp.class  
>   inflating: jsp/basic/tocToolbar_jsp.class  
>   inflating: jsp/basic/view_jsp.class  
>   inflating: jsp/basic/livehelp_005fjs_jsp.class  
>   inflating: jsp/basic/indexView_jsp.class  
>   inflating: jsp/basic/err_jsp.class  
>   inflating: jsp/basic/index_jsp.class  
>   inflating: jsp/advancedstate/scopeState_jsp.class  
>   inflating: jsp/advancedstate/workingSetState_jsp.class  
>   inflating: jsp/advanced/quickSearch_jsp.class  
>   inflating: jsp/advanced/views_jsp.class  
>   inflating: jsp/advanced/indexToolbar_jsp.class  
>   inflating: jsp/advanced/print_jsp.class  
>   inflating: jsp/advanced/searchView_jsp.class  
>   inflating: jsp/advanced/searchToolbar_jsp.class  
>   inflating: jsp/advanced/searchSimple_jsp.class  
>   inflating: jsp/advanced/fheader_jsp.class  
>   inflating: jsp/advanced/confirmShowAll_jsp.class  
>   inflating: jsp/advanced/toolbar_jsp.class  
>   inflating: jsp/advanced/bookmarksToolbar_jsp.class  
>   inflating: jsp/advanced/header_jsp.class  
>   inflating: jsp/advanced/workingSet_jsp.class  
>   inflating: jsp/advanced/content_jsp.class  
>   inflating: jsp/advanced/tabs_jsp.class  
>   inflating: jsp/advanced/advanced_jsp.class  
>   inflating: jsp/advanced/help_jsp.class  
>   inflating: jsp/advanced/nav_jsp.class  
>   inflating: jsp/advanced/search_jsp.class  
>   inflating: jsp/advanced/deferredView_jsp.class  
>   inflating: jsp/advanced/tocView_jsp.class  
>   inflating: jsp/advanced/helpToolbar_jsp.class  
>   inflating: jsp/advanced/printConfirm_jsp.class  
>   inflating: jsp/advanced/contentToolbar_jsp.class  
>   inflating: jsp/advanced/tocToolbar_jsp.class  
>   inflating: jsp/advanced/view_jsp.class  
>   inflating: jsp/advanced/livehelp_005fjs_jsp.class  
>   inflating: jsp/advanced/printError_jsp.class  
>   inflating: jsp/advanced/indexView_jsp.class  
>   inflating: jsp/advanced/searchScoped_jsp.class  
>   inflating: jsp/advanced/err_jsp.class  
>   inflating: jsp/advanced/workingSetManager_jsp.class  
>   inflating: jsp/advanced/bookmarksView_jsp.class  
>   inflating: jsp/advanced/index_jsp.class  
>   inflating: jsp/index_jsp.class     
290,291c345
<   inflating: META-INF/maven/eclipse.platform.ua/org.eclipse.help.webapp/pom.properties  
< 
---
>   inflating: META-INF/maven/eclipse.platform.ua/org.eclipse.help.webapp/pom.properties
Comment 8 Thanh Ha CLA 2013-01-10 16:51:54 EST
Created attachment 225480 [details]
jsp.patch v2

Updated patch to set the packageRoot.
Comment 9 Thanh Ha CLA 2013-01-11 10:51:01 EST
(In reply to comment #8)
> Created attachment 225480 [details]
> jsp.patch v2
> 
> Updated patch to set the packageRoot.

I did a comparison of the contents of org.eclipse.help.webapp produced by this patch and org.eclipse.help.webapp_3.6.200.v20121217-201048.jar that I downloaded from build.eclipse.org.

Below a.txt is CBI and b.txt is PDE build.


% diff a.txt b.txt                                                                                                                                                      01/11/13
4,8c4,6
< ./META-INF/maven
< ./META-INF/maven/eclipse.platform.ua
< ./META-INF/maven/eclipse.platform.ua/org.eclipse.help.webapp
< ./META-INF/maven/eclipse.platform.ua/org.eclipse.help.webapp/pom.xml
< ./META-INF/maven/eclipse.platform.ua/org.eclipse.help.webapp/pom.properties
---
> ./META-INF/ECLIPSE_.RSA
> ./META-INF/ECLIPSE_.SF
> ./META-INF/eclipse.inf
167a166
> ./.api_description
340d338
< ./org/eclipse/help/webapp/package.html



It looks like other than the maven metadata, signing (which I didn't enable in my build), and .api_description which CBI is not producing yet. The only thing that's different between the 2 jars is the last item:

  ./org/eclipse/help/webapp/package.html

It seems like the CBI build is adding this while the PDE build does not include it. I guess we need to include an exclude filter so that CBI build also doesn't include this file.
Comment 10 Paul Webster CLA 2013-01-11 10:58:42 EST
(In reply to comment #9)
> 
>   ./org/eclipse/help/webapp/package.html
> 

Could you open a new bug for this, as I believe we need to exclude this from all of the bundles?  If you look in http://build.eclipse.org/eclipse/builds/comparator/output/l_org.eclipse.core.commands_diff.txt (and many of the other files in the output directory) we have a lot of package.html files we probably don't want.

PW
Comment 11 Thanh Ha CLA 2013-01-11 11:12:52 EST
(In reply to comment #10)
> (In reply to comment #9)
> > 
> >   ./org/eclipse/help/webapp/package.html
> > 
> 
> Could you open a new bug for this, as I believe we need to exclude this from
> all of the bundles?  If you look in
> http://build.eclipse.org/eclipse/builds/comparator/output/l_org.eclipse.core.
> commands_diff.txt (and many of the other files in the output directory) we
> have a lot of package.html files we probably don't want.
> 
> PW

I created Bug 397990 to track the issue with package.html.

I think this patch is ready to be merged into R3_8_maintenance and master.
Comment 13 Thanh Ha CLA 2013-01-11 14:21:41 EST
Need to take another look at this patch. When running a full build I get the error below. It looks like it's trying to build the jsp's across modules. My guess at the moment is that using the parameter "<webAppSourceDirectory>.</webAppSourceDirectory>" was my mistake. I will try changing this to specifically point to the org.eclipse.help.webapp module project directory.


[ERROR] Failed to execute goal org.mortbay.jetty:jetty-jspc-maven-plugin:8.1.8.v20121106:jspc (jspc) on project org.eclipse.help.webapp: Failure processing jsps: file:/home/user/Downloads/eclipse2/eclipse.platform.releng.aggregator/eclipse.jdt.ui/org.eclipse.jdt.ui.examples.javafamily/sample/easy.jsp(15,16) PWC6236: According to TLD or attribute directive in tag file, attribute value does not accept any expressions -> [Help 1]
Comment 14 Paul Webster CLA 2013-01-11 14:29:01 EST
Will you have a fix soon, or should I revert the patch?

PW
Comment 15 Thanh Ha CLA 2013-01-11 14:43:09 EST
(In reply to comment #14)
> Will you have a fix soon, or should I revert the patch?
> 
> PW

I'm trying to get a fix right now, it might be better to revert for now in case I can't figure it out today. I will attach a new complete patch when it's ready.


I just tried changing the parameter to use ${basedir} instead of "." and am now running into a new error below:


[ERROR] Failed to execute goal org.mortbay.jetty:jetty-jspc-maven-plugin:8.1.8.v20121106:jspc (jspc) on project org.eclipse.help.webapp: Failure processing jsps: PWC6033: Error in Javac compilation for JSP
[ERROR] 
[ERROR] PWC6197: An error occurred at line: 318 in the jsp file: /advanced/workingSetManager.jsp
[ERROR] PWC6199: Generated servlet error:
[ERROR] cannot access org.eclipse.help.internal.workingset.WorkingSet
[ERROR] class file for org.eclipse.help.internal.workingset.WorkingSet not found
[ERROR] -> [Help 1]
Comment 16 Paul Webster CLA 2013-01-11 14:46:12 EST
I've reverted the fix temporarily.

PW
Comment 17 Thanh Ha CLA 2013-01-11 14:48:47 EST
(In reply to comment #15)
> I just tried changing the parameter to use ${basedir} instead of "." and am
> now running into a new error below:

Strangely, if I build just the module by itself it is successful. The error only appears when it build the entire platform build.
Comment 18 Paul Webster CLA 2013-01-11 14:55:17 EST
What if you use ${project.build.directory}

PW
Comment 19 Thanh Ha CLA 2013-01-11 15:19:39 EST
(In reply to comment #18)
> What if you use ${project.build.directory}
> 
> PW

I just tried "${project.build.directory}/../" and it produces the same result as when I use ${basedir}. Success when building the module alone. Failure when building the full platform build.

Using ${project.build.directory} without the /../ part points it to the ./target directory which causes it to not find any of the jsp files.

I think the key issue is this part:

[ERROR] cannot access org.eclipse.help.internal.workingset.WorkingSet
[ERROR] class file for org.eclipse.help.internal.workingset.WorkingSet not found


For whatever reason when building the whole platform build, it is not able to find the class file which provides org.eclipse.help.internal.workingset.WorkingSet

I wonder if we need to provide additional parameters, classesDirectory [1] maybe?

[1] http://wiki.eclipse.org/Jetty/Feature/Jetty_Jspc_Maven_Plugin
Comment 20 Thanh Ha CLA 2013-01-11 15:59:43 EST
Looks like the classpath dependencies maven calculates are different when running a full build vs building the module by itself.


% diff /tmp/module-only.log /tmp/full-build.log
4,5c4,25
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/framework/org.eclipse.osgi/3.9.0-SNAPSHOT/org.eclipse.osgi-3.9.0-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar
---
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-antlr.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-bcel.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-bsf.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-log4j.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-oro.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-regexp.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-resolver.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-apache-xalan2.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-commons-logging.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-commons-net.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-jai.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-javamail.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-jdepend.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-jmf.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-jsch.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-junit.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-junit4.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-launcher.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-netrexx.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-swing.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant-testutil.jar
> [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/.cache/tycho/org.apache.ant-1.8.4.v201209061652.jar/lib/ant.jar
12,23d31
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/platform/runtime/org.eclipse.core.contenttype/3.4.200-SNAPSHOT/org.eclipse.core.contenttype-3.4.200-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.preferences/3.5.0-SNAPSHOT/org.eclipse.equinox.preferences-3.5.0-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.registry/3.5.300-SNAPSHOT/org.eclipse.equinox.registry-3.5.300-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.common/3.6.100-SNAPSHOT/org.eclipse.equinox.common-3.6.100-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/platform/runtime/org.eclipse.core.expressions/3.4.500-SNAPSHOT/org.eclipse.core.expressions-3.4.500-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/platform/runtime/org.eclipse.core.runtime/3.9.0-SNAPSHOT/org.eclipse.core.runtime-3.9.0-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/platform/runtime/org.eclipse.core.jobs/3.5.300-SNAPSHOT/org.eclipse.core.jobs-3.5.300-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.app/1.3.100-SNAPSHOT/org.eclipse.equinox.app-1.3.100-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.http.registry/1.1.200-SNAPSHOT/org.eclipse.equinox.http.registry-1.1.200-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.jsp.jasper/1.0.400-SNAPSHOT/org.eclipse.equinox.jsp.jasper-1.0.400-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/org/eclipse/equinox/bundles/org.eclipse.equinox.jsp.jasper.registry/1.0.300-SNAPSHOT/org.eclipse.equinox.jsp.jasper.registry-1.0.300-SNAPSHOT.jar
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/eclipse/platform/ua/org.eclipse.help/3.6.0-SNAPSHOT/org.eclipse.help-3.6.0-SNAPSHOT.jar
25d32
< [DEBUG] Adding to classpath dependency file: /var/tmp/lts/R43_localrepo/eclipse/platform/ua/org.eclipse.help.base/4.0.0-SNAPSHOT/org.eclipse.help.base-4.0.0-SNAPSHOT.jar
Comment 21 Thanh Ha CLA 2013-01-15 12:34:49 EST
Created attachment 225652 [details]
jsp.patch v3

Update with latest version of patch. This patch still has the issues regarding running a full build.
Comment 22 Thanh Ha CLA 2013-01-15 22:29:28 EST
Created attachment 225677 [details]
jsp.patch v4

Per Bug 398215 Comment 2 adding the parameter

    <useProvidedScope>true</useProvidedScope>

Seems to resolve the issue when running a full build. Attached patch is updated with the fix.
Comment 23 Paul Webster CLA 2013-01-16 13:05:49 EST
We've activated gerrit for eclipse.platform.ua, you can use that to submit the changes for that repo from now on ... well, with some guidelines :-)

http://wiki.eclipse.org/Gerrit#Adding_a_dedicated_remote

I'm going to try and push this and review it and commit it.

https://git.eclipse.org/r/#/c/9710/

PW
Comment 24 Paul Webster CLA 2013-01-16 13:22:16 EST
https://git.eclipse.org/r/9711 for R3_8_maintenance

PW
Comment 25 Paul Webster CLA 2013-01-16 13:25:35 EST
Now https://git.eclipse.org/r/9712
PW
Comment 26 Paul Webster CLA 2013-01-16 13:30:19 EST
Released in master and R3_8_maintenance
PW