dev@glassfish.java.net

Re: v3 workspace refresh

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Wed, 23 Jan 2008 21:20:40 -0800

I agree, one of thing I did for myself to help is to have my own maven
script that will use the top-level directory of your workspace to
build. That way, you don't have to change the WS env variable each
time you switch from one project to another

so for instance if you checked out v3, and do :
        mvn install from v3, the local repo will be located in v3/.m2/
repository
        mvn install from v3/core/kernel, the local repo will still be located
in v3/.m2/repository

then you can also use another workspace, say ~/svn/grizzly and if you do
        mvn install from there it will use ~/svn/grizzly/.m2/repository

This works only on unix, I tested only on the mac.

#!/bin/sh
if [ -z $MAVEN_REPO_NAME ]
then
        MAVEN_REPO_NAME=.m2/repository
fi
if [ -z $MAVEN_REPO_LOCAL ]
then
        pwd=`pwd`
        while [ -f $pwd/../pom.xml ]
        do
                pwd=$pwd/..
        done
        MAVEN_REPO_LOCAL=$pwd/$MAVEN_REPO_NAME
fi
echo "Setting workspace directory at " $MAVEN_REPO_LOCAL
mvn -Dmaven.repo.local="$MAVEN_REPO_LOCAL" $*

I think there is a way to invoke that script from Netbeans.

HTH, Jerome

On Jan 23, 2008, at 8:56 PM, Bill Shannon wrote:

> Sahoo wrote:
>> Dinesh,
>> It was my mistake; I did not catch it in my environment as I had
>> built and installed Felix version 1.1.0-SNAPSHOT in my local maven
>> repository.
>> Jerome,
>> Thanks for making that change to get the build going. I have now
>> changed the pom.xml so that we don't depend on Felix at all, we
>> just depend on org.osgi.osgi_R4_compendium version 1.0 for
>> additional OSGi interfaces.
>> Sorry, if the broken build caused trouble to others.
>
> I *strongly* suggest that people configure their maven settings so
> that local repositories are associated with a project and not shared
> across all projects for a particular user, to avoid problems such as
> this. I do this on Solaris by using a shell script to start a sub-
> shell
> for each project. The script sets the WS environment variable to the
> root directory for the project. I put this in .m2/settings.xml:
>
> <settings xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/settings-1.0.0.xsd">
> <localRepository>${WS}/.m2/repository</localRepository>
> </settings>
>
> This doesn't work so well if you manage all your projects through a
> single NetBeans instance. Maybe someone can come up with a maven
> extension
> to handle this more dynamically.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>