Tag: maven

如何使用Maven下载jar的源代码?

在我的项目中,我正在使用通过Maven提供的JAR文件。 但是Maven给我的只有这个jar – 没有javadocs,也没有消息源。 按下“下载源”不起作用:Eclipse仍然没有findjar的来源。 这取决于什么? 资料库应该自动提供来源? 可能是我需要在POM中写点东西来指导Maven下载源代码? 我目前的朋友如下: <repositories> <repository> <id>xuggle repo</id> <url>http://xuggle.googlecode.com/svn/trunk/repo/share/java/</url> </repository> </repositories> <dependencies> <dependency> <groupId>xuggle</groupId> <artifactId>xuggle-xuggler</artifactId> <version>5.3</version> <type>rar</type> </dependency> </dependencies> 为什么Maven不会对源代码下载失败提出任何意见?

brew安装maven 404错误

我做了一个brew install maven ,结果如下: ==> Downloading http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz ==> Best Mirror http://apache.oss.eznetsols.org/maven/binaries/apache-maven-3.0.4-bin.tar.gz curl: (22) The requested URL returned error: 404 Error: Download failed: http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz 起初我认为这是我的networking镜像问题。 但是我换了另一个networking,而且还是一样的。 而且4天后仍然是一样的错误。 我想知道其他人是否受到影响。 我应该怎么做才能用brew来安装maven?

为什么Gradle需要一个settings.gradle文件?

我要将我的Android项目从Ant转换为Gradle。 我的Eclipse工作区非常简单: Workspace MyApp MyApp-AndroidLibrary 当我在MyApp中添加build.gradle文件时,我想引用我的Android库项目: apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile project(':MyApp-AndroidLibrary') } 当我运行gradle构build时,出现了一个错误“Project with path”:MyApp-AndroidLibrary'在根项目中找不到',我为此search了一下,发现我需要在我的工作区中设置一个“settings.gradle”文件目录,添加 include ":MyApp" include ":MyApp-AndroidLibrary" 这看起来对我来说太糟糕了,为什么Gradle需要一个settings.gradle文件 ,为什么不提取我在依赖关系中定义的项目呢? 什么include真正的手段? 如果我在工作区中安装了附加应用程序和其他共享库,结构可能如下所示: Workspace App1 App2 Library1(Used by App1 & App2) Library2(Used only by App1) Library3(Used only by App2) 因为只有一个settings.gradle文件,我不得不将它们全部添加到settings.gradle中。 那味道不好。 是的,我可以重新组织结构,使Library2成为App1的子目录,而Library3成为App2的子目录,但是Library1呢? 对此有何评论?

重新运行Spring Boot Configuration Annotation Processor来更新生成的元数据

我已经添加: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> 每个intellij的请求/警告我的pom.xml 。 现在我看到“重新运行Spring Bootconfiguration注释处理器来更新生成的元数据”。 我该如何做intellij要求我做的事情? 这个链接, B.2使用注释处理器生成自己的元数据 ,没有说明。

如何在Maven settings.xml中设置存储库的顺序

我在我的settings.xml中有3个仓库,因为我需要所有的人工制品。 只要没有find依赖关系,Maven就会尝试 Downloading: http://some.server/mvn2repo/releases/org/apache/lucene/lucene-core/2.9.1/… [INFO] Unable to find resource 'org.apache.lucene:lucene-core:pom:2.9.1' in repository Downloading: http://some.server/mvn2repo/3rdParty/org/apache/lucene/lucene-core/2.9.1/… [INFO] Unable to find resource 'org.apache.lucene:lucene-core:pom:2.9.1' in repository Downloading: http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/2.9.1/lucene-core-2.9.1.pom <success> 所有的仓库,但大多数时候当然发现在中央(repo1)的神器。 我希望Maven先检查这个回购。 我尝试了settings.xml中的声明顺序,但没有奏效。 据fgysin我也尝试了相反的顺序,这并没有改变任何东西。 我的Maven版本: C:\>mvn -v Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.6.0_15 Java home: C:\Program Files\Java\jdk1.6.0_15\jre Default locale: de_AT, platform encoding: Cp1252 OS name: "windows vista" […]

从Maven启动H2数据库服务器?

假设我想为我的集成testing创build和使用H2数据库。 Maven有一个运行testing的命令: mvn test 。 有没有办法告诉maven启动H2数据库服务器进行testing,并在完成时停止它? 我想像这个工作类似于我可以通过Maven命令( mvn tomcat:run ) mvn tomcat:run 。 对不起,如果这个问题是荒谬的,我仍然围绕着新的概念。

'mvn'不被识别为内部或外部命令,

当我input命令mvn –version时,出现以下错误: “mvn”不被识别为内部或外部命令,可操作程序或batch file。 我也跟着这个,但是我仍然无法完成工作。 当我input这个命令echo %M2_HOME%我得到path打印为D:\Program Files\apache-maven-3.0.4当我input'echo%M2%'我得到的path打印为D:\Program Files\apache-maven-3.0.4\bin 环境: Windows XP

使用Maven解压zip内部拉链

我可以通过maven-dependency插件解压zip文件,但是目前我有这个zip文件里面的其他zip文件包含的问题,我也需要解压缩它们。 我怎样才能做到这一点?

Surefire并没有selectJunit 4testing

出于某种原因,我无法获得Maven 2 Surefire插件来执行JUnit 4testing课程。 public class SimpleTest { @org.junit.Test public void simple() { System.out.println("foo"); } } 不过如果我把这个类改成JUnit-3之类的,比如 public class SimpleTest extends junit.framework.TestCase { public void testBar() { System.out.println("bar"); } @org.junit.Test public void simple() { System.out.println("foo"); } } 然后它被执行。 以下是我所做的: 已validationMaven版本:Apache Maven 2.2.1(r801777; 2009-08-06 20:16:01 + 0100) 经过validation的Surefire版本:遵循这个build议 经过validation的Surefire版本:在我的~/.m2/repository/org/apache/maven/surefire检查了Surefire jar,它们都是版本2.4.2或2.4.3 做了一个mvn dependency:tree | grep junit mvn […]

从命令行取消激活mavenconfiguration文件

我有一个在我的maven设置文件〜/ .m2 / settings.xml中 默认激活的configuration文件。 是否有可能通过做这样的事情从命令行停用它: mvn -P!profileActivatedByDefault