You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeremy Sager <je...@gmail.com> on 2009/03/16 21:41:01 UTC

Relative Path to a Local Repo

Hi everyone -

I appreciate any help that might be offered on this topic. I have researched
this on google and have not been able to find an answer, so I'm hoping you
guys can throw something out there to help, or point to a place I missed on
the web that contains the correct information.

I have a need for people to be able to execute a maven build against my
project from source that is copied onto their machine.

For government security reasons, the machine does not have internet access,
and the people executing the build have no maven expertise.

I include a copy of my repository within the zip file that contains the
source code. I include a settings.xml file that tells maven to execute in
offline mode, and points to a local repository.

I then give the end users a single command that they execute from their
shell, and everything works... except for one problem.

The localRepository I specify in settings.xml does not seem to accept a
relative path. The relative path to the local repo I've sent them will
always remain the same.

Alternatively to figuring out the relative path in the settings file I point
them to, I am quite content to change what I'm doing on the command line, as
in mvn -o -Dmaven.local-repo=foo/bar/repository. However, from what I've
seen maven.local-repo no longer works.

The goal is to give these guys a zip of my source, which includes my
repository (thanks to the assembly plugin), and have them unzip and be able
to run with a single command line. Again, they have no local repo and no
internet access.

One final point. If I use an absolute path to the repository in
settings.xml, everything works great.

Any advice is appreciated, and thank you for your time.

Jeremy

Re: Relative Path to a Local Repo

Posted by Tim Kettler <ti...@udo.edu>.
Jeremy Sager schrieb:
> Is there any way to specify the local repo to use from the command line? I
> was not able to figure that out either but if it's possible to do that would
> represent a perfect solution.

mvn -Dmaven.repo.local=<path> ...

-Tim


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


Re: Relative Path to a Local Repo

Posted by Jeremy Sager <je...@gmail.com>.
Is there any way to specify the local repo to use from the command line? I
was not able to figure that out either but if it's possible to do that would
represent a perfect solution.

On Wed, Mar 18, 2009 at 1:00 PM, Wayne Fay <wa...@gmail.com> wrote:

> > If there's no maven solution here, I will see if I can get an environment
> > variable set up as a solution. It would still be nice to able to have a
> > relative path in the settings.xml file.
>
> By definition, the settings.xml file is NOT for project-specific
> stuff. Therefore the very notion of "relative path" is invalid. I
> don't see this being changed or "fixed" any time soon, and don't in
> fact consider it a bug.
>
> The easiest thing would probably be to teach your users how to use
> "subst" in DOS, or include a "setup.bat" file in your project archive
> that runs subst and creates a virtual drive say M: which always points
> to the "latest" repo which is inside the latest project you've sent
> them, and then point settings.xml at the new M drive.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Relative Path to a Local Repo

Posted by Wayne Fay <wa...@gmail.com>.
> If there's no maven solution here, I will see if I can get an environment
> variable set up as a solution. It would still be nice to able to have a
> relative path in the settings.xml file.

By definition, the settings.xml file is NOT for project-specific
stuff. Therefore the very notion of "relative path" is invalid. I
don't see this being changed or "fixed" any time soon, and don't in
fact consider it a bug.

The easiest thing would probably be to teach your users how to use
"subst" in DOS, or include a "setup.bat" file in your project archive
that runs subst and creates a virtual drive say M: which always points
to the "latest" repo which is inside the latest project you've sent
them, and then point settings.xml at the new M drive.

Wayne

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


Re: Relative Path to a Local Repo

Posted by Jeremy Sager <je...@gmail.com>.
I appreciate the response.

Unfortunately, they are not on the same network as I am, they are in a
secured government facility and they don't even have internet access.

As for why they are using maven, we have the jetty plugin set up to do a
self-contained testing environment which they can use to make graphical
changes to the application... they are artists but they need to be able to
run things and see the effects of their skinning work.

If there's no maven solution here, I will see if I can get an environment
variable set up as a solution. It would still be nice to able to have a
relative path in the settings.xml file.

Thanks again for your time guys (and gals).

Jeremy

On Tue, Mar 17, 2009 at 4:02 PM, Baptiste MATHUS <ml...@batmat.net> wrote:

> Couldn't you just provide the packaged version, and a documentation for the
> "advanced" user to build from sources by configuring the settings.xml?
> About
> this last point, why don't you ask people to set yourProjectRoot
> environment
> variable to the unzipped root of your archive, the use something like
> ${env.yourProjectRoot}/repository from the provided settings.xml?
>
> Btw, if those people are no developers. I can't see why you want them to
> build the jar by themselves?
>
> Maybe another thought: why don't you install a corporate maven repository
> manager with the repository in question? Aren't you in the same network as
> those people?
>
> Cheers.
>
> 2009/3/17 Jeremy Sager <je...@gmail.com>
>
> > Hey Lee,
> >
> > Thanks for the response. Unfortunately, setting an environment variable
> is
> > probably more difficult than getting the recipients to to open up a
> > settings.xml file and edit it.
> >
> > The goal is "unzip & go" with my only guarantees that they have java,
> > maven,
> > and grails installed by someone else.
> >
> > If they have to edit the settings.xml file, they have to edit it, but if
> > there's any way to get past that and use a relative path that's what I'm
> > looking for.
> >
> > Jer
> >
> > On Mon, Mar 16, 2009 at 6:29 PM, Lee Meador <le...@leemeador.com> wrote:
> >
> > > Can you have them set an environment variable to the folder into which
> > they
> > > unzipped? there might be a way to make that work.
> > >
> > > --Lee
> > >
> > > On Mon, Mar 16, 2009 at 3:41 PM, Jeremy Sager <
> jeremy.a.sager@gmail.com
> > > >wrote:
> > >
> > > > Hi everyone -
> > > >
> > > > I appreciate any help that might be offered on this topic. I have
> > > > researched
> > > > this on google and have not been able to find an answer, so I'm
> hoping
> > > you
> > > > guys can throw something out there to help, or point to a place I
> > missed
> > > on
> > > > the web that contains the correct information.
> > > >
> > > > I have a need for people to be able to execute a maven build against
> my
> > > > project from source that is copied onto their machine.
> > > >
> > > > For government security reasons, the machine does not have internet
> > > access,
> > > > and the people executing the build have no maven expertise.
> > > >
> > > > I include a copy of my repository within the zip file that contains
> the
> > > > source code. I include a settings.xml file that tells maven to
> execute
> > in
> > > > offline mode, and points to a local repository.
> > > >
> > > > I then give the end users a single command that they execute from
> their
> > > > shell, and everything works... except for one problem.
> > > >
> > > > The localRepository I specify in settings.xml does not seem to accept
> a
> > > > relative path. The relative path to the local repo I've sent them
> will
> > > > always remain the same.
> > > >
> > > > Alternatively to figuring out the relative path in the settings file
> I
> > > > point
> > > > them to, I am quite content to change what I'm doing on the command
> > line,
> > > > as
> > > > in mvn -o -Dmaven.local-repo=foo/bar/repository. However, from what
> > I've
> > > > seen maven.local-repo no longer works.
> > > >
> > > > The goal is to give these guys a zip of my source, which includes my
> > > > repository (thanks to the assembly plugin), and have them unzip and
> be
> > > able
> > > > to run with a single command line. Again, they have no local repo and
> > no
> > > > internet access.
> > > >
> > > > One final point. If I use an absolute path to the repository in
> > > > settings.xml, everything works great.
> > > >
> > > > Any advice is appreciated, and thank you for your time.
> > > >
> > > > Jeremy
> > > >
> > >
> > >
> > >
> > > --
> > > -- Lee Meador
> > > Sent from gmail. My real email address is lee AT leemeador.com
> > >
> >
>
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>

Re: Relative Path to a Local Repo

Posted by Baptiste MATHUS <ml...@batmat.net>.
Couldn't you just provide the packaged version, and a documentation for the
"advanced" user to build from sources by configuring the settings.xml? About
this last point, why don't you ask people to set yourProjectRoot environment
variable to the unzipped root of your archive, the use something like
${env.yourProjectRoot}/repository from the provided settings.xml?

Btw, if those people are no developers. I can't see why you want them to
build the jar by themselves?

Maybe another thought: why don't you install a corporate maven repository
manager with the repository in question? Aren't you in the same network as
those people?

Cheers.

2009/3/17 Jeremy Sager <je...@gmail.com>

> Hey Lee,
>
> Thanks for the response. Unfortunately, setting an environment variable is
> probably more difficult than getting the recipients to to open up a
> settings.xml file and edit it.
>
> The goal is "unzip & go" with my only guarantees that they have java,
> maven,
> and grails installed by someone else.
>
> If they have to edit the settings.xml file, they have to edit it, but if
> there's any way to get past that and use a relative path that's what I'm
> looking for.
>
> Jer
>
> On Mon, Mar 16, 2009 at 6:29 PM, Lee Meador <le...@leemeador.com> wrote:
>
> > Can you have them set an environment variable to the folder into which
> they
> > unzipped? there might be a way to make that work.
> >
> > --Lee
> >
> > On Mon, Mar 16, 2009 at 3:41 PM, Jeremy Sager <jeremy.a.sager@gmail.com
> > >wrote:
> >
> > > Hi everyone -
> > >
> > > I appreciate any help that might be offered on this topic. I have
> > > researched
> > > this on google and have not been able to find an answer, so I'm hoping
> > you
> > > guys can throw something out there to help, or point to a place I
> missed
> > on
> > > the web that contains the correct information.
> > >
> > > I have a need for people to be able to execute a maven build against my
> > > project from source that is copied onto their machine.
> > >
> > > For government security reasons, the machine does not have internet
> > access,
> > > and the people executing the build have no maven expertise.
> > >
> > > I include a copy of my repository within the zip file that contains the
> > > source code. I include a settings.xml file that tells maven to execute
> in
> > > offline mode, and points to a local repository.
> > >
> > > I then give the end users a single command that they execute from their
> > > shell, and everything works... except for one problem.
> > >
> > > The localRepository I specify in settings.xml does not seem to accept a
> > > relative path. The relative path to the local repo I've sent them will
> > > always remain the same.
> > >
> > > Alternatively to figuring out the relative path in the settings file I
> > > point
> > > them to, I am quite content to change what I'm doing on the command
> line,
> > > as
> > > in mvn -o -Dmaven.local-repo=foo/bar/repository. However, from what
> I've
> > > seen maven.local-repo no longer works.
> > >
> > > The goal is to give these guys a zip of my source, which includes my
> > > repository (thanks to the assembly plugin), and have them unzip and be
> > able
> > > to run with a single command line. Again, they have no local repo and
> no
> > > internet access.
> > >
> > > One final point. If I use an absolute path to the repository in
> > > settings.xml, everything works great.
> > >
> > > Any advice is appreciated, and thank you for your time.
> > >
> > > Jeremy
> > >
> >
> >
> >
> > --
> > -- Lee Meador
> > Sent from gmail. My real email address is lee AT leemeador.com
> >
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Relative Path to a Local Repo

