简体   繁体   English

m2eclipse Maven构建参数

[英]m2eclipse maven build parameters

I am developing a spring mvc app using eclipse kepler with the m2eclipse plugin. 我正在使用带有m2eclipse插件的eclipse kepler开发spring mvc应用程序。 How do I create a war file from within eclipse using the m2e plugin? 如何使用M2e插件在Eclipse中创建War文件?

Do I use run as... maven build... ? 我是否使用run as... maven build... If so, how do I configure it? 如果是这样,我该如何配置? I right clicked on the root folder for the app in the eclipse workspace and chose run as... maven build... , which resulted in the following dialog box: 我右键单击Eclipse工作区中应用程序的根文件夹,然后选择run as... maven build... ,这将导致以下对话框:

But I do not know what parameters to enter into the dialog box. 但是我不知道要在对话框中输入什么参数。 Can anyone guide me through how to create the war file? 谁能指导我完成如何创建战争文件?

Put Goals as clean compile package 将目标作为clean compile package

There are three built-in build lifecycles: default, clean and site. 有三个内置的构建生命周期:默认,清除和站点。 The default lifecycle handles your project deployment, the clean lifecycle handles project cleaning, while the site lifecycle handles the creation of your project's site documentation. 默认生命周期处理项目部署,清理生命周期处理项目清理,而站点生命周期处理项目的站点文档的创建。

Each of these build lifecycles is defined by a different list of build phases, wherein a build phase represents a stage in the lifecycle. 这些构建生命周期中的每一个都由不同的构建阶段列表定义,其中,构建阶段代表生命周期中的一个阶段。

Read more about Build Lifecycle Basics 阅读有关构建生命周期基础的更多信息


Here is the complete description with snapshots Using the M2Eclipse Maven Plugin in Eclipse 这是快照的完整描述, 在Eclipse中使用M2Eclipse Maven插件

Please have a look at Tutorial - Maven Eclispe IDE Integration 请看一下教程-Maven Eclispe IDE集成

First of all you need war plugin configured in your pom.xml 首先,您需要pom.xml 配置war插件

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <!-- In version 2.1-alpha-1, this was incorrectly named warSourceExcludes -->
          <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <classpathPrefix>lib/</classpathPrefix>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...
</project>

which is associated with one of the phase (generally package ) then you need to put clean package in goals 与阶段(通常为package )之一相关联,则需要将clean package放入目标中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM