Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Maven Integration (M2E) » running tomcat under elipse when using m2eclipse
running tomcat under elipse when using m2eclipse [message #16879] Wed, 01 October 2008 21:04 Go to next message
Eclipse UserFriend
Originally posted by: rusty.berkeley.edu

In my pom.xml file, in its properties section, I'm setting various
properties that are common to all builds, but which can be overridden in
profiles. I consider these my default properties.

In my profiles, in profiles.xml, I'm setting some properties that aren't
in the pom.xml because they're different for each profile.

My Spring configuration files are in src/main/resources.

When maven does the goal process-resources it copies those files to the
following directory and replaces the ${} placeholders, which is what the
tomcat that runs under eclipse uses:

<workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <my_app>/WEB-INF/classes

But it doesn't do the replacement for the properties that are only set
in the profiles.

As far as I can tell maven doesn't have a default profile so it seems to
me that my only options are to add these non-default properties to my
default properties, or to use the activation by the absence of a
property feature (section 11.3.2 in the Sonatype Definitive Guide).

Are there other (preferred?) alternatives I'm overlooking?
Re: running tomcat under elipse when using m2eclipse [message #16909 is a reply to message #16879] Wed, 01 October 2008 21:29 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Rusty,

You need to specify profiles that you want to be active on the Maven
properties page for your project. Also, you can specify what profiles
need to be activated by default in settings.xml, or declare activation
rules based on the presence of some system property.

For activation rules you can use system properties specific to Eclipse
(e.g. "eclipse.buildId", see more in Help / About Eclipse SDK /
Configuration Details), or add your own properties (-Dfoo=value) in
eclipse.ini or in Eclipse command line. Though please note that those
system properties are not inherited by the Maven process launched from
Run as... / Maven actions and you'll need to specify profile explicitly
in the Maven launch configuration dialog.

regards,
Eugene


Rusty Wright wrote:
> In my pom.xml file, in its properties section, I'm setting various
> properties that are common to all builds, but which can be overridden
> in profiles. I consider these my default properties.
>
> In my profiles, in profiles.xml, I'm setting some properties that
> aren't in the pom.xml because they're different for each profile.
>
> My Spring configuration files are in src/main/resources.
>
> When maven does the goal process-resources it copies those files to
> the following directory and replaces the ${} placeholders, which is
> what the tomcat that runs under eclipse uses:
>
> <workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <my_app>/WEB-INF/classes
>
>
> But it doesn't do the replacement for the properties that are only set
> in the profiles.
>
> As far as I can tell maven doesn't have a default profile so it seems
> to me that my only options are to add these non-default properties to
> my default properties, or to use the activation by the absence of a
> property feature (section 11.3.2 in the Sonatype Definitive Guide).
>
> Are there other (preferred?) alternatives I'm overlooking?
Re: running tomcat under elipse when using m2eclipse [message #16938 is a reply to message #16909] Wed, 01 October 2008 23:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rusty.berkeley.edu

"You need to specify profiles that you want to be active on the Maven
properties page for your project."

Excellent; thanks, that's what I was looking for. I didn't think to
look there. I was looking in preferences.


Eugene Kuleshov wrote:
> Rusty,
>
> You need to specify profiles that you want to be active on the Maven
> properties page for your project. Also, you can specify what profiles
> need to be activated by default in settings.xml, or declare activation
> rules based on the presence of some system property.
>
> For activation rules you can use system properties specific to Eclipse
> (e.g. "eclipse.buildId", see more in Help / About Eclipse SDK /
> Configuration Details), or add your own properties (-Dfoo=value) in
> eclipse.ini or in Eclipse command line. Though please note that those
> system properties are not inherited by the Maven process launched from
> Run as... / Maven actions and you'll need to specify profile explicitly
> in the Maven launch configuration dialog.
>
> regards,
> Eugene
>
>
> Rusty Wright wrote:
>> In my pom.xml file, in its properties section, I'm setting various
>> properties that are common to all builds, but which can be overridden
>> in profiles. I consider these my default properties.
>>
>> In my profiles, in profiles.xml, I'm setting some properties that
>> aren't in the pom.xml because they're different for each profile.
>>
>> My Spring configuration files are in src/main/resources.
>>
>> When maven does the goal process-resources it copies those files to
>> the following directory and replaces the ${} placeholders, which is
>> what the tomcat that runs under eclipse uses:
>>
>> <workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <my_app>/WEB-INF/classes
>>
>>
>> But it doesn't do the replacement for the properties that are only set
>> in the profiles.
>>
>> As far as I can tell maven doesn't have a default profile so it seems
>> to me that my only options are to add these non-default properties to
>> my default properties, or to use the activation by the absence of a
>> property feature (section 11.3.2 in the Sonatype Definitive Guide).
>>
>> Are there other (preferred?) alternatives I'm overlooking?
Re: running tomcat under elipse when using m2eclipse [message #16968 is a reply to message #16938] Wed, 01 October 2008 23:10 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
For the future reference, there is a documentation on the wiki for
that. http://docs.codehaus.org/display/M2ECLIPSE/Dependency+Manage ment

Actually, we could use some help from the community to expand
documentation on the wiki. So, by all means, please feel free to edit
anything that need to be clarified or improved.

Thanks

Eugene


Rusty Wright wrote:
> "You need to specify profiles that you want to be active on the Maven
> properties page for your project."
>
> Excellent; thanks, that's what I was looking for. I didn't think to
> look there. I was looking in preferences.
>
>
> Eugene Kuleshov wrote:
>> Rusty,
>>
>> You need to specify profiles that you want to be active on the Maven
>> properties page for your project. Also, you can specify what profiles
>> need to be activated by default in settings.xml, or declare
>> activation rules based on the presence of some system property.
>>
>> For activation rules you can use system properties specific to
>> Eclipse (e.g. "eclipse.buildId", see more in Help / About Eclipse SDK
>> / Configuration Details), or add your own properties (-Dfoo=value) in
>> eclipse.ini or in Eclipse command line. Though please note that those
>> system properties are not inherited by the Maven process launched
>> from Run as... / Maven actions and you'll need to specify profile
>> explicitly in the Maven launch configuration dialog.
>>
>> regards,
>> Eugene
>>
>>
>> Rusty Wright wrote:
>>> In my pom.xml file, in its properties section, I'm setting various
>>> properties that are common to all builds, but which can be
>>> overridden in profiles. I consider these my default properties.
>>>
>>> In my profiles, in profiles.xml, I'm setting some properties that
>>> aren't in the pom.xml because they're different for each profile.
>>>
>>> My Spring configuration files are in src/main/resources.
>>>
>>> When maven does the goal process-resources it copies those files to
>>> the following directory and replaces the ${} placeholders, which is
>>> what the tomcat that runs under eclipse uses:
>>>
>>> <workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <my_app>/WEB-INF/classes
>>>
>>>
>>> But it doesn't do the replacement for the properties that are only
>>> set in the profiles.
>>>
>>> As far as I can tell maven doesn't have a default profile so it
>>> seems to me that my only options are to add these non-default
>>> properties to my default properties, or to use the activation by the
>>> absence of a property feature (section 11.3.2 in the Sonatype
>>> Definitive Guide).
>>>
>>> Are there other (preferred?) alternatives I'm overlooking?
Re: running tomcat under elipse when using m2eclipse [message #17029 is a reply to message #16968] Fri, 03 October 2008 20:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rusty.berkeley.edu

On the wiki, for Active Maven Profiles it says "If specified, dependencies from these profiles will be picked up." Does that mean it only uses the profile I put there for resolving dependencies or will it use that profile for anything and everything it could affect; for example, setting properties?

I'm confused because in my project's properties, under Maven, I have localhost-postgres specified for the Active Maven Profiles. In Eclipse's Run menu I have a run configuration named active-profiles, and the Goals box contains help:active-profiles and the Profiles: box is empty, and when I run that, in the Eclipse console window it doesn't list any active profiles.


Eugene Kuleshov wrote:
>
> For the future reference, there is a documentation on the wiki for
> that. http://docs.codehaus.org/display/M2ECLIPSE/Dependency+Manage ment
>
> Actually, we could use some help from the community to expand
> documentation on the wiki. So, by all means, please feel free to edit
> anything that need to be clarified or improved.
>
> Thanks
>
> Eugene
>
>
> Rusty Wright wrote:
>> "You need to specify profiles that you want to be active on the Maven
>> properties page for your project."
>>
>> Excellent; thanks, that's what I was looking for. I didn't think to
>> look there. I was looking in preferences.
>>
>>
>> Eugene Kuleshov wrote:
>>> Rusty,
>>>
>>> You need to specify profiles that you want to be active on the Maven
>>> properties page for your project. Also, you can specify what profiles
>>> need to be activated by default in settings.xml, or declare
>>> activation rules based on the presence of some system property.
>>>
>>> For activation rules you can use system properties specific to
>>> Eclipse (e.g. "eclipse.buildId", see more in Help / About Eclipse SDK
>>> / Configuration Details), or add your own properties (-Dfoo=value) in
>>> eclipse.ini or in Eclipse command line. Though please note that those
>>> system properties are not inherited by the Maven process launched
>>> from Run as... / Maven actions and you'll need to specify profile
>>> explicitly in the Maven launch configuration dialog.
>>>
>>> regards,
>>> Eugene
>>>
>>>
>>> Rusty Wright wrote:
>>>> In my pom.xml file, in its properties section, I'm setting various
>>>> properties that are common to all builds, but which can be
>>>> overridden in profiles. I consider these my default properties.
>>>>
>>>> In my profiles, in profiles.xml, I'm setting some properties that
>>>> aren't in the pom.xml because they're different for each profile.
>>>>
>>>> My Spring configuration files are in src/main/resources.
>>>>
>>>> When maven does the goal process-resources it copies those files to
>>>> the following directory and replaces the ${} placeholders, which is
>>>> what the tomcat that runs under eclipse uses:
>>>>
>>>> <workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <my_app>/WEB-INF/classes
>>>>
>>>>
>>>> But it doesn't do the replacement for the properties that are only
>>>> set in the profiles.
>>>>
>>>> As far as I can tell maven doesn't have a default profile so it
>>>> seems to me that my only options are to add these non-default
>>>> properties to my default properties, or to use the activation by the
>>>> absence of a property feature (section 11.3.2 in the Sonatype
>>>> Definitive Guide).
>>>>
>>>> Are there other (preferred?) alternatives I'm overlooking?
Re: running tomcat under elipse when using m2eclipse [message #17091 is a reply to message #17029] Fri, 03 October 2008 20:35 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Rusty Wright wrote:
> On the wiki, for Active Maven Profiles it says "If specified,
> dependencies from these profiles will be picked up." Does that mean it
> only uses the profile I put there for resolving dependencies or will
> it use that profile for anything and everything it could affect; for
> example, setting properties?
I suppose text on the wiki is bit confusing. We don't do anything
special with specified profiles, just make them active, so maven would
use them for anything.

Note that there is several cases when Maven is launched:

* dependency resolution
* maven project builder
* launch maven from Run/Debug menu

The first one is using profiles specified in the project preferences
and I am almost certain that builder is also using those. Predefined
actions like "Run As... / Maven package" don't use those profiles now,
but there is a jira issue for that, please vote there.
http://jira.codehaus.org/browse/MNGECLIPSE-895

> I'm confused because in my project's properties, under Maven, I have
> localhost-postgres specified for the Active Maven Profiles. In
> Eclipse's Run menu I have a run configuration named active-profiles,
> and the Goals box contains help:active-profiles and the Profiles: box
> is empty, and when I run that, in the Eclipse console window it
> doesn't list any active profiles.
I don't think it would be appropriate to implicitly add project's
profiles into the general Maven launch configuration UI, so when
"profiles" field is empty help:active-profiles is not supposed to show
anything (unless you activate those profiles automatically based on some
properties or other conditions), but please feel free to comment on that
in MNGECLIPSE-895.

regards,
Eugene
Re: running tomcat under elipse when using m2eclipse [message #17149 is a reply to message #17091] Fri, 03 October 2008 21:39 Go to previous message
Eclipse UserFriend
Originally posted by: rusty.berkeley.edu

Ah, I see. Thanks.

I added a jira comment suggesting adding a check box specifying to force adding the profile in the Properties when you use a Run/Debug configuration.


Eugene Kuleshov wrote:
> Rusty Wright wrote:
>> On the wiki, for Active Maven Profiles it says "If specified,
>> dependencies from these profiles will be picked up." Does that mean it
>> only uses the profile I put there for resolving dependencies or will
>> it use that profile for anything and everything it could affect; for
>> example, setting properties?
> I suppose text on the wiki is bit confusing. We don't do anything
> special with specified profiles, just make them active, so maven would
> use them for anything.
>
> Note that there is several cases when Maven is launched:
>
> * dependency resolution
> * maven project builder
> * launch maven from Run/Debug menu
>
> The first one is using profiles specified in the project preferences
> and I am almost certain that builder is also using those. Predefined
> actions like "Run As... / Maven package" don't use those profiles now,
> but there is a jira issue for that, please vote there.
> http://jira.codehaus.org/browse/MNGECLIPSE-895
>
>> I'm confused because in my project's properties, under Maven, I have
>> localhost-postgres specified for the Active Maven Profiles. In
>> Eclipse's Run menu I have a run configuration named active-profiles,
>> and the Goals box contains help:active-profiles and the Profiles: box
>> is empty, and when I run that, in the Eclipse console window it
>> doesn't list any active profiles.
> I don't think it would be appropriate to implicitly add project's
> profiles into the general Maven launch configuration UI, so when
> "profiles" field is empty help:active-profiles is not supposed to show
> anything (unless you activate those profiles automatically based on some
> properties or other conditions), but please feel free to comment on that
> in MNGECLIPSE-895.
>
> regards,
> Eugene
>
Previous Topic:stable dev build 0.9.7.20081001-2217 is published
Next Topic:eclipse red error circles in profiles.xml
Goto Forum:
  


Current Time: Tue Mar 19 03:18:34 GMT 2024

Powered by FUDForum. Page generated in 0.03833 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top