eclipse-archived / packagedrone

Eclipse Package Drone
http://eclipse.org/package-drone
Eclipse Public License 1.0
66 stars 39 forks source link

Suffixed maven artifacts are used as SNAPSHOT in maven repository #134

Open peterjeschke opened 5 years ago

peterjeschke commented 5 years ago

I'm using the API V3 to upload maven artifacts to package drone but encounter some unexpected behaviour. I'm uploading the following artifacts (in this order):

myBundle-1.0.0.20181214-1200.jar myBundle-1.0.0.20181214-1200-tests.jar myBundle-1.0.0.20181214-1200-sources.jar

The tests and sources are uploaded as children of the main jar, so that it gets displayed as (as intended):

+ myBundle-1.0.0.20181214-1200.jar
|- myBundle-1.0.0.20181214-1200-tests.jar
|- myBundle-1.0.0.20181214-1200-sources.jar

The Maven Repository aspect does something weird now: In the repo, there are directories for (again, everything correct here):

1.0.0-SNAPSHOT/
1.0.0.20181214-1200/
1.0.0.20181214-1200-sources/
1.0.0.20181214-1200-tests/

However, the 1.0.0-SNAPSHOT directory points to the sources. (Problem 1) I would expect it to point to the built jar with .class files.

I guess the last uploaded item is used as SNAPSHOT (in this case the source).

The second problem: The maven-metadata.xml file lists all versions, including the sources and tests (this is ... okay I guess), but the fields for release and latest point to the tests.

<?xml version="1.0" encoding="UTF-8"?><metadata>
  <groupId>myBundle</groupId>
  <artifactId>myBundle</artifactId>
  <versioning>
    <versions>
      <version>1.0.0-SNAPSHOT</version>
      <version>1.0.0.20181214-1200</version>
      <version>1.0.0.20181214-1200-sources</version>
      <version>1.0.0.20181214-1200-tests</version>
    </versions>
    <release>1.0.0.20181214-1200-tests</release>
    <latest>1.0.0.20181214-1200-tests</latest>
    <lastUpdated>20181214112012</lastUpdated>
  </versioning>
</metadata>

I don't know why the tests are used as release and latest, maybe it is sorted alphabetically?

I expected the SNAPSHOT, latest and release to point the the actually built JAR file or that the tests and sources don't appear in the maven repo.

peterjeschke commented 5 years ago

Note that this does not happen when I upload the tests and sources seperately (I tried it with the normal web upload). A manual upload gives me this structure:

- myBundle-1.0.0.20181214-1200.jar
- myBundle-1.0.0.20181214-1200-tests.jar
- myBundle-1.0.0.20181214-1200-sources.jar

The tests and sources don't appear in the maven repo.