Posted by Jeremy Sager <je...@gmail.com>.
Hey Lee,

Thanks for the response. Unfortunately, setting an environment variable is
probably more difficult than getting the recipients to to open up a
settings.xml file and edit it.

The goal is "unzip & go" with my only guarantees that they have java, maven,
and grails installed by someone else.

If they have to edit the settings.xml file, they have to edit it, but if
there's any way to get past that and use a relative path that's what I'm
looking for.

Jer

On Mon, Mar 16, 2009 at 6:29 PM, Lee Meador <le...@leemeador.com> wrote:

> Can you have them set an environment variable to the folder into which they
> unzipped? there might be a way to make that work.
>
> --Lee
>
> On Mon, Mar 16, 2009 at 3:41 PM, Jeremy Sager <jeremy.a.sager@gmail.com
> >wrote:
>
> > Hi everyone -
> >
> > I appreciate any help that might be offered on this topic. I have
> > researched
> > this on google and have not been able to find an answer, so I'm hoping
> you
> > guys can throw something out there to help, or point to a place I missed
> on
> > the web that contains the correct information.
> >
> > I have a need for people to be able to execute a maven build against my
> > project from source that is copied onto their machine.
> >
> > For government security reasons, the machine does not have internet
> access,
> > and the people executing the build have no maven expertise.
> >
> > I include a copy of my repository within the zip file that contains the
> > source code. I include a settings.xml file that tells maven to execute in
> > offline mode, and points to a local repository.
> >
> > I then give the end users a single command that they execute from their
> > shell, and everything works... except for one problem.
> >
> > The localRepository I specify in settings.xml does not seem to accept a
> > relative path. The relative path to the local repo I've sent them will
> > always remain the same.
> >
> > Alternatively to figuring out the relative path in the settings file I
> > point
> > them to, I am quite content to change what I'm doing on the command line,
> > as
> > in mvn -o -Dmaven.local-repo=foo/bar/repository. However, from what I've
> > seen maven.local-repo no longer works.
> >
> > The goal is to give these guys a zip of my source, which includes my
> > repository (thanks to the assembly plugin), and have them unzip and be
> able
> > to run with a single command line. Again, they have no local repo and no
> > internet access.
> >
> > One final point. If I use an absolute path to the repository in
> > settings.xml, everything works great.
> >
> > Any advice is appreciated, and thank you for your time.
> >
> > Jeremy
> >
>
>
>
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee AT leemeador.com
>

Re: Relative Path to a Local Repo

Posted by Lee Meador <le...@leemeador.com>.
Can you have them set an environment variable to the folder into which they
unzipped? there might be a way to make that work.

--Lee

On Mon, Mar 16, 2009 at 3:41 PM, Jeremy Sager <je...@gmail.com>wrote:

> Hi everyone -
>
> I appreciate any help that might be offered on this topic. I have
> researched
> this on google and have not been able to find an answer, so I'm hoping you
> guys can throw something out there to help, or point to a place I missed on
> the web that contains the correct information.
>
> I have a need for people to be able to execute a maven build against my
> project from source that is copied onto their machine.
>
> For government security reasons, the machine does not have internet access,
> and the people executing the build have no maven expertise.
>
> I include a copy of my repository within the zip file that contains the
> source code. I include a settings.xml file that tells maven to execute in
> offline mode, and points to a local repository.
>
> I then give the end users a single command that they execute from their
> shell, and everything works... except for one problem.
>
> The localRepository I specify in settings.xml does not seem to accept a
> relative path. The relative path to the local repo I've sent them will
> always remain the same.
>
> Alternatively to figuring out the relative path in the settings file I
> point
> them to, I am quite content to change what I'm doing on the command line,
> as
> in mvn -o -Dmaven.local-repo=foo/bar/repository. However, from what I've
> seen maven.local-repo no longer works.
>
> The goal is to give these guys a zip of my source, which includes my
> repository (thanks to the assembly plugin), and have them unzip and be able
> to run with a single command line. Again, they have no local repo and no
> internet access.
>
> One final point. If I use an absolute path to the repository in
> settings.xml, everything works great.
>
> Any advice is appreciated, and thank you for your time.
>
> Jeremy
>



-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com