You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by fa...@mpsa.com on 2006/02/09 11:06:47 UTC

RE: maven-proxy and snapshots problem [SOLVED]




I successfully managed to configured my settings.xml so that it works well
for snapshots when using maven-proxy. As I suspected, "central" seems to be
configured to disable snapshot handling. So I added another repository with
the same URL.

Here is the correct settings.xml for my use case:

==========================================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<settings>
      <mirrors>
            <mirror>
                  <id>maven-proxy</id>
                  <name>Maven-Proxy Mirror</name>
                  <url>http://NUCLEUS:9999/repository</url>
                  <mirrorOf>central</mirrorOf>
            </mirror>
      </mirrors>
      <profiles>
            <profile>
                  <id>snapshots-config</id>
                  <repositories>
                        <repository>
                              <id>snapshot-repo</id>
                              <name>Referentiel actif pour les snapshots
</name>
                              <url>http://NUCLEUS:9999/repository</url>
                              <releases>
                                    <enabled>false</enabled>
                              </releases>
                              <snapshots>
                                    <enabled>true</enabled>
                                    <updatePolicy>always</updatePolicy>
                              </snapshots>
                        </repository>
                  </repositories>
            </profile>
      </profiles>
      <activeProfiles>
            <activeProfile>snapshots-config</activeProfile>
      </activeProfiles>
</settings>
==========================================================================================


Best Regards / Cordialement,
Fabrice BELLINGARD
DINQ/DSIN/INSI/EATE/IDVS/AIDV
(+33) (01 61) 45 15 91  -  fabrice.belingard@mpsa.com


                                                                           
             "Treloar, Barrie                                              
             (SAPOL)"                                                      
             <barrie.treloar@                                         Pour 
             police.sa.gov.au          'Maven Users List'                  
             >                         <us...@maven.apache.org>            
                                                                        cc 
             08/02/2006 23:38                                              
                                                                     Objet 
                                       RE: maven-proxy and snapshots       
                 Veuillez              problem                             
                répondre à                                                 
             Maven Users List                                              
             <users@maven.apa                                              
                 che.org>                                                  
                                                                           
                                                                           




> Hi everybody,
>
> I'm using maven-proxy as described in the doco "Using Maven in a
corporate
> environment"
> (
http://docs.codehaus.org/display/MAVENUSER/Using+Maven+in+a+corporate+env
> ironment),
>  and everything works well except for snapshots.
>
> I have snaphots of some of my components deployed in the inner snapshot
> repository (they are *not* deployed with a unique name, though, but only
> "SNAPSHOT"). When I build a projet that references those snapshots, I get
> the following error (with -e) :
>
>
==========================================================================
> =======
> [INFO]
>
--------------------------------------------------------------------------
> --
> [ERROR] BUILD ERROR
> [INFO]
>
--------------------------------------------------------------------------
> --
> [INFO] Failed to resolve artifact.
>
> required artifacts missing:
>   com.inetpsa.fwk:fwk-sql:jar:2.1.0-SNAPSHOT
>   com.inetpsa.fwk:fwk-vrn:jar:2.1.0-SNAPSHOT
>   com.inetpsa.fwk:fwk-noyau:jar:2.1.0-SNAPSHOT
>
> for the artifact:
>   com.inetpsa.xxx:xxxMetier:jar:1.0.0-SNAPSHOT
>
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)

Well remember the caveat at
http://docs.codehaus.org/display/MAVENUSER/Mini+Guides

NOTE: This page contains drafts of user contributed miniguides entries
which
are intended to supplement the official Maven documentation. The content
you
see here might not be fully fool-proof or might not comply with the best
practices promoted by Maven. What is only guaranteed is that they have
worked once for some members. It is best to treat these items as "works in
progress" until they have been reviewed and promoted to the main Maven
documentation site.

That page, since I put it together, is a work in progress and may not be
100% correct.


That being said, from the error message you have above
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
it looks like it is not checking your repositories for the snapshots.

The section "Defining repositories in settings.xml" says just above the
extract of settings.xml:
    The profile "repositoryDefinitions" is made active, but
    "inhouseSnapshot" is de-active by default.
    If you want your project to be built against snapshot versions
    then activate the profile on the mvn command line via
    "-PinhouseSnapshot".

Are you running maven like:
    mvn -PinhouseSnapshot
???

Also double check your pom.xml file.  The default value for
distributionManagement -> snapshotRepository -> uniqueVersion is true.
This will get you the snapshot unique version.

See
snapshotRepositoryhttp://blogs.codehaus.org/people/brett/archives/maven.html

#001045_improved_snapshots_in_maven2 for more details on snapshots.

But briefly, maven handles the -SNAPSHOT to unique timestamp version lookup
for you.  You don't have to worry about the fact that in the internal
snapshot repository that they have different suffixes.

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




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