使用单个命令在当前工作空间中构建所有Eclipse Maven项目? [英] Single command to build all Eclipse maven projects in current workspace?
问题描述
没有人知道在当前工作空间中构建所有Maven项目的任何简单但有效的方法,例如,为每个此类项目进行maven全新安装.
Does anyone know any simple yet effective way to build all Maven projects in current workspace, for example, maven clean install for each such project.
例如,是否可以选择多个项目并使用类似于$ {project_loc}的项目,或者弹出带有可能项目的弹出窗口以用于运行配置?还是其他方式?
Is it for example possible to select multiple projects and use something similar to ${project_loc} or get a popup with possible projects to use for the run configuration? Or any other way?
我正在使用Eclipse Juno.
I'm using Eclipse Juno.
推荐答案
您能给他们全部一个父pom.xml,然后又给它们mvn compile
父pom.xml吗?
Can you give them all a parent pom.xml and then mvn compile
the parent pom.xml?
此处..
如果您可以指定相对路径,这应该不太困难.使用pom.xml创建一个新的maven项目,如下所示:
If you can specify relative paths, this shouldn't be too hard. Create a new maven project with a pom.xml something like:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven. apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>parent-app</artifactId>
<packaging>pom</packaging>
<version>1</version>
<modules>
<module>../project1</module>
<module>../project2</module>
</modules>
</project>
从Eclipse工作区(而不是文件系统)中删除项目,然后导入父maven项目.现在您可以:
Delete the projects from your Eclipse workspace (but not the file system) and then import the parent maven project. Now you can:
Run As...
> Maven build
> clean compile
(作为目标)
Run As...
> Maven build
> clean compile
(as Goals)
它应该清理并编译所有项目.
and it should clean and compile all the projects.
这篇关于使用单个命令在当前工作空间中构建所有Eclipse Maven项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!