🚧 Concat versions
This commit is contained in:
parent
ec41bec3a2
commit
667480f5e3
@ -53,10 +53,7 @@ public class ArtifactResource
|
|||||||
Map<String, User> accounts = getAccounts(artifactIds);
|
Map<String, User> accounts = getAccounts(artifactIds);
|
||||||
for (ArtifactId artifactId : artifactIds)
|
for (ArtifactId artifactId : artifactIds)
|
||||||
{
|
{
|
||||||
for (ReleaseVersion releaseVersion : artifactId.getVersions())
|
System.out.println("Skip setting user. Needs to be implemented");
|
||||||
{
|
|
||||||
releaseVersion.setUploadAccount(accounts.get(releaseVersion.getUploadedBy()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return artifactIds;
|
return artifactIds;
|
||||||
}
|
}
|
||||||
@ -66,12 +63,8 @@ public class ArtifactResource
|
|||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
for (ArtifactId artifactId : artifactIds)
|
for (ArtifactId artifactId : artifactIds)
|
||||||
{
|
{
|
||||||
for (ReleaseVersion releaseVersion : artifactId.getVersions())
|
System.out.println("Skip setting user. Needs to be implemented");
|
||||||
{
|
|
||||||
ids.add(releaseVersion.getUploadedBy());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return userClient.get(ids);
|
return userClient.get(ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import java.time.ZonedDateTime;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "artifact_id")
|
@Table(name = "artifact_id")
|
||||||
@ -89,9 +90,9 @@ public class ArtifactId
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ReleaseVersion> getVersions()
|
public List<Version> getVersions()
|
||||||
{
|
{
|
||||||
return releaseVersions.stream().sorted(Comparator.comparing(version -> new DefaultArtifactVersion(version.getVersion()))).toList().reversed();
|
return Stream.concat(snapshotVersions.stream(), releaseVersions.stream()).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactId setVersions(List<ReleaseVersion> releaseVersions)
|
public ArtifactId setVersions(List<ReleaseVersion> releaseVersions)
|
||||||
|
|||||||
@ -2,5 +2,6 @@ package dev.dinauer.maven.maven.core;
|
|||||||
|
|
||||||
public interface Version
|
public interface Version
|
||||||
{
|
{
|
||||||
|
String getVersion();
|
||||||
boolean isSnapshot();
|
boolean isSnapshot();
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user