Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger-maven-plugin-jakarta generate swagger doc fail #4766

Open
Czytx opened this issue Oct 24, 2024 · 0 comments
Open

swagger-maven-plugin-jakarta generate swagger doc fail #4766

Czytx opened this issue Oct 24, 2024 · 0 comments

Comments

@Czytx
Copy link

Czytx commented Oct 24, 2024

my project like this:
my-maven-multi-module-project/

├── parent-project/
│ └── pom.xml

├── module1/
│ └── pom.xml

└── module2/
└── pom.xml

parent-project/pom.xml configure swagger-maven-plugin-jakarta:

<build> <plugins> <plugin> <groupId>io.swagger.core.v3</groupId> <artifactId>swagger-maven-plugin-jakarta</artifactId> <version>${swagger.version}</version> <configuration> <outputFileName>swagger</outputFileName> <outputFormat>JSONANDYAML</outputFormat> </configuration> <executions> <execution> <id>AnimalJdbcResource</id> <phase>compile</phase> <goals> <goal>resolve</goal> </goals> <configuration> <outputPath>${project.basedir}/target/classes/META-INF/swagger-info/com.test.db.resources.AnimalJdbcResource</outputPath> <resourceClasses> <Class>com.test.db.resources.AnimalJdbcResource</Class> </resourceClasses> <contextId>com.test.db.resources.AnimalJdbcResource</contextId> <configurationFilePath>${project.basedir}/src/main/resources/openapi/openapi.yaml</configurationFilePath> </configuration> </execution> </executions> </plugin> </plugins> </build>

Class AnimalJdbcResource is located module1/,When I execute maven clean install,the following error occurred:
error loading class from resourceClasses: com.test.db.resources.AnimalJdbcResource
java.lang.ClassNotFoundException: com.test.db.resources.AnimalJdbcResource
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:421)
at java.lang.Class.forName (Class.java:412)
at io.swagger.v3.jaxrs2.integration.JaxrsAnnotationScanner.classes (JaxrsAnnotationScanner.java:71)
at io.swagger.v3.jaxrs2.integration.JaxrsApplicationAndAnnotationScanner.classes (JaxrsApplicationAndAnnotationScanner.java:10)
at io.swagger.v3.oas.integration.GenericOpenApiContext.read (GenericOpenApiContext.java:658)
at io.swagger.v3.plugin.maven.SwaggerMojo.execute (SwaggerMojo.java:84)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

swagger-maven-plugin-jakarta not supported in root pom configuration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant