-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven Crosley wrote:
> I'm pretty new to Maven, but I've created some sample multi-project
> applications successfully in the last couple of weeks.  I'm a bit stuck
> as to how SVN integration works.  This is kind of a 2-part question.
> 
> 1.) I've added the dependency in my top-level pom.xml like so:
> 
>     <dependency>
>         <groupId>org.apache.maven.scm</groupId>
>         <artifactId>maven-scm-provider-svn</artifactId>
>         <version>1.0-alpha-4</version>
>     </dependency>
> 
> And I've added the scm element in the same pom.xml as well:
> 
>    <scm>
>     
> <connection>scm:svn:http://localhost:8080/svn/private/sampleproject</connection>
> 
>     
> <developerConnection>scm:svn:https://localhost:8080/svn/private/sampleproject</developerConnection>
> 
>      <url>http://localhost:8080/svn/private/sampleproject</url>
>   </scm>
> 

Look's ok based on this
http://maven.apache.org/scm/plugins/usage.html
Committing and updating changes through Maven

Assuming that SCM has been configured in the pom.xml and the project
directory is managed by a SCM, invoking the checkin goal in the scm will
start the commit process for all configured sources in your pom.xml.

>>>>>The files should be added beforehand by an external scm client.
You did do this to prime the .svn files of your working copy?

  mvn -Dmessage="<commit_log_here>" scm:checkin

for update

  mvn scm:update


> When I run it like this:
> 
> mvn scm:checkin -Dmessage="This is a test"
> 
> I get a successful build, but the svn executes a file command instead of
> sending it to my repository:

The scm plugin is a generic tool that supports multiple scm systems.
The file command should not be confused with svn's file:/// url method
of referencing a repository.

Now there are two ideas of repository here.  There is your scm's
repository.  In this case, svn has a place where all the code is kept.
The scm plugin is working on svn repository.  The scm plugin is working
according to plan.

The maven repository of artifacts is a completely different animal than
the scm's repository.

> 
> [INFO] [scm:checkin]
> [INFO] Executing: svn --non-interactive commit --file
> /tmp/maven-scm-947054377.commit
> [INFO] Working directory: /Users/myuser/Documents/Projects/sampleproject

This is just svn commit noise.  The scm abstraction has to use some
other support files to pull off the  support of multiple scms.  That's
all you are seeing here.


> 
> 2.) Ideally what I'd like to do is configure Maven to have multiple
> profiles based in releases, so that when i release a test build, it
> commits my changes to the correct SVN repository branch automatically.
> Would I have to build a plugin to do this, Or is it already possible? 
> Any examples?

Ummm,  I am thinking that you are asking for a mountain of features here
that are not working as you plan.  With svn you have your main line
trunk of development.  The idea with svn and other scms is that you
branch if you have several competing changes on one or two files and
still need to maintain a "production" copy.  You use tags to name a set
of files for checking out a "named version".  The operations that we are
talking about are all in a code development phase of the project.  With
these svn concepts, then there is only one "correct SVN repository".

In a later phase of the project cycle maven can be configured to take
your compiled code and create a released artifact. This is where the
"<version>1.0-alpha-4</version>" section of your pom comes into play.
However, your local maven repository of artifacts or a possible maven
shared corporate repository of artifacts is different from svn's
repository of versioned files.  You as a release manager may want to tag
your svn code repository with the same 1.0-alpha-4 name as the artifact
release version.  You have to make the human judgment that a certain set
of file versions will go into a maven artifact release.  maven cannot do
that for you. You would use mvn -DtagName="<tag name>" scm:tag to do that.

Yes you can do many things with profiles but the branch command is more
of a one time event.  This is where you fork your code base for a major
release, etc.  The profile command line option could be used to invoke
checkins on the branch. Another profile command line option could be
used to invoke operations on the normal trunk to maintain the current
production release.  These profiles could be used to create a build
artifact on the new release and a build artifact on the stable trunk.
Eric Redmond has a nice summation of using a command line or
environmental trigger here http://www.devx.com/Java/Article/32386 .

So I think I rambled into your answer, but, it feels like there are
several concepts that you are mixing between two different tools because
they are using the same word, repository.  It feels like there are two
different project phases that are being rolled up into one and that is
frustrating your efforts to ask maven to do what you want it to do.  I
get this idea when you say, "when i release a test build, it commits my
changes to the correct SVN repository branch automatically."  The scm
plugin is a generalization of scm operations for various tools.  Since
compromises are made to support multiple scm tools, you may want to
perform some operations outside of maven with your specialized scm
client tools, such as svn.

> 
> Thanks,
> SC

I hope this helps.


Regards,
Greg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGuYjmxyxe5L6mr7IRAl4CAKCVhL+rSxzV5ZLqi6iUsZhWu0PZmACgpRQx
hIXj9s65/qApIe9yG16k+4w=
=F7sC
-----END PGP SIGNATURE-----

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

Reply via email to