You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andrew Hughes <ah...@gmail.com> on 2012/04/24 03:00:54 UTC

Are, ALWAYS active? (interval:5 not working)

Hi All,

I have configured the following to perform (local) snapshot updates every
5mins... unfortunately the dependencies DO NOT update at the prescribed
5min interval. Could it be that the <activeProfiles> do not ALWAYS
activate? I do have a specific -P dev (project defined) profile enabled
while building, will this deactivate the settings.xml <activeProfiles>? Or
any other circumstances for that matter?

If anyone has a better way of doing this or if there is a problem with my
settings below, I'm all ear's :)

Cheers.


the settings.xml.....

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>snapshots</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
    <server>
      <id>releases</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <id>acme-nexus</id>
  <url>http://acme.com/nexus/content/groups/public/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
  <profiles>
<profile>
      <id>acme</id>
      <repositories>
        <repository>
          <id>acme-nexus</id>
          <name>acme-nexus</name>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>interval:5</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
          <url>http://acme.com/nexus/content/groups/public/</url>
          <layout>default</layout>
        </repository>
      </repositories>
</profile>
  </profiles>
  <activeProfiles>
<activeProfile>acme</activeProfile>
  </activeProfiles>
</settings>

Re: Are, ALWAYS active? (interval:5 not working)

Posted by Wayne Fay <wa...@gmail.com>.
> Why would m2e have a difference update/cache policy
> on dependencies to that of maven?

You'd have to ask that on the m2e users list @ Eclipse.org. They have
their own list(s).

Wayne

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


Re: Are, ALWAYS active? (interval:5 not working)

Posted by Stephen Connolly <st...@gmail.com>.
On 24 April 2012 03:02, Andrew Hughes <ah...@gmail.com> wrote:

> OK, I found a way to confirm...
>
> <activeProfiles> are always active!!!! Exactly what I wanted as documented
> :)
>
> However, the problem persisted... until...
>
> I noticed that builds on the command line worked fine, as did 'install'
> e.t.c from within eclipse. However, the m2eclipse dependencies refused to
> update. Is it possible that the eclipse plugin has some internal cache that
> holds into dependencies and overrides those from maven? I also tried maven
> -> update dependencies, fail, I also did maven -> update project
> configuration, fail.... then I did maven -> update project configuration +
> force update of Snapshot / Releases..... SUCCESS.
>
> Why would m2e have a difference update/cache policy on dependencies to that
> of maven?
>

I would suspect because the session never ends, and there is checking once
per session only if the update policy demands it

You can get the very same behaviour from a very very long running Maven
build, where the snapshot is resolved once during the build only, even if
plugins further in the build do explicit resolves.


>
> Cheers.
>
>
>
> On Tue, Apr 24, 2012 at 11:06 AM, Richard W. Eggert II <
> richard.eggert@gmail.com> wrote:
>
> > On 4/23/2012 9:15 PM, Benson Margulies wrote:
> >
> >> On Mon, Apr 23, 2012 at 9:00 PM, Andrew Hughes<ah...@gmail.com>
> >>  wrote:
> >>
> >>> Hi All,
> >>>
> >>> I have configured the following to perform (local) snapshot updates
> every
> >>> 5mins... unfortunately the dependencies DO NOT update at the prescribed
> >>> 5min interval. Could it be that the<activeProfiles>  do not ALWAYS
> >>> activate? I do have a specific -P dev (project defined) profile enabled
> >>> while building, will this deactivate the settings.xml<activeProfiles>?
> Or
> >>> any other circumstances for that matter?
> >>>
> >>> If anyone has a better way of doing this or if there is a problem with
> my
> >>> settings below, I'm all ear's :)
> >>>
> >> Or wars?
> >>
> >> activeProfiles are only active until some explicit profile is
> >> activated from the command line, I believe. You need to make your
> >> profile use an activation that will always be satisfied instead.
> >>
> >>
> >>
> > If I recall correctly, you can disable an active profile by explicitly
> > disabling it by prefixing the name with '!'.  For example, if your active
> > profile is named "foo", you could run the "package" goal with the profile
> > disabled like so:
> > mvn package -P !foo
> >
> > Rich Eggert
> >
> >
> > ------------------------------**------------------------------**---------
> > To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<
> users-unsubscribe@maven.apache.org>
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Are, ALWAYS active? (interval:5 not working)

Posted by Andrew Hughes <ah...@gmail.com>.
OK, I found a way to confirm...

<activeProfiles> are always active!!!! Exactly what I wanted as documented
:)

However, the problem persisted... until...

I noticed that builds on the command line worked fine, as did 'install'
e.t.c from within eclipse. However, the m2eclipse dependencies refused to
update. Is it possible that the eclipse plugin has some internal cache that
holds into dependencies and overrides those from maven? I also tried maven
-> update dependencies, fail, I also did maven -> update project
configuration, fail.... then I did maven -> update project configuration +
force update of Snapshot / Releases..... SUCCESS.

Why would m2e have a difference update/cache policy on dependencies to that
of maven?


Cheers.



On Tue, Apr 24, 2012 at 11:06 AM, Richard W. Eggert II <
richard.eggert@gmail.com> wrote:

> On 4/23/2012 9:15 PM, Benson Margulies wrote:
>
>> On Mon, Apr 23, 2012 at 9:00 PM, Andrew Hughes<ah...@gmail.com>
>>  wrote:
>>
>>> Hi All,
>>>
>>> I have configured the following to perform (local) snapshot updates every
>>> 5mins... unfortunately the dependencies DO NOT update at the prescribed
>>> 5min interval. Could it be that the<activeProfiles>  do not ALWAYS
>>> activate? I do have a specific -P dev (project defined) profile enabled
>>> while building, will this deactivate the settings.xml<activeProfiles>? Or
>>> any other circumstances for that matter?
>>>
>>> If anyone has a better way of doing this or if there is a problem with my
>>> settings below, I'm all ear's :)
>>>
>> Or wars?
>>
>> activeProfiles are only active until some explicit profile is
>> activated from the command line, I believe. You need to make your
>> profile use an activation that will always be satisfied instead.
>>
>>
>>
> If I recall correctly, you can disable an active profile by explicitly
> disabling it by prefixing the name with '!'.  For example, if your active
> profile is named "foo", you could run the "package" goal with the profile
> disabled like so:
> mvn package -P !foo
>
> Rich Eggert
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Are, ALWAYS active? (interval:5 not working)

Posted by "Richard W. Eggert II" <ri...@gmail.com>.
On 4/23/2012 9:15 PM, Benson Margulies wrote:
> On Mon, Apr 23, 2012 at 9:00 PM, Andrew Hughes<ah...@gmail.com>  wrote:
>> Hi All,
>>
>> I have configured the following to perform (local) snapshot updates every
>> 5mins... unfortunately the dependencies DO NOT update at the prescribed
>> 5min interval. Could it be that the<activeProfiles>  do not ALWAYS
>> activate? I do have a specific -P dev (project defined) profile enabled
>> while building, will this deactivate the settings.xml<activeProfiles>? Or
>> any other circumstances for that matter?
>>
>> If anyone has a better way of doing this or if there is a problem with my
>> settings below, I'm all ear's :)
> Or wars?
>
> activeProfiles are only active until some explicit profile is
> activated from the command line, I believe. You need to make your
> profile use an activation that will always be satisfied instead.
>
>

If I recall correctly, you can disable an active profile by explicitly 
disabling it by prefixing the name with '!'.  For example, if your 
active profile is named "foo", you could run the "package" goal with the 
profile disabled like so:
mvn package -P !foo

Rich Eggert

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


Re: Are, ALWAYS active? (interval:5 not working)

Posted by Benson Margulies <bi...@gmail.com>.
On Mon, Apr 23, 2012 at 9:00 PM, Andrew Hughes <ah...@gmail.com> wrote:
> Hi All,
>
> I have configured the following to perform (local) snapshot updates every
> 5mins... unfortunately the dependencies DO NOT update at the prescribed
> 5min interval. Could it be that the <activeProfiles> do not ALWAYS
> activate? I do have a specific -P dev (project defined) profile enabled
> while building, will this deactivate the settings.xml <activeProfiles>? Or
> any other circumstances for that matter?
>
> If anyone has a better way of doing this or if there is a problem with my
> settings below, I'm all ear's :)

Or wars?

activeProfiles are only active until some explicit profile is
activated from the command line, I believe. You need to make your
profile use an activation that will always be satisfied instead.


>
> Cheers.
>
>
> the settings.xml.....
>
> <?xml version="1.0" encoding="UTF-8"?>
> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
> http://maven.apache.org/xsd/settings-1.0.0.xsd">
>  <servers>
>    <server>
>      <id>snapshots</id>
>      <username>admin</username>
>      <password>admin123</password>
>    </server>
>    <server>
>      <id>releases</id>
>      <username>admin</username>
>      <password>admin123</password>
>    </server>
>  </servers>
>  <mirrors>
>    <mirror>
>      <id>acme-nexus</id>
>  <url>http://acme.com/nexus/content/groups/public/</url>
>      <mirrorOf>*</mirrorOf>
>    </mirror>
>  </mirrors>
>  <profiles>
> <profile>
>      <id>acme</id>
>      <repositories>
>        <repository>
>          <id>acme-nexus</id>
>          <name>acme-nexus</name>
>          <releases>
>            <enabled>true</enabled>
>            <updatePolicy>never</updatePolicy>
>            <checksumPolicy>fail</checksumPolicy>
>          </releases>
>          <snapshots>
>            <enabled>true</enabled>
>            <updatePolicy>interval:5</updatePolicy>
>            <checksumPolicy>fail</checksumPolicy>
>          </snapshots>
>          <url>http://acme.com/nexus/content/groups/public/</url>
>          <layout>default</layout>
>        </repository>
>      </repositories>
> </profile>
>  </profiles>
>  <activeProfiles>
> <activeProfile>acme</activeProfile>
>  </activeProfiles>
> </settings>

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