You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/02/13 17:56:27 UTC

Re: [m2] Maven vs source control

Thanks for your answer. 

Could you expand on why there's little point in versioning things in Maven.
I guess maybe I can understand why for the library repository (is it because
it in itself is almost "versioned"?), but what about everything else in
Maven? e.g. your project tree that you're developing with the source code,
configuration files, etc...

I'm not sure what you meant by there might be a point to versioning
everything in Maven using source control "only when you version control
server can behave like a webserver"



Graham Leggett wrote:
> 
> On Tue, February 13, 2007 6:40 pm, lightbulb432 wrote:
> 
>> What's the difference between Maven and version control repositories when
>> you're using both? Maven has its repository, but so does my version
>> control.
> 
> "repository" is the word used in both cases to describe the data store of
> record for each system, but a maven repository doesn't work anything like
> a version control repository, and vice versa.
> 
> They aren't the same thing.
> 
> In a version control system, a repository is the place where all the
> versions of the source being stored is kept.
> 
> In maven, the repository is a big directory tree where jar files[1] are
> stored, in such a way that the jar files can be referenced quickly and
> easily by maven.
> 
>> Is it possible to version everything in Maven using source control,
>> including the library repository?
> 
> No[2], there is little point in doing this.
> 
> [1] Or other files, maven repos can contain artifacts other than jar, but
> jar is most common.
> 
> [2] Ok, theoretically yes, but only when you version control server can
> behave like a webserver.
> 
> Regards,
> Graham
> --
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-vs-source-control-tf3221731s177.html#a8948205
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [m2] Maven vs source control

Posted by Graham Leggett <mi...@sharp.fm>.
lightbulb432 wrote:

> So if you are making minor revisions of your source repository all the time,
> does that mean your module repository is going to get enormous (because
> everytime you make a tiny change in your source, that classifies as a new
> module altogether, and the entire project gets put in its packaged form into
> the Maven repo?)

Yes, meaning that at some point you might want to remove very old 
artifacts and archive them away somewhere, when you are sure they will 
never be needed again.

Practically speaking though, it is unlikely in most cases you would ever 
need to do this, as compared to typical disk partition sizes, and 
typical jar sizes, it takes an awful lot of versions before this becomes 
a problem.

> What's the best practice regarding what people generally do? Do they only
> put their source code into the Maven repo as a module when its a release,
> rather than just another change as part of the development process?

All our source code goes into version control, and source releases are 
tagged in version control.

We have a company-private maven repository in the form of a webserver 
that contains all our jar releases over time. This serves as a record of 
all artifacts that ever went into uat or production.

This repository doesn't contain any snapshots, although it is possible 
to host snapshots in a repository if you want to (just watch the disk 
space).

This means that we have at any time, both the source code, as well as 
the resultant binaries as released, for all modules we maintain. Source 
under version control, binaries in a maven repository.

Maintaining all of this sounds frightening, however maven plugins exist 
that automate many of the tasks associated with making releases and 
deploying them places.

This helps you avoid many of the pitfalls involved in managing releases 
properly, the chief pitfall being developers who bypass your rules for 
releases and do their own thing.

Regards,
Graham
--

Re: How do you tell Maven 2 to use local jars instead of trying to download them?

Posted by Rod Mclaughlin <Ro...@omnimedix.org>.
Got it! Thanks

John Casey wrote:
> If indivo-client-java is in the modules list of the top level POM 
> (it's in
> the list of projects to be built when the build fires up), then it should
> find those libraries when the build runs at or past the 'package' 
> phase. If
> it's not in the modules list, then you'll need to go into the
> indivo-client-java project (wherever that is), and run `mvn install` 
> on it
> before proceeding with the rest of the build.
>
> -john
>
> On 2/13/07, Rod Mclaughlin <Ro...@omnimedix.org> wrote:
>>
>> We are just starting to use Maven2. One or two things puzzle us, and we
>> would be grateful for any answers. We've searched the web, looked in the
>> mailing lists, etc. without finding an answer. We are trying to install
>> INDIVO (indivohealth.org) by running 'MVN INSTALL' from the top level
>> where the top POM.xml is. It downloads a lot of third party jars, then
>> says
>>
>> *'Missing:
>> ----------
>> 1) org.indivo:indivo-client-java:jar:3.0-SNAPSHOT' *
>> regarding indivo-client-java-3.0-SNAPSHOT.jar which is in
>> ./client/java/target/, where it should be, so Maven doesn't need to
>> download it. How do we tell it to use the jars which are right there,
>> rather than looking all around the world for them? Thanks for any
>> feedback.
>> >>
>> >>
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>


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


Re: How do you tell Maven 2 to use local jars instead of trying to download them?

