Thanks a lot everybody for replies. I think I'm quite clear what I
need to do.
The reason why I wanted to use Maven in Production environment is to
make it easier to deploy new version to private remote repository and
upgrade local repositories when new version in private remote
repository is available. This is what I've done with my previous
project (C++) where we needed to implement all this ourselves, but it
worked really well in production. Maven looked like a tool that could
do that for us with Scala.
We will be generating WAR and JAR files and since JAR file could have
dependencies I though Maven can help resolve those easily (I think
I'll use different approach - see below...)

So what I will do is:
1. Create dev environment that will include private remote repository
for our libs, setup scheduled automated builds (Hudson?) and deploy
built artifacts into that private remote repository (Artifactory) so
dev machines will be up-to-date
2. Use onejar-maven-plugin to package all dependencies into one JAR
file
3. Deploy one-JAR file onto production servers
4. Run "java -jar mybin.jar"

I don't like to deploy updated binaries to all production servers, I
prefer production server to understand that there is a new version and
upgrade itself (I thought Maven could help here), so this step will
need to be done somehow else...



On Jul 29, 11:40 am, Mark McBride <[email protected]> wrote:
> Yeah, I have no real attachment to any specific repo manager.  I do
> know that for us, managing it as a filesystem is pretty painful.
>
> ph, I'd suggest you break this down into steps and get each one
> working before moving on to the next.  What I would do:
>
> 1) Make sure you can build your project on a developer box with remote
> repositories.  There should be plenty of examples on the Lift web site
> about how to do this.
> 2) Transition to a repository manager and build up your private remote
> repository.  Ensure step 1 works against this.  
> Seehttp://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.book/bo...
> for basic guide on setting up a private repo
> 3) Make sure you can deploy your artifacts to your private remote
> repository. 
> Seehttp://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.book/bo...
> for Nexus instructions.
> 4) For production, what you should be able to do is just copy your
> deployed .war file (shouldn't need any other artifacts) from your
> repository manager (it's also a general file serving web site) to your
> production machines and run in a container of your choice as David
> describes.  You can script this up with wget or whatever if you want.
>
>    ---Mark
> On Wed, Jul 29, 2009 at 8:34 AM, David
>
>
>
> Bernard<[email protected]> wrote:
> > I higlhy suggest you use a solution like nexus (IMO better than artifactory
> > to install/manage).
>
> > On Wed, Jul 29, 2009 at 17:07, Mark McBride <[email protected]> wrote:
>
> >> I distilled at least two questions from this
>
> >> 1) How do I use scala artifacts from a private remote repository (i.e.
> >> I don't need to go outside my own network to download artifacts)?
> >> 2) How do I define the scala repositories in settings.xml instead of
> >> in every pom.xml file?
>
> >> We actually do something like #1 at work after having been burned by
> >> codehaus doing some unholy things to their repo and bringing our
> >> development to a halt.  We haven't yet gotten a real repository
> >> manager (e.g. Artifactory) in place to manage that, so our general
> >> workflow is
>
> >> 1) Get the project working building against external remote
> >> repositories.  We do this by enabling an external-repo profile while
> >> developing
> >> 2) Move the (now populated) local repository somewhere safe
> >> 3) Try to build with against a clean local repository and only the
> >> private remote repository
> >> 4) Note missing artifacts and deploy them to the private remote repository
> >> 5) Goto 3 and repeat until the build succeeds
>
> >> It's tedious, but for small numbers of artifacts works ok.  For larger
> >> numbers of artifacts you can transfer entire directories from your
> >> local repo to the private remote repo.
> >> Or use something like Artifactory (recommended).
>
> >> Once you do this, you shouldn't need the additional <repository> and
> >> <pluginRepository> tags in projects.  In fact if you're going to the
> >> trouble of putting your scala artifacts in a private remote repository
> >> then having <repository> tags in poms should probably be a general
> >> no-no.
>
> >>  ---Mark
> >> On Wed, Jul 29, 2009 at 7:14 AM, ph<[email protected]> wrote:
>
> >> > If I have private remote repository, I deploy there a new binaries,
> >> > then all my servers need to run those binaries. I would need to get
> >> > them to local repository and run locally.
> >> > What would be a right workflow for that?
>
> >> > On Jul 29, 4:54 am, David Bernard <[email protected]> wrote:
> >> >> Hi,
>
> >> >> I don't understand what you try to do and what you mean by "Now I need
> >> >> to
> >> >> run project from repository" ?
> >> >> Could you provide the use case ?
>
> >> >> I also copy/move to the mailing-list maven-and-scala.
>
> >> >> /davidB
>
> >> >> On Tue, Jul 28, 2009 at 23:16, ph <[email protected]> wrote:
>
> >> >> > Maybe better question would be:
> >> >> > How to run scala artifact from maven repository (local and/or private
> >> >> > remote)?
>
> >> >> > On Jul 28, 3:28 pm, Timothy Perrett <[email protected]> wrote:
> >> >> > > Hey there,
>
> >> >> > > I wrote an article previously about how to use launchers with
> >> >> > > maven-
> >> >> > > scala-plugin, find it here:http://is.gd/1RuLQ
>
> >> >> > > Does that help?
>
> >> >> > > Cheers, Tim
>
> >> >> > > On Jul 28, 7:32 pm, ph <[email protected]> wrote:
>
> >> >> > > > Is there a good recourse on how to setup/use scala project with
> >> >> > > > maven?
>
> >> >> > > > I've installed maven that comes with lift. Project is created
> >> >> > > > with
> >> >> > > > Eclipse maven plugin (q4ehttp://code.google.com/p/q4e/). I build
> >> >> > > > and
> >> >> > > > install scala project to local repository fine.
> >> >> > > > I can also run project using "mvn scala:run" command from project
> >> >> > > > folder.
> >> >> > > > Now I need to run project from repository and I cannot figure out
> >> >> > > > how
> >> >> > > > to do so. Would I need to use "mvn scala:run"? This will resolve
> >> >> > > > dependencies and install all required libraries...
> >> >> > > > Scala plugin is not recognized as it declared only in "pom". I'm
> >> >> > > > trying to update maven's "settings.xml", adding this:
>
> >> >> > > >         <profile>
> >> >> > > >                 <id>env-dev</id>
> >> >> > > >                 <repositories>
> >> >> > > >                         <repository>
> >> >> > > >                                 <id>scala-tools.org</id>
> >> >> > > >                                 <name>Scala-tools Maven2
> >> >> > Repository</name>
> >> >> > > >                                 <url>
> >> >> >http://scala-tools.org/repo-releases</url>
> >> >> > > >                         </repository>
> >> >> > > >                 </repositories>
> >> >> > > >                 <pluginRepositories>
> >> >> > > >                         <pluginRepository>
> >> >> > > >                                 <id>org.scala-tools</id>
> >> >> > > >                                 <name>Scala-tools Maven2
> >> >> > Repository</name>
> >> >> > > >                                 <url>
> >> >> >http://scala-tools.org/repo-releases</url>
> >> >> > > >                         </pluginRepository>
> >> >> > > >                 </pluginRepositories>
> >> >> > > >         </profile>
>
> >> >> > > >   </profiles>
>
> >> >> > > >   <activeProfiles>
> >> >> > > >     <activeProfile>env-dev</activeProfile>
> >> >> > > >   </activeProfiles>
>
> >> >> > > > now if I run "mvn scala:run -DmainClass=..." it gives me error:
> >> >> > > > [ERROR] BUILD ERROR
> >> >> > > > [INFO]
>
> >> >> > ------------------------------------------------------------------------
> >> >> > > > [INFO] The plugin 'org.apache.maven.plugins:maven-scala-plugin'
> >> >> > > > does
> >> >> > > > not exist or no valid version could be found
>
> >> >> > > > Maybe there is another way to run project from maven repository?
>
> >> >> > > > Next step for me will be installing artifact into private remote
> >> >> > > > repository (Artifactory) and run project from that remote
> >> >> > > > repository... Any suggestions?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to