diff --git a/generators/server/files.js b/generators/server/files.js
index <HASH>..<HASH> 100644
--- a/generators/server/files.js
+++ b/generators/server/files.js
@@ -629,8 +629,13 @@ const serverFiles = {
     serverMicroservice: [
         {
             condition: generator =>
-                (generator.applicationType === 'microservice' || generator.applicationType === 'gateway') &&
-                generator.authenticationType === 'uaa',
+                (
+                    generator.applicationType === 'microservice' ||
+                    (
+                        generator.applicationType === 'gateway' &&
+                        (generator.authenticationType === 'uaa' || generator.authenticationType === 'oauth2')
+                    )
+                ) && generator.authenticationType === 'uaa',
             path: SERVER_MAIN_SRC_DIR,
             templates: [
                 {
@@ -737,10 +742,6 @@ const serverFiles = {
                     renameTo: generator => `${generator.javaDir}config/FeignConfiguration.java`
                 },
                 {
-                    file: 'package/config/PageableSpringEncoder.java',
-                    renameTo: generator => `${generator.javaDir}config/PageableSpringEncoder.java`
-                },
-                {
                     file: 'package/client/AuthorizedFeignClient.java',
                     renameTo: generator => `${generator.javaDir}client/AuthorizedFeignClient.java`
                 },
removed unused pageable encoder class