Posted by John Casey <ca...@gmail.com>.
If indivo-client-java is in the modules list of the top level POM (it's in
the list of projects to be built when the build fires up), then it should
find those libraries when the build runs at or past the 'package' phase. If
it's not in the modules list, then you'll need to go into the
indivo-client-java project (wherever that is), and run `mvn install` on it
before proceeding with the rest of the build.

-john

On 2/13/07, Rod Mclaughlin <Ro...@omnimedix.org> wrote:
>
> We are just starting to use Maven2. One or two things puzzle us, and we
> would be grateful for any answers. We've searched the web, looked in the
> mailing lists, etc. without finding an answer. We are trying to install
> INDIVO (indivohealth.org) by running 'MVN INSTALL' from the top level
> where the top POM.xml is. It downloads a lot of third party jars, then
> says
>
> *'Missing:
> ----------
> 1) org.indivo:indivo-client-java:jar:3.0-SNAPSHOT' *
> regarding indivo-client-java-3.0-SNAPSHOT.jar which is in
> ./client/java/target/, where it should be, so Maven doesn't need to
> download it. How do we tell it to use the jars which are right there,
> rather than looking all around the world for them? Thanks for any
> feedback.
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

How do you tell Maven 2 to use local jars instead of trying to download them?

Posted by Rod Mclaughlin <Ro...@omnimedix.org>.
We are just starting to use Maven2. One or two things puzzle us, and we 
would be grateful for any answers. We've searched the web, looked in the 
mailing lists, etc. without finding an answer. We are trying to install 
INDIVO (indivohealth.org) by running 'MVN INSTALL' from the top level 
where the top POM.xml is. It downloads a lot of third party jars, then says

*'Missing:
----------
1) org.indivo:indivo-client-java:jar:3.0-SNAPSHOT' *
regarding indivo-client-java-3.0-SNAPSHOT.jar which is in 
./client/java/target/, where it should be, so Maven doesn't need to 
download it. How do we tell it to use the jars which are right there, 
rather than looking all around the world for them? Thanks for any feedback.
>>
>>     
>
>   


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


Re: [m2] Maven vs source control

Posted by Wayne Fay <wa...@gmail.com>.
Generally people use the SNAPSHOT feature of Maven during development
(with typically only 1 version per artifact, which is frequently
updated but always uses the version SNAPSHOT), and then periodically
deploy versions of modules to the Maven repo when the development team
has decided to cut a new release.

You can run the entire Maven compile, test, package process without
actually deploying code to your repo, so we usually only deploy code
when we are pushing our a new version of a module/project.

Wayne

On 2/13/07, lightbulb432 <ve...@hotmail.com> wrote:
>
> Oh, now I see the difference, being between the mgmt of source files and of
> compiled modules.
>
> So if you are making minor revisions of your source repository all the time,
> does that mean your module repository is going to get enormous (because
> everytime you make a tiny change in your source, that classifies as a new
> module altogether, and the entire project gets put in its packaged form into
> the Maven repo?)
>
> What's the best practice regarding what people generally do? Do they only
> put their source code into the Maven repo as a module when its a release,
> rather than just another change as part of the development process?
>
> It's slowly coming together now, thanks...
>
>
>
> Wayne Fay wrote:
> >
> > They are completely different albeit related subjects...
> >
> > You have a code repository to manage versions of source files. You
> > could perhaps attempt to use Maven without a code repository but
> > virtually all modern development efforts will utilize some kind of
> > code repo.
> >
> > You have a Maven repository to manage versions of compiled Java
> > modules. Maven pulls code from your code repository to build the
> > modules, which are then deployed to your Maven repository. Everything
> > in the Maven repo is intrinsically "versioned" through the project
> > object model.
> >
> > You can safely ignore his comment about "versioning everything in
> > Maven using source control" until you fully understand these points.
> > Then you can revisit this point, but understand that very few people
> > in the world who are using Maven will bother to put their Maven repo
> > under source control.
> >
> > Wayne
> >
> >
> > On 2/13/07, lightbulb432 <ve...@hotmail.com> wrote:
> >>
> >> Thanks for your answer.
> >>
> >> Could you expand on why there's little point in versioning things in
> >> Maven.
> >> I guess maybe I can understand why for the library repository (is it
> >> because
> >> it in itself is almost "versioned"?), but what about everything else in
> >> Maven? e.g. your project tree that you're developing with the source
> >> code,
> >> configuration files, etc...
> >>
> >> I'm not sure what you meant by there might be a point to versioning
> >> everything in Maven using source control "only when you version control
> >> server can behave like a webserver"
> >>
> >>
> >>
> >> Graham Leggett wrote:
> >> >
> >> > On Tue, February 13, 2007 6:40 pm, lightbulb432 wrote:
> >> >
> >> >> What's the difference between Maven and version control repositories
> >> when
> >> >> you're using both? Maven has its repository, but so does my version
> >> >> control.
> >> >
> >> > "repository" is the word used in both cases to describe the data store
> >> of
> >> > record for each system, but a maven repository doesn't work anything
> >> like
> >> > a version control repository, and vice versa.
> >> >
> >> > They aren't the same thing.
> >> >
> >> > In a version control system, a repository is the place where all the
> >> > versions of the source being stored is kept.
> >> >
> >> > In maven, the repository is a big directory tree where jar files[1] are
> >> > stored, in such a way that the jar files can be referenced quickly and
> >> > easily by maven.
> >> >
> >> >> Is it possible to version everything in Maven using source control,
> >> >> including the library repository?
> >> >
> >> > No[2], there is little point in doing this.
> >> >
> >> > [1] Or other files, maven repos can contain artifacts other than jar,
> >> but
> >> > jar is most common.
> >> >
> >> > [2] Ok, theoretically yes, but only when you version control server can
> >> > behave like a webserver.
> >> >
> >> > Regards,
> >> > Graham
> >> > --
> >> >
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> > For additional commands, e-mail: users-help@maven.apache.org
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Maven-vs-source-control-tf3221731s177.html#a8948205
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Maven-vs-source-control-tf3221731s177.html#a8948818
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: [m2] Maven vs source control

