You say you defined the snapshot repository (for resolution) in a profile within the dependent project's POM? How are you activating that profile? Is there a reason you're not defining the repository directly in the POM itself? Anything that can be defined in a profile can also be defined in the main body of the POM...

Cheers,

John

Mordo, Aviran (EXP N-NANNATEK) wrote:
That didn't work. Let me elaborate a bit more, maybe I'm doing something wrong.

In one project I have the distributionManagement defined as (I attached the 
entire POM):

<project 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/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>gov.archives.era</groupId>
  <artifactId>core</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>ERA core components</name>
  <url>http://archives.gov</url>
  <build>
          <defaultGoal>compile</defaultGoal>
  </build>
  <distributionManagement>
          <snapshotRepository>
                  <id>core-snapshot</id>
                  <name>Core Snapshot repository</name>
                  <url>file:///var/apache2/htdocs/repository</url>
          </snapshotRepository>
  </distributionManagement>
  </project>

I use the deploy goal to deploy the core snapshot to the repository, which is 
being deployed with a timestamp.


Now on another project I need that core snapshot as a dependency so in the POM 
I have defined:
<dependency>
        <groupId>core</groupId>
        <artifactId>core</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>compile</scope>
</dependency>

...

And in the profiles I defined the repository as:

<repositories>
        <repository>
                <id>dev-server</id>
                <name>Dev server apache repository</name>
                <releases>
                        <enabled>false</enabled>
                </releases>
                <url>http://158.xxx.xxx.xxx/repository</url>
        </repository>
</repositories>

And the error I'm getting is:
[INFO] Error building POM (may not be this project's POM).


Project ID: core:core

Reason: Error getting POM for 'core:core' from the repository: Error 
transferring file
  core:core:1.0-SNAPSHOT:pom

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  dev-server (http://158.xxx.xxx.xxx/repository)


What am I doing wrong here ?

Aviran

-----Original Message-----
From: Jörg Schaible [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 2:21 AM
To: Maven Users List
Subject: RE: [m2] Problem using snapshot repository

Hi Aviron,

Mordo, Aviran (EXP N-NANNATEK) wrote on Monday, November 28, 2005 9:43 PM:


I have a snapshot repository (running under apache).

When I use mvn deploy goal to deploy core-1.0-SNAPSHOT, maven deploys the snapshot jar and the POM files with a timestamp.
All good until now.

Now I have another machine that has this snapshot as a dependency, but when it tries to download the snapshot I'm getting an error saying it can't find core-1.0-SNAPSHOT.pom . In the server there is not core-1.0-SNAPSHOT.pom but the POM with a timestamp i.e something like core-1.0-20051128.200550-2.pom

What do I need to do in order for it to download the snapshot correctly from the snapshot repository ?


you're fighting with policy. M2's default snapshot policy is different now 
compared to M102. The M2 deploy means, that releasing a snapshot is also an 
indentifiable release. Therefore the artifact is published with a time stamp 
(as it was in M1 with xxx:deploy-snapshot) and any POM using this particular 
artifact has to use the time-stamped version as dependency. You can change the 
default by setting repositories/repository/releases/enabled for your snapshot 
repository to false. Then the SNAPSHOT part is not replaced and the artifact is 
deployed without the timestamp.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to