Eclipse中不考虑Maven配置文件 [英] Maven profiles are not considered in Eclipse

查看:70
本文介绍了Eclipse中不考虑Maven配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在pom.xml中定义了三个配置文件:

I have three profiles defined in my pom.xml:

   <profiles>
    <profile>
        <id>ABC</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <url.base>http://server1.de</url.base>
            <url.searchevse>/search</url.searchevse>
            <url.reservation>/reservation</url.reservation>
            <url.cancelation>/reservation/cancel</url.cancelation>
            <xxx.devmode>false</xxx.devmode>
        </properties>
    </profile>
    <profile>
        <id>XYZ</id>
        <properties>
            <url.base>http://server2.de</url.base>
            <url.searchevse>/cns/search</url.searchevse>
            <url.reservation>/cns/reservation</url.reservation>
            <url.cancelation>/cns/cancel_reservation</url.cancelation>
            <xxx.devmode>false</xxx.devmode>
        </properties>
    </profile> 
   <profile>
        <id>DEVELOPMENT</id>
        <properties>
            <url.base>http://localhost/noservices</url.base>
            <url.searchevse>/no/search</url.searchevse>
            <url.reservation>/no/reservation</url.reservation>
            <url.cancelation>/no/cancel_reservation</url.cancelation>
            <xxx.devmode>true</xxx.devmode>
        </properties>
    </profile>
</profiles>

在Eclipse中,我有一个运行配置

In Eclipse I have a Run Configuration

全新安装XYZ

clean install XYZ

我尝试在 Goals 字段和

全新安装

Goals 字段中输入

,在 Profiles 字段中输入XYZ.

in the Goals field and XYZ in the Profiles field.

问题:

从不使用定义的配置文件.

The defined profile is never used.

在属性"->"Maven"->活动Maven概要文件"下插入活动概要文件不起作用(或者我必须使用特殊的语法,例如在逗号后没有空格).

Inserting the active profile under Properties-->Maven-->Active Maven Profiles doesn't work (or do I have to use a special syntax, e.g. no spaces after a comma or so).

推荐答案

转到

属性-> Maven->活动Maven配置文件

Properties-->Maven-->Active Maven Profiles

并仅输入您要运行的配置文件名称.

and type in only the profile name that you want to run.

如果要运行"ABC"配置文件,请在活动Maven配置文件"输入框中的ABC中输入.

If you want to run your ABC profile type in ABC in the Active Maven Profile input box.

给出的描述(用逗号分隔)有些混乱.

在输入框中定义个人资料名称或ID后.您可以在服务器上清理并运行项目.这样,将运行您提到的活动Maven配置文件.

Once you define your profile name or id in the input box. You can clean and run your project on your server. By doing so your mentioned active maven profile will be run.

这篇关于Eclipse中不考虑Maven配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