2

My problem is "simple" but I didn´t found the solution until now:

I have 2 projects.

  • Project A built with a classifier (called dev or pro) with help of a specific profile
  • Project B with a dependency to A (using classifier dev or pro)

  • I execute install goal on A with a classifier (dev)

  • I re-execute install goal with another classifier (pro)

Then I compile the B project (and i put the dependency to A, with classifier DEV)

It works well.


But when I do the same with artifactory (goal deploy) , it doesn´t work (and the repository is configured "unique")

It doesn´t work because artifactory? maven dependency? is trying to download A with classifier dev AND latest timestamp, buildnumber of whatever.

But this "logic" is wrong because the latest timestamp is valid for A classifier pro!!!

I read the metadata.xml between local repository and artifactory repository. There are similar (but not exactly the same)

What i´m wrong? Thanks guys!

  • Maven version : 3.03
  • Artifactory version : 2.3.4.1
carlspring
  • 31,231
  • 29
  • 115
  • 197
user973098
  • 21
  • 3

1 Answers1

5

This might be due to the fact that at the time of writing this answer, Artifactory generates Maven 2 type of metadata, which as opposed to the newer type generated by Maven 3, does not specify a separate "latest version" per classifier\type of Artifact.

That is, while Maven 2 metadata specifies the latest build and known history:

<?xml version="1.0" encoding="UTF-8"?>
    <metadata>
      <groupId>org.jfrog.test</groupId>
      <artifactId>multi1</artifactId>
      <version>2.1-SNAPSHOT</version>
      <versioning>
        <snapshot>
          <timestamp>20110928.112713</timestamp>
          <buildNumber>14</buildNumber>
        </snapshot>
        <lastUpdated>20110928112718</lastUpdated>
      </versioning>
    </metadata>

Maven 3 specifies the latest build per artifact type and classifier:

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>org.jfrog.test</groupId>
  <artifactId>multi1</artifactId>
  <version>2.1-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20110928.112713</timestamp>
      <buildNumber>14</buildNumber>
    </snapshot>
    <lastUpdated>20110928112718</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <classifier>tests</classifier>
        <extension>jar</extension>
        <value>2.1-20110928.112713-14</value>
        <updated>20110928112713</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>2.1-20110928.112713-14</value>
        <updated>20110928112713</updated>
      </snapshotVersion>
      ...
    </snapshotVersions>
  </versioning>
</metadata>

Support for Maven 3 metadata generation is currently planned for Artifactory's next version (2.3.5).
Until then I can only suggest that you produce both artifacts with different artifact IDs.

noamt
  • 7,397
  • 2
  • 37
  • 59
  • I will wait the next version of artifactory. It was not easy to understand the relation between RTFACT-3794 and this problem (for me, of course). – user973098 Oct 03 '11 at 07:53