Tag: maven 2

java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet

我使用的是Spring 3.1.0.RELEASE ,而我的servlet容器是tomcat 7,而我的IDE是eclipse indigo ,而包含DispatcherServlet的jar spring-webmvc-3.1.0.RELEASE.jar存在于lib文件夹中,运行应用程序,我得到的例外: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:126) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1043) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 请告知为什么我得到这个exception,以及如何解决这个问题。 编辑:以下是我的configuration文件: 1- .springBeans: <?xml version="1.0" encoding="UTF-8"?> <beansProjectDescription> <version>1</version> <pluginVersion><![CDATA[2.9.0.201203011806-RELEASE]]></pluginVersion> <configSuffixes> <configSuffix><![CDATA[xml]]></configSuffix> </configSuffixes> <enableImports><![CDATA[false]]></enableImports> <configs> <config>src/main/webapp/WEB-INF/checkout-servlet.xml</config> […]

以下工件无法parsing:javax.jms:jms:jar:1.1

我正在编译一个maven项目,但是我系统地得到以下错误信息: [ERROR]Failed to execute goal on project …: Could not resolve dependencies for project …:war:1.0.0: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Failure to find javax.jms:jms:jar:1.1 in http://mirrors.ibiblio.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.ibiblio.mirror has elapsed or updates are forced -> […]

如何从Maven reactor构build中排除模块?

我们有一个有很多模块的Maven 2项目。 例: <modules> <module>common</module> <module>foo</module> <module>data</module> <module>bar</module> … more … </module> 假设“数据”模块的构build耗时,并且我们希望在项目由CI服务器构build时将其排除。 目前我们使用两个pom.xml文件来实现这一点。 一个拥有所有的模块,另一个拥有除了可以省略的CI之外的所有模块。 但是,这很烦人,因为有时我们忘记把一个新的模块放到这两个文件中。 有没有一个解决scheme,不需要两个单独的模块列表?

Maven:是否可以覆盖已经为父POM中的configuration文件定义的插件的configuration

在我的项目的POM父文件中,我有这样一个configuration文件来定义一些对这个项目有用的configuration(所以我不能摆脱这个父POM): <profile> <id>wls7</id> … <build> <plugins> <!– use java 1.4 –> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <fork>true</fork> <source>1.4</source> <target>1.4</target> <meminitial>128m</meminitial> <maxmem>1024m</maxmem> <executable>%${jdk14.executable}</executable> </configuration> </plugin> </plugins> </build> … </profile> 但是在我的项目中,我只想重写maven-compiler-plugin的configuration,以便使用jdk5而不是jdk4来编译testing类。 这就是为什么我在我的项目的POM中做了这个部分: <profiles> <profile> <id>wls7</id> <activation> <property> <name>jdk</name> <value>4</value> </property> </activation> <build> <directory>target-1.4</directory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> <id>my-testCompile</id> <phase>test-compile</phase> <goals> <goal>testCompile</goal> </goals> <configuration> <fork>true</fork> <executable>${jdk15.executable}</executable> <compilerVersion>1.5</compilerVersion> […]

有没有一个Maven的替代或端口的.NET世界?

有没有一个Maven的替代或端口的.NET世界? 我很乐意使用Java世界中的一个良好的依赖关系pipe理系统,但是我没有find与.NET项目相媲美的东西。

Maven WAR依赖

我正在编写一个验收testing项目,由于各种原因,这取决于另一个打包为WAR的项目。 我已经设法使用maven-dependency-plugin解压缩WAR,但是我不能让我的项目包含解压后的WEB-INF/lib/*.jar和WEB-INF/classes/*以包含在classpath中,所以构build失败。 有没有办法将这些文件包含到类path中,还是有更好的方法来取决于WAR? 非常感谢。

在Maven 2中,我怎么知道哪个依赖来自传递依赖?

我想知道我的pom.xml中描述的依赖关系在我的目标目录中带来了传递依赖项。 更确切地说,我在我的WEB-INF / lib目录中有“poi-2.5.1-final-20040804.jar”这个库,我想知道在我的pom.xml中有哪些依赖。

如何使用源和JavaDoc部署SNAPSHOT?

我想用我的快照部署源和javadocs。 这意味着我想要自动化以下命令: mvn clean source:jar javadoc:jar deploy 只是为了执行: mvn clean deploy 我不想在install阶段执行javadoc / sources生成(即本地生成)。 我知道source / javadoc插件可以与release插件的执行同步,但我不知道如何将它连接到快照发布。

configurationMaven 2 POM编辑器以源模式打开pom.xml文件

我使用Maven 2 POM Editor主要用于直接编辑POM XML文件。 有没有办法让编辑器始终打开“源”选项卡中的文件?

如何使用maven构build一个jar,忽略testing结果?

当我运行testing他们失败的现状,但我需要运行他们得到一些.class文件,这是我的jar子非常重要。 默认情况下,当testing结果失败,jar不生成,我可以在pom.xml中添加一个设置,忽略它,所以我可以构buildjar忽略testing结果? 我读了一些关于“Maven Surefire Plugin”的内容,但是我不知道如何使用它…