Posted by lightbulb432 <ve...@hotmail.com>.
Oh, now I see the difference, being between the mgmt of source files and of
compiled modules.

So if you are making minor revisions of your source repository all the time,
does that mean your module repository is going to get enormous (because
everytime you make a tiny change in your source, that classifies as a new
module altogether, and the entire project gets put in its packaged form into
the Maven repo?)

What's the best practice regarding what people generally do? Do they only
put their source code into the Maven repo as a module when its a release,
rather than just another change as part of the development process?

It's slowly coming together now, thanks...



Wayne Fay wrote:
> 
> They are completely different albeit related subjects...
> 
> You have a code repository to manage versions of source files. You
> could perhaps attempt to use Maven without a code repository but
> virtually all modern development efforts will utilize some kind of
> code repo.
> 
> You have a Maven repository to manage versions of compiled Java
> modules. Maven pulls code from your code repository to build the
> modules, which are then deployed to your Maven repository. Everything
> in the Maven repo is intrinsically "versioned" through the project
> object model.
> 
> You can safely ignore his comment about "versioning everything in
> Maven using source control" until you fully understand these points.
> Then you can revisit this point, but understand that very few people
> in the world who are using Maven will bother to put their Maven repo
> under source control.
> 
> Wayne
> 
> 
> On 2/13/07, lightbulb432 <ve...@hotmail.com> wrote:
>>
>> Thanks for your answer.
>>
>> Could you expand on why there's little point in versioning things in
>> Maven.
>> I guess maybe I can understand why for the library repository (is it
>> because
>> it in itself is almost "versioned"?), but what about everything else in
>> Maven? e.g. your project tree that you're developing with the source
>> code,
>> configuration files, etc...
>>
>> I'm not sure what you meant by there might be a point to versioning
>> everything in Maven using source control "only when you version control
>> server can behave like a webserver"
>>
>>
>>
>> Graham Leggett wrote:
>> >
>> > On Tue, February 13, 2007 6:40 pm, lightbulb432 wrote:
>> >
>> >> What's the difference between Maven and version control repositories
>> when
>> >> you're using both? Maven has its repository, but so does my version
>> >> control.
>> >
>> > "repository" is the word used in both cases to describe the data store
>> of
>> > record for each system, but a maven repository doesn't work anything
>> like
>> > a version control repository, and vice versa.
>> >
>> > They aren't the same thing.
>> >
>> > In a version control system, a repository is the place where all the
>> > versions of the source being stored is kept.
>> >
>> > In maven, the repository is a big directory tree where jar files[1] are
>> > stored, in such a way that the jar files can be referenced quickly and
>> > easily by maven.
>> >
>> >> Is it possible to version everything in Maven using source control,
>> >> including the library repository?
>> >
>> > No[2], there is little point in doing this.
>> >
>> > [1] Or other files, maven repos can contain artifacts other than jar,
>> but
>> > jar is most common.
>> >
>> > [2] Ok, theoretically yes, but only when you version control server can
>> > behave like a webserver.
>> >
>> > Regards,
>> > Graham
>> > --
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-vs-source-control-tf3221731s177.html#a8948205
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-vs-source-control-tf3221731s177.html#a8948818
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [m2] Maven vs source control

