gradle - Eclipse/Tomcat publishing unnecessary/problematic dependencies -


so first off, little background.

i working on converting eclipse java web project gradle. use vaadin framework , manage project ant/maven/ivy. have project contains common code web project depends on. in both projects our library files, jars, included in source , committed our vcs. switch gradle using preferred method of pulling our dependencies repository; maven central.

i have completed creating gradle build scripts correspond our current ant build scripts. have 1 gradle build script each project, 1 @ root configuration injection along settings file. using java , eclipse plugins both projects , additionally war , vaadin plugins web project.

now problem. when use gradle construct war works , web-inf/lib directory contains jars expect, based on dependency configuration. however, when use tomcat inside eclipse publish project end bunch of additional jars in web-inf/lib directory. of jars harmless , unnecessary, why have excluded them war, there couple problematic because tomcat has them. in 1 case ignores jar , usual message of:

[tomcat] validatejarfile(*) - jar not loaded.

in other case receive exceptions in console, troubling if application appears work correctly. noticed dependencies associated testcompile configuration being published, doesn't seem right.

the exact offending jars tomcat-jdbc , servlet-api-2.5. tomcat-jdbc jar required compiling our common code. servlet-api-2.5 jar transitive dependency of vaadin-client-compiler. have removed dependency vaadin-client-compiler in our web project, because doesn't appear necessary, looks still being pulled in configuration in vaadin plugin gradle. however, in both cases using providedcompile configuration of war plugin exclude them form war.

so question is, how keep tomcat/eclipse publishing these jars? how gradle , tomcat/eclipse communicate, or @ all? can gather seems gradle , tomcat/eclipse communicate indirectly via .classpath, eclipse plugin gradle modifies. also, have tried eclipse-wtp plugin gradle. did not seem resolve issue because problematic jars still being copied. not sure whether need use plugin or if can use eclipse plugin.

i should add did install gradle integration eclipse "plugin" via eclipse marketplace. used configure -> convert gradle project option adds gradle -> refresh dependencies functionality provides. other that, found little buggy i've been running gradle via command line.

below output of running gradle -v on machine:

------------------------------------------------------------ gradle 1.10 ------------------------------------------------------------ build time:   2013-12-17 09:28:15 utc build number: none revision:     36ced393628875ff15575fa03d16c1349ffe8bb6 groovy:       1.8.6 ant:          apache ant(tm) version 1.9.2 compiled on july 8 2013 ivy:          2.2.0 jvm:          1.8.0_05 (oracle corporation 25.5-b02) os:           mac os x 10.9.3 x86_64 

please let me know if additional clarification required. assume must doing wrong or missing configuration because surely scenario quite common. many developers use tomcat inside eclipse test web applications locally , popularity of gradle surprised if hasn't run before. seem main difference our switch gradle, far tomcat/eclipse concerned, our dependencies being loaded repository instead of being linked directly in source.

any appreciated.

however, when use tomcat inside eclipse publish project end bunch of additional jars in web-inf/lib directory. of jars harmless , unnecessary, why have excluded them war, there couple problematic because tomcat has them.

this known problem gradle eclipse tooling. problem doesn't understand dependencies 'provided' scope. see issue details: https://issuetracker.springsource.com/browse/sts-2380

there workaround problem. common dependencies 'cause problems' can globally excluded via list of regexps specify in preferences. open menu "window >> preferences >> gradle >> wtp". that's can add regexps used exclude jars 'deployment assembly'.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -