Re: artifactory and snapshots vs releases

2008-05-14 Thread [EMAIL PROTECTED]
Rick schrieb:
 On Thu, May 8, 2008 at 11:56 PM, Wendy Smoak [EMAIL PROTECTED] wrote:
   
 On Thu, May 8, 2008 at 8:45 PM, Rick [EMAIL PROTECTED] wrote:

 If you have both a repository and a snapshotRepository, Maven will
 choose based on whether the version number ends in -SNAPSHOT.  Magic.
 :)  See 
 http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_distributionManagement
 

 Thanks again Wendy.

 Another hopefully quick one... The better builds guide mentions about
 filenames being used with timestamps appended etc, but yet whenever I
 do mvn deploy, I never see that timestamp either in my local m2 repo
 or in my corporate rep snapshots dir, It only ever has the version as
 I've declared in the pom version for the project. I never see
 filenames being created as described below, so I'm wondering if I have
 things set up incorrectly:

 quote page 216 Better Builds With Maven
 You'll see that it is treated differently than when it was installed
 in the local repository. The filename
 that is used is similar to proficio-api-1.0-20060211.131114-1.jar. In
 this case, the version
 used is the time that it was deployed (in the UTC timezone) and the
 build number. If you were to
 deploy again, the time stamp would change and the build number would
 increment to 2.

 This technique allows you to continue using the latest version by
 declaring a dependency on 1.0-
 SNAPSHOT, or to lock down a stable version by declaring the dependency
 version to be the specific
 equivalent such as 1.0-20060211.131114-1. While this is not usually
 the case, locking the
 version in this way may be important if there are recent changes to
 the repository that need to be ignored temporarily.
 /quote
   

Try setting this property:
uniqueVersiontrue/uniqueVersion
in the distributionManagement/repository section of your pom.

See:
 
http://maven.apache.org/ref/current/maven-model/maven.html#class_distributionManagement

Regards,
Simon


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: artifactory and snapshots vs releases

2008-05-10 Thread Rick
On Sat, May 10, 2008 at 1:19 AM, Wendy Smoak [EMAIL PROTECTED] wrote:
 On Fri, May 9, 2008 at 7:30 AM, Rick [EMAIL PROTECTED] wrote:

 Another hopefully quick one... The better builds guide mentions about
 filenames being used with timestamps appended etc, but yet whenever I
 do mvn deploy, I never see that timestamp either in my local m2 repo
 or in my corporate rep snapshots dir, It only ever has the version as
 I've declared in the pom version for the project.

 What is an example of a version number you're using?

 If your version number ends in -SNAPSHOT, and you haven't set
 uniqueVersion=false in distributionManagement, then you should see
 timestamped files in the remote snapshotRepository after you deploy.

me == moron (mostly:)
I 'think' everything is ok. I stated a major falsehood above.. in my
local repo things are fine - I apologize I don't know what I was
looking at to assume it wasn't working there (maybe I was an idiot and
since I was working with Artificatory all day I just quickly saw
1.0-SNAPSHOT and assumed it was a file and not dir to traverse -
regardless, I was an idiot there.)  However, it is Artificatory I was
really confused, since In Artificatory I'll only see something like
1.0-SNAPSHOT.jar listed.. but in the maven-metadata.xml you will see
the versioning change when you deploy new ones. I'm assuming that's
behaving as normal? (I know this isn't an Artificatory list, but was
just curious.)

I did see this in their FAQ:

Why do you strongly recommend against deploying unique snapshots?

Because doing so normally promotes an unmanageable build environment.
In practice, unique snapshots are never tracked for the real changes
they carry: the snapshot's final name is not human deterministic and
its meaning is normally obscure to developers since, by itself, it
has no relation to the source it has been compiled against. Moreover,
many times snapshots in a multi-module environment are dependent on
other snapshots, so you would have to reconstruct by hand a cryptic
dependency chain just to get back to a version you believe is stable.
Often, the identification process of such a version is, by itself,
obscure and is based on common inputs such as yesterday before
lunchtime everything worked
Therefore, it is highly preferable to use non-unique snapshots in
development and, when needing, go back to a stable non-snapshot
version by reconstructing one from a specific revision/tag in the VCS,
where the meaning of the artifact can be easily tracked. It is advised
to have the artifact itself embed the revision/tag (as part of its
name or internally) for clear and visible revision tracking.

-- 
Rick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: artifactory and snapshots vs releases

2008-05-09 Thread Rick
On Thu, May 8, 2008 at 11:56 PM, Wendy Smoak [EMAIL PROTECTED] wrote:
 On Thu, May 8, 2008 at 8:45 PM, Rick [EMAIL PROTECTED] wrote:

 If you have both a repository and a snapshotRepository, Maven will
 choose based on whether the version number ends in -SNAPSHOT.  Magic.
 :)  See 
 http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_distributionManagement

Thanks again Wendy.

Another hopefully quick one... The better builds guide mentions about
filenames being used with timestamps appended etc, but yet whenever I
do mvn deploy, I never see that timestamp either in my local m2 repo
or in my corporate rep snapshots dir, It only ever has the version as
I've declared in the pom version for the project. I never see
filenames being created as described below, so I'm wondering if I have
things set up incorrectly:

quote page 216 Better Builds With Maven
You'll see that it is treated differently than when it was installed
in the local repository. The filename
that is used is similar to proficio-api-1.0-20060211.131114-1.jar. In
this case, the version
used is the time that it was deployed (in the UTC timezone) and the
build number. If you were to
deploy again, the time stamp would change and the build number would
increment to 2.

This technique allows you to continue using the latest version by
declaring a dependency on 1.0-
SNAPSHOT, or to lock down a stable version by declaring the dependency
version to be the specific
equivalent such as 1.0-20060211.131114-1. While this is not usually
the case, locking the
version in this way may be important if there are recent changes to
the repository that need to be ignored temporarily.
/quote

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: artifactory and snapshots vs releases

2008-05-09 Thread Wendy Smoak
On Fri, May 9, 2008 at 7:30 AM, Rick [EMAIL PROTECTED] wrote:

 Another hopefully quick one... The better builds guide mentions about
 filenames being used with timestamps appended etc, but yet whenever I
 do mvn deploy, I never see that timestamp either in my local m2 repo
 or in my corporate rep snapshots dir, It only ever has the version as
 I've declared in the pom version for the project.

What is an example of a version number you're using?

If your version number ends in -SNAPSHOT, and you haven't set
uniqueVersion=false in distributionManagement, then you should see
timestamped files in the remote snapshotRepository after you deploy.

This page doesn't say, but I'm fairly sure the default is 'true'
http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_snapshotRepository

Is this with the same config you pasted earlier, only a single
repository vs. both repository and snapshotRepository?  Try it
with them  separated and see if that works.

-- 
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: artifactory and snapshots vs releases

2008-05-08 Thread Wendy Smoak
On Thu, May 8, 2008 at 8:45 PM, Rick [EMAIL PROTECTED] wrote:

  I have in my project pom:

  distributionManagement
 repository
 idsnapshots/id
 urldav:http://internalURL:8081/artifactory/libs-snapshots/url
 /repository

 /distributionManagement

If you have both a repository and a snapshotRepository, Maven will
choose based on whether the version number ends in -SNAPSHOT.  Magic.
:)  See 
http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_distributionManagement
.

You can establish an organization-level parent pom with
distributionManagement and anything else you want to be inherited by
all of your projects.

 Lastly, just out of curiosity why aren't these plugins like the
 maven-compile and release part of the archetype or at least stubbed
 out in the generation from the archetype? Seems like they'd almost
 always be used?

Maven knows about (for example) the compiler and surefire plugins.
Unless you need to change the defaults you won't need to configure
them in your project's pom.  See
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings

-- 
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]