You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Hawkboy <ch...@gmail.com> on 2016/02/23 17:23:06 UTC

when dependencies from pom starts to be resolved ?

Hello,

I've been using properties-maven-plugin bound to validation phase in 
order to set some environment properties that is needed for the 
different targets. it's been working pretty well.

I have a case now where I'll need different artifact versions for each 
different target environments.

Then I tried to add the versions in the same properties files being used 
and set the pom to use them. for example:

          <dependency>
             <groupId>com.hawk</groupId>
             <artifactId>runtime.controller</artifactId>
<version>${runtime.controller.version}</version>
         </dependency>

But that didn't work as I expected. The ide/m2e is complained about a 
non existing dependency and I could see a 
"${runtime.controller.version}" directory was created in the local 
repository.

questions:
  - is dependencies resolution done before the plugins lifecycle to start ?
  - is the properties written in the pom the only way to set 
dependencies versions?

many thanks,

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: when dependencies from pom starts to be resolved ?

Posted by Hawkboy <ch...@gmail.com>.
Hi Karl,

Thanks for the inputs and sorry for do not have used the right channel.

Our product uses OSGi and we have customers running them using different 
containers.

In case of equinox, for every release (kepler, juno, mars) we have 
almost the same set of bundles but with different versions. We need 
these set of dependencies in order to create a IDE target definition 
file, to run the IT and release the product.

we would like to not to pollute our already big releng parent pom with 
every set. that was the reason that I thought about to put those set of 
versions inside a properties file and attach each one to the parent pom 
using different classifiers. But this approach didn't work.

I also tried a different approach: to create a pom fragment containing 
only dependencyManagement and use the import scope when using it on 
other poms. But unfortunately with this approach we can't use profile 
and also we can't share the properties used to tag the dependencies with 
out IT code...

anyway thanks.

On 23/02/2016 15:44, Karl Heinz Marbaise wrote:
> Hi,
>
> first this is the maven developers list...this question belongs more 
> to the user list...
>
> Apart from that
> On 2/23/16 5:23 PM, Hawkboy wrote:
>> Hello,
>>
>> I've been using properties-maven-plugin bound to validation phase in
>> order to set some environment properties that is needed for the
>> different targets. it's been working pretty well.
>>
>> I have a case now where I'll need different artifact versions for each
>> different target environments.
>
> If you have different versions for different targets you need to go 
> the way having different modules which have different versions...cause 
> versions (dependencies) will be solved during the reading of the 
> reactor...
>
> Furthermore i have the impression that you doing something wrong, 
> cause for different environments having different versions of an 
> artifact does not make sense from my point view...The software should 
> always be the same only some kind of enviornmental configurations like 
> urls / ip's / username / password parts make sense to have different...
>
>
>
>
>>
>> Then I tried to add the versions in the same properties files being used
>> and set the pom to use them. for example:
>>
>>           <dependency>
>>              <groupId>com.hawk</groupId>
>> <artifactId>runtime.controller</artifactId>
>> <version>${runtime.controller.version}</version>
>>          </dependency>
>>
>> But that didn't work as I expected. The ide/m2e is complained about a
>> non existing dependency and I could see a
>> "${runtime.controller.version}" directory was created in the local
>> repository.
>>
>> questions:
>>   - is dependencies resolution done before the plugins lifecycle to 
>> start ?
>>   - is the properties written in the pom the only way to set
>> dependencies versions?
>>
>> many thanks,
>
> Kind regards
> Karl Heinz Marbaise
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: when dependencies from pom starts to be resolved ?

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

first this is the maven developers list...this question belongs more to 
the user list...

Apart from that
On 2/23/16 5:23 PM, Hawkboy wrote:
> Hello,
>
> I've been using properties-maven-plugin bound to validation phase in
> order to set some environment properties that is needed for the
> different targets. it's been working pretty well.
>
> I have a case now where I'll need different artifact versions for each
> different target environments.

If you have different versions for different targets you need to go the 
way having different modules which have different versions...cause 
versions (dependencies) will be solved during the reading of the reactor...

Furthermore i have the impression that you doing something wrong, cause 
for different environments having different versions of an artifact does 
not make sense from my point view...The software should always be the 
same only some kind of enviornmental configurations like urls / ip's / 
username / password parts make sense to have different...




>
> Then I tried to add the versions in the same properties files being used
> and set the pom to use them. for example:
>
>           <dependency>
>              <groupId>com.hawk</groupId>
>              <artifactId>runtime.controller</artifactId>
> <version>${runtime.controller.version}</version>
>          </dependency>
>
> But that didn't work as I expected. The ide/m2e is complained about a
> non existing dependency and I could see a
> "${runtime.controller.version}" directory was created in the local
> repository.
>
> questions:
>   - is dependencies resolution done before the plugins lifecycle to start ?
>   - is the properties written in the pom the only way to set
> dependencies versions?
>
> many thanks,

Kind regards
Karl Heinz Marbaise


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org