Tag: maven 2

Eclipse – java.lang.ClassNotFoundException

当试图从Eclipse启动我的JUnit-Test时,我得到一个“ClassNotFoundException”。 当从控制台运行“mvntesting” – 一切工作正常。 另外,在Eclipse中没有报道的问题。 我的项目结构如下: 父项目(包装) Web项目(战争包装 – 我的JUnittesting在这里) Flex项目 configuration项目 编辑:怎么能不能find这个类? 这是一个简单的HelloWorld应用程序,没有特殊的库。 这里是我的JUnit的运行configuration: alt text http://www.walkner.biz/_temp/runco​​nfig.png Testclass(但正如我所说;它不适用于一个简单的HelloWorld …): import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import biz.prognoserechnung.domain.User; import biz.prognoserechnung.domain.UserRepository; import biz.prognoserechnung.domain.hibernate.UserHibernateDao; public class UserDaoTest { /** * the applicationcontext. */ private ApplicationContext ctx = null; /** * the […]

无法构buildorg.apache.maven.plugin.war.util.WebappStructure,因为它没有无参数构造函数

[INFO] [war:war {execution: default-war}] [INFO] Packaging webapp [INFO] ———————————————————————— [ERROR] FATAL ERROR [INFO] ———————————————————————— [INFO] Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor —- Debugging information —- message : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException cause-message : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not […]

Maven:如何将JAR包含在J2EE项目中?

在我的J2EE项目中,我有一些依赖项,这些依赖项在任何Maven仓库中都不可用,因为它们是专有的库。 这些库需要在运行时可用,所以必须复制到目标/…/ WEB-INF / lib … 现在,我将它们作为系统依赖列出在我的POM中,但是这个方法的问题是,在编译期间没有被复制到目标版本。 这种方法也不是很优雅。 那么把它们整合到Maven中的最好方法是哪个? 注意:我不想创build我自己的Maven仓库。

Maven2:企业项目的最佳实践(EAR文件)

我只是从Ant切换到Maven,并试图找出build立基于EAR文件的企业项目的最佳做法? 比方说,我想用EJB的jar文件,Web层的WAR文件和封装的EAR文件,以及相应的部署描述符创build一个非常标准的项目。 我将如何去呢? 使用archetypeArtifactId=maven-archetype-webapp创build项目与war文件一样,并从那里扩展? 什么是最好的项目结构(和POM文件的例子)呢? 你在哪里粘贴ear文件相关的部署描述符等? 谢谢你的帮助。

是否有可能重新命名一个maven jar -with-dependencies?

我目前正在使用jar-with-dependencies程序集来创build这样一个jar。 不过,我的jar的名字有点长。 由于这个jar被AS400上的RPG程序所使用,我想缩短它,使开发人员的生活变得容易一些。 但是,除了手工,我还没有find一种方法来重新命名从通常的project-name-version-classifier-jar-with-dependencies.jar 。 我想要像project-name-version-classifier-full.jar这样的东西 有没有办法做到这一点,没有基本上复制jar-with-dependencies程序集描述符,并调用它完整? 另外,我想继续保存没有组装在存储库中的类path的jar。 我需要两件神器。 与我的分类器持有build设的地区的jar子。 与所有依赖包括该地区的jar子。 project-name-version-region-full.jar和project-name-version-region.jar应该存储在存储库中。 在第一个例子中,分类器是区域满的,在第二个区域。 后者正在工作。

列出Maven 2中所有可能的目标?

我是来自ant世界的Maven的新手。 是否可以列出你可以运行的所有可能的目标(包括所有的插件)? 我可以看到在Maven 1中曾经有一个-g标志,但在版本2中不可用。

mvn干净安装与部署与发布

我只是在学习maven,而我们最近需要越来越多。 我想知道之间的区别 mvn clean install mvn release mvn deploy 请尽可能描述。

无法在Windows上安装Maven:“JAVA_HOME被设置为无效的目录”

我遵循了Maven的教程 ,但我仍然无法在Windows上安装Maven。 当我在命令提示符下运行以下命令时: E:\Documents and Settings\zach>mvn –version 我得到: 'mvn' is not recognized as an internal or external command, operable program or batch file. 我导航到Maven安装文件夹,运行mvn –version ,得到: E:\java resources\apache-maven-2.2.0\bin>mvn –version ERROR: JAVA_HOME is set to an invalid directory. JAVA_HOME = "E:\Sun\SDK\jdk\bin" Please set the JAVA_HOME variable in your environment to match the location of your Java […]

禁用Maven警告消息 – “所选的war文件包含一个将被忽略的WEB-INF / web.xml”

当使用Maven 2.1.1构buildWAR包时,我得到这个警告信息: [WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ig nored (webxml attribute is missing from war task, or ignoreWebxml attribute is specifi ed as 'true') 有没有办法消除它? 这不会影响build设过程,但我不想看到它。

如何安装Maven与Yum?

我试图不学习关于百胜或maven的很多。 我inheritance了这个代码,我不想在这个环境中花费更多的时间。 我有百胜餐饮。 我的安装“有”(“也附上”?“知道”?)两个回购:亚马逊和JPackage,我明白是一个标准。 (实际上,每个库都由两个子库组成,但我不认为这是造成问题的原因。) 当我问yum安装maven2时,它拒绝了,说从未听说过maven2。 当我问yum安装maven2 忽略亚马逊时 ,它是这样做的,但它安装了相当古老的Maven 2.0.9。 我有实际的pom.xml需要更高的版本。 当我使用Google的Maven仓库时,我得到了Maven可以用来构build其他东西的仓库,而不是Yum可以用来安装Maven的仓库。 (我find了一个包含让Maven创buildYum的东西的仓库,我认为Google现在正在嘲笑我。 所以,我需要的是指向包含我需要安装Maven 2.2.1的任何回购的回购文件 。 如果不是所有这些节省劳力的设备,我都可以完成一些工作。