[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [m2e-dev] Passing additional parameters to maven buildet
|
Your projects+settings work for me

On Tue, Dec 4, 2012 at 8:29 AM, Andrey Rusak
<rusak@xxxxxx> wrote:
Hi ALL,
I attached pom files I have and settings.xml file. I cleaned
them up and removed all unnecessary fragments.
You see, that projects A and B use BOM file – project C. version
of what version of project C should be applied specified by property ${abc}. In
other words, version of project C is managed by property ${abc}. As I wrote
before, it works fine when you run maven build in project B with specified
property –Dabc=1.2.0-SNAPSHOT . All other scenarios fail, including Eclipse
workspace…
It’s easy to re-create this structure and you’ll understand
where my problem is.
This is very important for me, please help!
From: RZ [mailto:rzhilkibaev@xxxxxxxxx]
Sent: Monday, December 03, 2012 11:30 PM
To: Andrey Rusak; Maven Integration for Eclipse developers mailing list
Subject: Re: [m2e-dev] Passing additional parameters to maven buildet
Hi Andrey,
Does "import project C" mean?
...
<dependency>
project_C_GAV
<dependency>
...
You probably need inheritance, not composition.
<project ...>
...
<parent>
project_C_GAV
</parent>
...
Thanks,
Renat
On Mon, Dec 3, 2012 at 10:27 AM, Andrey Rusak <rusak@xxxxxx> wrote:
Thank you for your comment.
Actually I know how maven works and my original question was
exactly addressed to m2e developers and it sounds the following: how can i
set/initialize maven properties to make them available for m2e plugin when it
builds workspace?
In my particular case i am explainig that my pom files have
references to maven property ${abc}, which i can easy set when building
projects from command line by setting argument -Dabc=foo. Please note, that
when i set property value from command line (not using profile) it's set for
all projects that are not related as children/parent between themselves. But
how can i get the same result when eclipse builds workspace?
Thanks in advance for ypur help.
Matthew Piggott <mpiggott@xxxxxxxxxxxx>
wrote:
These are really questions for the m2e-users list, m2e-dev
is intended for developing m2e.
I believe C would need to be a parent of both A and B for that to work.
On 3 December 2012 09:25, Andrey Rusak <rusak@xxxxxx> wrote:
Hi Fred,
Thank you for your response. However I am not sure it helps me.
I can not move all projects under one parent project. And even when specify a
profile in pom.xml file, which should set property ${abc} – id does not help
when Eclipse builds workspace.
Let me please provide you my scenario as a sample.
There are three projects (structure is very simple):
A
pom.xml
imports project C
uses ${abc}
B
pom.xml
imports project C
uses ${abc}
C (bom)
pom.xml
define property value <abc>foo</abc>
I have created maven profile which activated by default and
initializes property abc = foo
Now, I build project “C” – successfully;
When I build project “B” with maven option –Dabc=foo, the
property is set for all projects to “foo” value.
Build project “B”. error occurs because property ${abc} is not
initialized with vale in project “A”
BUT, I can not specify variable ${abc} to be used by m2e plugin
when it resolves dependencies.
Any ideas?
From: Fred
Bricon [mailto:fbricon@xxxxxxxxx]
Sent: Monday, December 03, 2012 3:01 PM
To: Andrey Rusak
Cc: Maven Integration for Eclipse developers mailing list
Subject: Re: [m2e-dev] Passing additional parameters to maven buildet
Either
put the profile in your settings.xml or in a parent project all other projects
will inherit from. Last option is to define the m2e profile on all of
these projects
On
Sat, Dec 1, 2012 at 12:20 PM, Andrey Rusak <rusak@xxxxxx> wrote:
Hi Fred and thank you for your fast response.
Yes I know how profile works, thanks. But there is another
problem of how Maven initialize and inherits property values.
Let me please provide scenario. When I’m building project A,
which has project B in dependency. Both of them use the same variable ${abc},
which I can define in maven profile as you are suggesting.
Then I perform build of project A. Maven applies variable value
${abc}=foo for project A, BUT it does not apply it for project B!
The problem is sorted only when I set variable value directly in
command line like –Dabc=foo. Then Maven applies this variable value for all
projects and their dependencies. It’s not a problem when you build projects
from command line. You always can specify this variable.
But other hand is Eclipse, which tries to build workspace with
“default” parameters, and I have no Idea how to pass this variable value to
Eclipse to build my workspace properly.
From: Fred
Bricon [mailto:fbricon@xxxxxxxxx]
Sent: Friday, November 30, 2012 6:29 PM
To: Andrey Rusak; Maven Integration for Eclipse developers mailing list
Subject: Re: [m2e-dev] Passing additional parameters to maven buildet
you
can either create a m2e profile in your pom.xml, that will only be active when
working within eclipse, like :
<profiles>
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<properties>
<abc>foo</abc>
</properties>
</profile>
</profiles>
Or
set a similar profile in your settings.xml
Fred
Bricon
On
Fri, Nov 30, 2012 at 4:23 PM, Andrey Rusak <rusak@xxxxxx> wrote:
Hi there,
I am trying to use custom variables in my project’s POM like ${abc}.
Normally this variable initialized from command line arguments when
maven build starts, e.g. mvn –Dabc=123
However, when the variable in not initialized with value (I will not
explain too much details why the variable is used for) build fails because the
variable is used for dependency management. Actually it’s fine for me when
projects built in Bamboo/Jenkins/etc. But we got problems in Eclipse workspace
when it can not resolve dependencies due to missing parameter.
So, summary of my question is how to pass custom
arguments/parameters in Eclipse maven builder, which resolves dependencies on
workspace.
Thanks in advance for any assistance.
Best regards,
Andrey Rusak
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev
--
"Have you tried turning it off and on again" - The IT Crowd
--
"Have you tried turning it off and on again" - The IT Crowd
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev
--
"Have you tried turning it off and on again" - The IT Crowd