Maven 找不到HttpSession类
我正在Grails2.3.7上使用groovy构建一个项目。而不是使用默认的grails插件,我希望将插件配置为maven依赖项 我还希望使用jetty服务器代替tomcat服务器,使用mongodb代替常规关系数据库 创建项目后,我执行了“grails create pom”为项目创建pom.xml文件 我在pom.xml中添加了以下更改Maven 找不到HttpSession类,maven,grails,jetty,maven-jetty-plugin,Maven,Grails,Jetty,Maven Jetty Plugin,我正在Grails2.3.7上使用groovy构建一个项目。而不是使用默认的grails插件,我希望将插件配置为maven依赖项 我还希望使用jetty服务器代替tomcat服务器,使用mongodb代替常规关系数据库 创建项目后,我执行了“grails create pom”为项目创建pom.xml文件 我在pom.xml中添加了以下更改 删除了hibernate的依赖项,并为mongodb添加了以下依赖项 <dependency> <groupId>org.g
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>mongodb</artifactId>
<version>3.0.1</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
任何人都可以告诉我,我缺少什么插件,或者我配置不正确。将此添加到pom.xml中,看看是否有帮助:-
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
javax.servlet
javax.servlet-api
3.0.1
只需在Maven Spring项目中使用JUint和Mockito将其添加到模拟会话中即可,谢谢。
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.mycompany:grails-mongodb-demo:grails-app:0.1
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 200, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building grails-mongodb-demo 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ grails-mongodb-demo ---
[INFO] Deleting /mnt/data/Work/Tutorials/Practice/grails/grails-mongodb-demo/target
[INFO] Deleting /mnt/data/Work/Tutorials/Practice/grails/grails-mongodb-demo/plugins (includes = [**/*], excludes = [])
[INFO]
[INFO] --- grails-maven-plugin:2.3.7:clean (default-clean) @ grails-mongodb-demo ---
[WARNING] Grails Start with out fork
|Loading Grails 2.3.7
|Configuring classpath
|Running pre-compiled script
.
|Environment set to development
....................
|Application cleaned.
[INFO]
[INFO] --- grails-maven-plugin:2.3.7:validate (default-validate) @ grails-mongodb-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.3.7:init (default-init) @ grails-mongodb-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.3.7:config-directories (default-config-directories) @ grails-mongodb-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.3.7:maven-compile (default-maven-compile) @ grails-mongodb-demo ---
[WARNING] Grails Start with out fork
|Loading Grails 2.3.7
|Configuring classpath
|Running pre-compiled script
..........
|Compiling 12 source files
.Error
|
Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: javax/servlet/http/HttpSession (Use --stacktrace to see the full trace)
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>