You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Xiaohui Chen <sa...@gmail.com> on 2009/12/11 05:56:07 UTC

Is ther a way to change the path to localRepository to a relative path?

Hi,

I want to store our dependencies into SCM. There maybe other better ways.
The way that I see is some how change the maven's local repository to point
to somewhere in the source tree. But the local repository path has to be an
absolute path, that will not work because different developer have different
local working copies. Is there a way to specify the local repository to be a
relative path to the mvn binary?

Thanks.

Re: Is ther a way to change the path to localRepository to a relative path?

Posted by Wayne Fay <wa...@gmail.com>.
> But is there a way to stop this. I am OK with pulling files from other
> repositories. The problem is when the file is bad. Like what I have here
> just a html redirect page, maven should be smart enough to fail. And I would
> expect this to be the default behavior. Is there a way to configure that?

No, its a known bug in Maven. Feel free to hack the source code to fix
it, and contribute your patch back -- that would be great! This is
annoying but the easy fix is "run Nexus or another MRM" and "don't
allow bad repos to get into your build."

http://jira.codehaus.org/browse/MNG-2259

Wayne

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


Re: Is ther a way to change the path to localRepository to a relative path?

Posted by Xiaohui Chen <sa...@gmail.com>.
Thanks Wayne. That was it.

But is there a way to stop this. I am OK with pulling files from other
repositories. The problem is when the file is bad. Like what I have here
just a html redirect page, maven should be smart enough to fail. And I would
expect this to be the default behavior. Is there a way to configure that?

Xiaohui

On Fri, Dec 11, 2009 at 6:37 PM, Wayne Fay <wa...@gmail.com> wrote:

> > But when I am trying to compile my project with "mvn compile" it seems
> > trying to get the dependencies in some unknown repositories that I never
> > specified. I don't know where those repositories come from. Below is the
>
> Repositories can be added by poms of your dependencies, even
> transitively. Search the pom files in your ~/.m2/ directory and see if
> any of them include ws.zones.apache.org -- then see if your build
> depends on those poms.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Is ther a way to change the path to localRepository to a relative path?

Posted by Wayne Fay <wa...@gmail.com>.
> But when I am trying to compile my project with "mvn compile" it seems
> trying to get the dependencies in some unknown repositories that I never
> specified. I don't know where those repositories come from. Below is the

Repositories can be added by poms of your dependencies, even
transitively. Search the pom files in your ~/.m2/ directory and see if
any of them include ws.zones.apache.org -- then see if your build
depends on those poms.

Wayne

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


Re: Is ther a way to change the path to localRepository to a relative path?

Posted by Xiaohui Chen <sa...@gmail.com>.
Thanks Stephen.

The problem that I am trying to solve is to make sure that I have a reliable
build not dependent on the repository out in the cloud.

I will try to convince our IT to set up a company repository manager. But in
the mean time I am stuck. Maven seems wot work unpredictablly.

I have defined repositories section in my pom like this:

    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <layout>default</layout>
            <url>http://repo1.maven.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>fail</checksumPolicy>
                <updatePolicy>never</updatePolicy>
            </releases>
        </repository>
    </repositories>

But when I am trying to compile my project with "mvn compile" it seems
trying to get the dependencies in some unknown repositories that I never
specified. I don't know where those repositories come from. Below is the
console log. The worst part is the repository does not contain the
information and maven still downloads the error messages and saves it as jar
or pom, I checked the local repository. I even explicitly said the
<checksumPolicy>fail</checksumPolicy>. I am stuck. Please help me.

Downloading:
http://repo1.maven.org/maven2/org/apache/axis2/axis2-parent/1.5.1/a
xis2-parent-1.5.1.pom

