* under the License.
*/
+import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.repository.MetadataResolutionException;
import org.apache.archiva.metadata.repository.MetadataResolver;
}
- private Set<String> getVersions( List<String> selectedRepos, String groupId, String artifactId )
+ private Collection<String> getVersions( List<String> selectedRepos, String groupId, String artifactId )
throws MetadataResolutionException
{
metadataResolver.resolveProjectVersions( repositorySession, repoId, groupId, artifactId ) );
}
- return versions;
+ List<String> sortedVersions = new ArrayList<String>( versions );
+
+ Collections.sort( sortedVersions, VersionComparator.getInstance() );
+
+
+ return sortedVersions;
}
finally
{
try
{
- Set<String> projectVersions = getVersions( selectedRepos, groupId, artifactId );
+ Collection<String> projectVersions = getVersions( selectedRepos, groupId, artifactId );
repositorySession = repositorySessionFactory.createSession();