Tag: maven

什么是maven中的“pom”包装?

我被给了一个maven项目来编译和部署在tomcat服务器上。 今天之前我从来没有用过maven,但是我一直在用googlesearch。 看来这个项目中的顶级pom.xml文件的打包types设置为pom 。 mvn install后我应该做些什么来部署这个应用程序? 我期待着能够在某处或某处findwar档案,但我想我正在寻找错误的地方或错过了一步。

安装Java JDK 7之后对于Mac OS X – mvn -version仍然显示java版本1.6.0_31

Oracle在4月26日发布了针对Mac OS X的Java JDK 7。我遵循了安装说明,当我在terminal窗口中执行java -version时,我得到: java version "1.7.0_04" Java(TM) SE Runtime Environment (build 1.7.0_04-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode) 但是当我在terminal窗口中执行mvn -version ,我得到: Apache Maven 3.0.2 (r1056850; 2011-01-08 18:58:10-0600) Java version: 1.6.0_31, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.7.3", […]

无效的目标释放:1.7

我看过类似的问题,但还没有find答案。 使用maven编译,我得到: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project api: Fatal error compiling: invalid target release: 1.7 -> [Help 1] 这是pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> Javac版本: javac 1.7.0_25 Java版本: java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) […]

我该如何告诉Spring Boot可执行jar使用哪个主类?

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.0.1.RELEASE:repackage failed: Unable to find a single main class from the following candidates 我的项目有一个main方法不止一个类。 如何告诉Spring Boot Maven插件应该使用哪个类作为主类?

为什么没有人使用make for Java?

几乎所有我见过的Java项目都使用Maven或Ant。 他们是很好的工具,我认为任何项目都可以使用它们。 但是发生了什么? 它用于各种非Java项目,并可以轻松处理Java。 当然,如果你使用Windows,你必须下载make.exe,但Ant和Maven也不能使用JDK。 与Java一起使用时,是否存在一些基本缺陷? 仅仅是因为Ant和Maven是用Java编写的?

如何从命令行禁用Maven Javadoc插件?

在pom.xml中我有这样的声明 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> 有没有办法从命令行closures? 我知道我可以将其提取到configuration文件中,但这不是我想要的。

m2e不支持maven-dependency-plugin(目标是“copy-dependencies”,“unpack”)

我有一个相当简单的Maven项目: <project> <dependencies> … </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.4</version> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/dependencies</outputDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> 但是,在m2eclipse中我得到以下错误: Description Resource Path Location Type maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e. pom.xml /jasperreports-test line 60 Maven Project Build Lifecycle Mapping Problem 为什么我关心如果m2eclipse不“支持”这个任务? Maven的确如此,这就是我真正关心的。 我怎样才能在我的项目中得到这个错误消失?

一个gradle文件中有多个maven仓库

所以我的问题是如何将多个Maven仓库添加到一个Gradle文件。 这不工作: repositories { mavenCentral() maven { url "http://maven.springframework.org/release" url "http://maven.restlet.org" } }

通过Maven编译Java 7代码

我的pom文件列表 <project> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> … 然而,在mvn clean install ,我得到 [INFO] ————————————————————- [ERROR] COMPILATION ERROR : [INFO] ————————————————————- [ERROR] Failure executing javac, but could not parse the error: javac: invalid target release: 1.7 Usage: […]

我怎样才能得到maven-release-plugin跳过我的testing?

我怎样才能让maven-release-plugin在不触发testing的情况下运行? 我努力了 -Dmaven.test.skip=true 和 -DskipTests 和 -DpreparationGoals=clean …还没有工作。 是的,我知道如果testing不通过,我不应该放弃,但是我不能控制让我的同事写出可靠的testing。