Downloading:
http://ws.zones.apache.org/repository2/org/apache/axis2/axis2-kerne
l/1.5.1/axis2-kernel-1.5.1.pom
[INFO] Unable to find resource 'org.apache.axis2:axis2-kernel:pom:1.5.1' in
repo
sitory apache-ws-snapshots2 (http://ws.zones.apache.org/repository2)
Downloading:
http://tomcat.apache.org/dev/dist/m2-repository/org/apache/axis2/ax
is2-kernel/1.5.1/axis2-kernel-1.5.1.pom
[INFO] Unable to find resource 'org.apache.axis2:axis2-kernel:pom:1.5.1' in
repo
sitory tomcat-repository (http://tomcat.apache.org/dev/dist/m2-repository)
Downloading:
http://repo1.maven.org/eclipse/org/apache/axis2/axis2-kernel/1.5.1/
axis2-kernel-1.5.1.pom
[INFO] Unable to find resource 'org.apache.axis2:axis2-kernel:pom:1.5.1' in
repo
sitory eclipse-repo (http://repo1.maven.org/eclipse)
Downloading:
https://maven-repository.dev.java.net/nonav/repository//org.apache.
axis2/poms/axis2-kernel-1.5.1.pom
365b downloaded  (axis2-kernel-1.5.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'73ee9dcc64
bf6951b029cfb333f7075a8c4b0de5'; remote = '<!DOCTYPE' - RETRYING
Downloading:
https://maven-repository.dev.java.net/nonav/repository//org.apache.
axis2/poms/axis2-kernel-1.5.1.pom
365b downloaded  (axis2-kernel-1.5.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'73ee9dcc64
bf6951b029cfb333f7075a8c4b0de5'; remote = '<!DOCTYPE' - IGNORING
[WARNING] POM for 'org.apache.axis2:axis2-kernel:pom:1.5.1:compile' is
invalid.

Its dependencies (if any) will NOT be available to the current build.
Downloading:
http://ws.zones.apache.org/repository2/org/apache/axis2/axis2-adb/1
.5.1/axis2-adb-1.5.1.pom

On Fri, Dec 11, 2009 at 12:47 AM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> You actually do not want to store your dependencies in SCM.
>
> No matter what you think on this issue, you really do not want to store
> your
> dependencies in SCM.
>
> You want to store your dependencies in a Maven Repository Manager (e.g.
> Nexus, Artifactory, etc)
>
> These are really really easy to set up and are essential for ensuring that
> you have a reproducible build going forward.
>
> Now, you might want to store your Maven Repository Manager data in SCM....
> and that might include the artifacts that it is proxying/hosting for you,
> but that would only be for cases where your corporate IT are refusing to
> ensure DR for anything other than your SCM. My preference is to have the
> Maven Repository Manager covered by DR directly.
>
> You definately do not want to be copying your local repository into SCM and
> checking it out on each developers machine.  The local repository is not
> designed to work that way.
>
> -Stephen
>
> 2009/12/11 Xiaohui Chen <sa...@gmail.com>
>
> > Hi,
> >
> > I want to store our dependencies into SCM. There maybe other better ways.
> > The way that I see is some how change the maven's local repository to
> point
> > to somewhere in the source tree. But the local repository path has to be
> an
> > absolute path, that will not work because different developer have
> > different
> > local working copies. Is there a way to specify the local repository to
> be
> > a
> > relative path to the mvn binary?
> >
> > Thanks.
> >
>

Re: Is ther a way to change the path to localRepository to a relative path?

Posted by Stephen Connolly <st...@gmail.com>.
You actually do not want to store your dependencies in SCM.

No matter what you think on this issue, you really do not want to store your
dependencies in SCM.

You want to store your dependencies in a Maven Repository Manager (e.g.
Nexus, Artifactory, etc)

These are really really easy to set up and are essential for ensuring that
you have a reproducible build going forward.

Now, you might want to store your Maven Repository Manager data in SCM....
and that might include the artifacts that it is proxying/hosting for you,
but that would only be for cases where your corporate IT are refusing to
ensure DR for anything other than your SCM. My preference is to have the
Maven Repository Manager covered by DR directly.

You definately do not want to be copying your local repository into SCM and
checking it out on each developers machine.  The local repository is not
designed to work that way.

-Stephen

2009/12/11 Xiaohui Chen <sa...@gmail.com>

> Hi,
>
> I want to store our dependencies into SCM. There maybe other better ways.
> The way that I see is some how change the maven's local repository to point
> to somewhere in the source tree. But the local repository path has to be an
> absolute path, that will not work because different developer have
> different
> local working copies. Is there a way to specify the local repository to be
> a
> relative path to the mvn binary?
>
> Thanks.
>