Posted by Wayne Fay <wa...@gmail.com>.
They are completely different albeit related subjects...

You have a code repository to manage versions of source files. You
could perhaps attempt to use Maven without a code repository but
virtually all modern development efforts will utilize some kind of
code repo.

You have a Maven repository to manage versions of compiled Java
modules. Maven pulls code from your code repository to build the
modules, which are then deployed to your Maven repository. Everything
in the Maven repo is intrinsically "versioned" through the project
object model.

You can safely ignore his comment about "versioning everything in
Maven using source control" until you fully understand these points.
Then you can revisit this point, but understand that very few people
in the world who are using Maven will bother to put their Maven repo
under source control.

Wayne


On 2/13/07, lightbulb432 <ve...@hotmail.com> wrote:
>
> Thanks for your answer.
>
> Could you expand on why there's little point in versioning things in Maven.
> I guess maybe I can understand why for the library repository (is it because
> it in itself is almost "versioned"?), but what about everything else in
> Maven? e.g. your project tree that you're developing with the source code,
> configuration files, etc...
>
> I'm not sure what you meant by there might be a point to versioning
> everything in Maven using source control "only when you version control
> server can behave like a webserver"
>
>
>
> Graham Leggett wrote:
> >
> > On Tue, February 13, 2007 6:40 pm, lightbulb432 wrote:
> >
> >> What's the difference between Maven and version control repositories when
> >> you're using both? Maven has its repository, but so does my version
> >> control.
> >
> > "repository" is the word used in both cases to describe the data store of
> > record for each system, but a maven repository doesn't work anything like
> > a version control repository, and vice versa.
> >
> > They aren't the same thing.
> >
> > In a version control system, a repository is the place where all the
> > versions of the source being stored is kept.
> >
> > In maven, the repository is a big directory tree where jar files[1] are
> > stored, in such a way that the jar files can be referenced quickly and
> > easily by maven.
> >
> >> Is it possible to version everything in Maven using source control,
> >> including the library repository?
> >
> > No[2], there is little point in doing this.
> >
> > [1] Or other files, maven repos can contain artifacts other than jar, but
> > jar is most common.
> >
> > [2] Ok, theoretically yes, but only when you version control server can
> > behave like a webserver.
> >
> > Regards,
> > Graham
> > --
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Maven-vs-source-control-tf3221731s177.html#a8948205
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: [m2] Maven vs source control

Posted by Graham Leggett <mi...@sharp.fm>.
lightbulb432 wrote:

> Could you expand on why there's little point in versioning things in Maven.
> I guess maybe I can understand why for the library repository (is it because
> it in itself is almost "versioned"?), but what about everything else in
> Maven? e.g. your project tree that you're developing with the source code,
> configuration files, etc...

One of the core concepts within maven is its version number scheme.

Maven makes a strong distinction between "released" artifacts, and 
"snapshot" artifacts.

Your project while you are working on it, your dev branch, is an example 
of a snapshot artifact - despite the fact that it probably has a version 
number already, every time you rebuild your code, you have replaced your 
previous "snapshot" build with your new one. Snapshot artifacts have the 
suffix "-SNAPSHOT" after the version number.

Once you have released a particular tag of your project, you publish it 
as a "released" artifact, probably into a publically accessible (or 
publically accessible within your company) maven repository.

Many many other projects have also deployed their "released" artifacts 
into public maven repositories like http://repo1.maven.org, and this 
code is automatically available to you as well.

The key point is this: Once an artifact is published with a "released" 
version number, that artifact never changes again. Should the artifact 
get updated, a new release is made with a new version number, and the 
newer released artifact sits beside the older released artifact.

This is why it's largely pointless to place jars in version control, as 
the jars as released and published don't change and mustn't change.

Of course you could try and subvert the system and upload a replacement 
jar that replaces an existing released version - the trouble is, maven 
by design knows that "released" jar files don't change, and if maven has 
a local copy of the older jar, it will never try and download the new jar.

This is why protecting write access to your maven repository in a 
corporate environment is generally a good idea, as you don't want a 
developer changing the goalposts on already released code. This same 
issue exists even if you do try store jars in version control, because 
you don't want a developer messing around there for the same reasons.

> I'm not sure what you meant by there might be a point to versioning
> everything in Maven using source control "only when you version control
> server can behave like a webserver"

maven (to my knowledge) expects a "maven repository" to be either a 
directory local on the machine, or published on a webserver. In order to 
host a maven repository inside a version control server, the version 
control server must behave like a webserver, and the only version 
control server capable of this to my knowledge is subversion.

Don't worry too much about this point - it was an aside.

Regards,
Graham
--