我已经为我的POM添加了一个新的依赖项。 有一个简单的命令,我可以运行下载这个依赖项到我的仓库?
我有一个maven2多模块项目,并在我的每个子模块中,我有Test.javatesting和集成testing命名为Test.java和Integration.java JUnittesting。 当我执行时: mvn test 子模块内的所有JUnittesting*Test.java被执行。 当我执行 mvn test -Dtest=**/*Integration 没有一个Integration.javatesting在子模块中得到执行。 这些对我来说似乎是完全一样的命令,但是带有-Dtest = / * Integration **的那个不起作用,它显示了在父级别运行的0个testing,没有任何testing
在代码中从maven的pom.xml中检索版本号的最简单的方法是什么?
我注意到,在Maven工件的JAR中,project.version属性包含在两个文件中: META-INF/maven/${groupId}/${artifactId}/pom.properties META-INF/maven/${groupId}/${artifactId}/pom.xml 有没有推荐的方式来阅读这个版本在运行时?
我正在使用Maven(和Maven Eclipse Integration)来pipe理Eclipse中Java项目的依赖关系。 来自Maven仓库的JAR文件的自动下载function是一个实时的节省。 不幸的是,它不包含API文档和源代码。 我如何设置Maven自动获取源代码和javadoc附件,并在Eclipse中正确注册它们?
我目前正在将一些项目从Ant移植到Maven。 就我而言,我想用完善的约定来寻找groupId和artifactId ,但是我找不到任何详细的约定(有一些,但是他们没有涵盖我想知道的要点)。 以这个项目为例,首先是Java包: com.mycompany.teatimer 茶定时器实际上是两个字,但Java包命名约定禁止插入下划线或连字符,所以我一起写。 我select了与包ID相同的groupId ,因为我认为这是个好主意。 是吗? 最后,我必须select一个artifactId ,我现在去teatimer 。 但是当我查看其他Maven项目时,他们使用连字符来分割artifactId的单词,例如: tea-timer 。 但是,当连接到groupId : com.mycompany.teatimer.tea-timer时,它看起来很奇怪。 你会怎么做? 另一个例子: 包名称: com.mycompany.awesomeinhouseframework groupId : com.mycompany.awesomeinhouseframework (?) artifactId : awesome-inhouse-framework (?)
我有一个大型的Maven项目,有许多模块和pom.xmls。 而且这个项目已经发生了很大的变化,我相信这个pom必须有一些不必要的依赖关系。 有没有人知道是否有一个命令,你可以运行删除任何毫无意义的依赖从一个POM?
任何想法可能是什么原因呢? 无法findXML模式命名空间的Spring NamespaceHandler [ http://www.springframework.org/schema/security] org.springframework.web.context.ContextLoader initWebApplicationContext: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security] Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml] 这是我的applicationContext.xml: <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> … </beans:beans> 在我的pom.xml中,我有: <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>3.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-openid</artifactId> <version>3.0.1.RELEASE</version> […]
我有一个项目有几个模块。 当所有的testing通过,Maventesting运行它们。 当第一个模块中的testing失败时,maven将不会继续下一个项目。 我在Surefire设置中将testFailureIgnore设置为true,但是没有帮助。 我如何让Maven运行所有testing?
有人能告诉我ant和Maven之间的区别吗? 我从来没有用过。 我知道他们习惯于自动化Java项目的构build,但是我不知道从哪里开始。