Skip to content

Commit

Permalink
Quarkus 3 migration
Browse files Browse the repository at this point in the history
  * Update service-parent to 5-SNAPSHOT
  * Change javax.* to jakarta.* of namespace migration
  * Fix all migration errors
  • Loading branch information
ligangty committed Jan 5, 2024
1 parent 93babb2 commit 4db9e7e
Show file tree
Hide file tree
Showing 108 changed files with 389 additions and 1,778 deletions.
19 changes: 9 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.commonjava</groupId>
<artifactId>service-parent</artifactId>
<version>4</version>
<version>5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.commonjava.indy.service</groupId>
Expand All @@ -44,7 +44,7 @@

<atlas.version>1.1.1</atlas.version>
<indymodel.version>1.5-SNAPSHOT</indymodel.version>
<indysecurity.verison>1.1</indysecurity.verison>
<indysecurity.verison>1.2-SNAPSHOT</indysecurity.verison>

<cassandra.version>3.11.3</cassandra.version>
<infinispan.version>14.0.6.Final</infinispan.version>
Expand Down Expand Up @@ -216,9 +216,13 @@
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.14.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.infinispan</groupId>-->
<!-- <artifactId>infinispan-core</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<artifactId>infinispan-core-jakarta</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
Expand All @@ -234,11 +238,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
<version>2.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.commonjava.atlas</groupId>
<artifactId>atlas-relationships-api</artifactId>
Expand Down Expand Up @@ -350,8 +349,8 @@
</dependency>
<dependency>
<groupId>org.commonjava.util</groupId>
<artifactId>http-testserver-core</artifactId>
<version>2.0</version>
<artifactId>http-testserver-quarkus</artifactId>
<version>2.3.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.util.Set;

import static org.commonjava.indy.service.repository.change.event.kafka.KafkaEventUtils.CHANNEL_INTERNAL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Default;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Default;
import jakarta.inject.Inject;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.commonjava.indy.service.repository.model.ArtifactStore;
import org.commonjava.indy.service.repository.model.StoreKey;

import javax.enterprise.inject.Alternative;
import javax.inject.Named;
import jakarta.enterprise.inject.Alternative;
import jakarta.inject.Named;
import java.util.Map;

@Alternative
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.commonjava.indy.service.repository.model.ArtifactStore;
import org.commonjava.indy.service.repository.model.StoreKey;

import javax.enterprise.event.Event;
import jakarta.enterprise.event.Event;
import java.util.Map;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

/**
* This event dispatcher will dispatch Store Event through kafka
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import javax.ws.rs.DELETE;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.core.Response;

@Path("/api/storage")
@RegisterRestClient(configKey="storage-service-api")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Priority;
import javax.inject.Inject;
import javax.ws.rs.Priorities;
import javax.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientRequestFilter;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.ext.Provider;
import jakarta.annotation.Priority;
import jakarta.inject.Inject;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.client.ClientRequestContext;
import jakarta.ws.rs.client.ClientRequestFilter;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.ext.Provider;

@Provider
@Priority(Priorities.AUTHENTICATION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;

import javax.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.ApplicationScoped;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.core.Response;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;

import static javax.ws.rs.core.Response.Status.FORBIDDEN;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static jakarta.ws.rs.core.Response.Status.FORBIDDEN;
import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;

@ApplicationScoped
public class AdminController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -40,9 +40,9 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static jakarta.ws.rs.core.Response.Status.BAD_REQUEST;
import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static jakarta.ws.rs.core.Response.Status.NOT_FOUND;
import static org.commonjava.indy.service.repository.model.StoreKey.fromString;
import static org.commonjava.indy.service.repository.model.pkg.MavenPackageTypeDescriptor.MAVEN_PKG_KEY;
import static org.commonjava.indy.service.repository.model.pkg.PackageTypeConstants.isValidPackageType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import org.commonjava.indy.service.repository.model.version.Versioning;
import org.commonjava.indy.service.repository.util.JaxRsUriFormatter;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.util.ArrayList;
import java.util.List;

import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;

@ApplicationScoped
public class StatsController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import jakarta.inject.Inject;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
Expand All @@ -50,7 +50,7 @@

import static java.util.Collections.emptySet;
import static java.util.Collections.singletonMap;
import static javax.ws.rs.core.Response.Status.METHOD_NOT_ALLOWED;
import static jakarta.ws.rs.core.Response.Status.METHOD_NOT_ALLOWED;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.commonjava.indy.service.repository.data.StoreUpdateAction.DELETE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Default;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Default;
import jakarta.inject.Inject;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@
import org.commonjava.indy.service.repository.config.IndyRepositoryConfiguration;
import org.commonjava.indy.service.repository.data.annotations.ClusterStoreDataManager;
import org.commonjava.indy.service.repository.data.annotations.MemStoreDataManager;
import org.commonjava.indy.service.repository.data.annotations.StandaloneStoreDataManager;
import org.commonjava.indy.service.repository.data.cassandra.CassandraStoreDataManager;
import org.commonjava.indy.service.repository.data.infinispan.InfinispanStoreDataManager;
import org.commonjava.indy.service.repository.data.mem.MemoryStoreDataManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Default;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;

@ApplicationScoped
public class StoreDataManagerProducer
Expand All @@ -41,16 +39,11 @@ public class StoreDataManagerProducer
@Produces
@ApplicationScoped
@Default
public StoreDataManager produces( @StandaloneStoreDataManager InfinispanStoreDataManager ispnStoreDataManager,
@ClusterStoreDataManager CassandraStoreDataManager clusterStoreDataManager,
public StoreDataManager produces( @ClusterStoreDataManager CassandraStoreDataManager clusterStoreDataManager,
@MemStoreDataManager MemoryStoreDataManager memoryStoreDataManager )
{
String storageType = repoConfig.storageType().orElse( "" );
if ( IndyRepositoryConfiguration.STORAGE_INFINISPAN.equals( storageType ) )
{
return ispnStoreDataManager;
}
else if ( IndyRepositoryConfiguration.STORAGE_CASSANDRA.equals( storageType ) )
if ( IndyRepositoryConfiguration.STORAGE_CASSANDRA.equals( storageType ) )
{
return clusterStoreDataManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import static org.commonjava.indy.service.repository.model.pkg.MavenPackageTypeDescriptor.MAVEN_PKG_KEY;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.commonjava.indy.service.repository.model.ArtifactStore;

import javax.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.ApplicationScoped;

/**
* Store Validator used to validate URL for for {@link ArtifactStore} instances and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.commonjava.indy.service.repository.data.annotations;

import javax.inject.Qualifier;
import jakarta.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.commonjava.indy.service.repository.data.annotations;

import javax.inject.Qualifier;
import jakarta.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.commonjava.indy.service.repository.data.annotations;

import javax.inject.Qualifier;
import jakarta.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import io.quarkus.runtime.Startup;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.util.Optional;

import static java.util.Optional.of;
Expand Down
Loading

0 comments on commit 4db9e7e

Please sign in to comment.