If you create a minimal Roo project (i.e. with no entities or web layer) as follows:
... it oddly has a dependency upon the Servlet API:Code:G:\workspace\cat>roo ____ ____ ____ / __ \/ __ \/ __ \ / /_/ / / / / / / / / _, _/ /_/ / /_/ / /_/ |_|\____/\____/ 1.1.1.RELEASE [rev 156ccd6] Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER. roo> project --topLevelPackage com.example.cat Created G:\workspace\cat\pom.xml Created SRC_MAIN_JAVA Created SRC_MAIN_RESOURCES Created SRC_TEST_JAVA Created SRC_TEST_RESOURCES Created SRC_MAIN_WEBAPP Created SRC_MAIN_RESOURCES\META-INF\spring Created SRC_MAIN_RESOURCES\META-INF\spring\applicationContext.xml Created SRC_MAIN_RESOURCES\log4j.properties com.example.cat roo> exit
Is this a bug or is the servlet API actually required, even though there's no web layer? The same question goes for Flexjson, which I'm guessing Roo only uses when there's a web layer.Code:G:\workspace\cat>mvn dependency:tree [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'dependency'. [INFO] org.apache.maven.plugins: checking for updates from spring-maven-release [INFO] org.apache.maven.plugins: checking for updates from spring-maven-milestone [INFO] org.apache.maven.plugins: checking for updates from spring-roo-repository [INFO] org.codehaus.mojo: checking for updates from spring-maven-release [INFO] org.codehaus.mojo: checking for updates from spring-maven-milestone [INFO] org.codehaus.mojo: checking for updates from spring-roo-repository [INFO] ------------------------------------------------------------------------ [INFO] Building cat [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ [INFO] [dependency:tree {execution: default-cli}] [INFO] com.example.cat:cat:jar:0.1.0.BUILD-SNAPSHOT [INFO] +- junit:junit:jar:4.8.1:test [INFO] +- log4j:log4j:jar:1.2.16:compile [INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile [INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile [INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile [INFO] +- org.aspectj:aspectjrt:jar:1.6.11.M1:compile [INFO] +- org.aspectj:aspectjweaver:jar:1.6.11.M1:compile [INFO] +- javax.servlet:servlet-api:jar:2.5:provided [INFO] +- net.sf.flexjson:flexjson:jar:2.0:compile [INFO] +- org.springframework.roo:org.springframework.roo.annotations:jar:1.1.1.RELEASE:provided [INFO] +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile [INFO] | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile [INFO] +- org.springframework:spring-test:jar:3.0.5.RELEASE:test (scope not updated to compile) [INFO] +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile [INFO] +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile [INFO] | \- aopalliance:aopalliance:jar:1.0:compile [INFO] +- org.springframework:spring-aspects:jar:3.0.5.RELEASE:compile [INFO] | \- org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile [INFO] \- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22 seconds [INFO] Finished at: Mon Feb 07 11:46:14 EST 2011 [INFO] Final Memory: 20M/49M [INFO] ------------------------------------------------------------------------
FWIW, the above project still builds successfully with those two dependencies commented out.
The reason I'm asking is that I'm converting a Roo app from WAR to EAR format, and need to know what dependencies I can safely put in the WAR file's WEB-INF/lib folder as opposed to in the EAR file itself.


Reply With Quote
