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

Maven plugin does not work in Eclipse m2e #1436

Closed
grobitto opened this issue Apr 7, 2023 · 8 comments · Fixed by #1538
Closed

Maven plugin does not work in Eclipse m2e #1436

grobitto opened this issue Apr 7, 2023 · 8 comments · Fixed by #1538
Labels
bug Something isn't working

Comments

@grobitto
Copy link

grobitto commented Apr 7, 2023

Set up schema generation in my Eclipse project, but the result was empty "paths". The java class is just a simple resource with @path and @get annotations.

{
  "openapi" : "3.0.3",
  "info" : {
    "title" : "Generated API",
    "version" : "1.0"
  },
  "paths" : { }
}

Running maven from command line - everything is okay and schema generated correctly. I am using latest eclipse version and latest m2e plugin.
pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>gen-test</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <version>3.1.1</version>
        </dependency>        
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
                <version>3.11.0</version>
            </plugin>             
            <plugin>
                <artifactId>smallrye-open-api-maven-plugin</artifactId>
                <groupId>io.smallrye</groupId>
                <version>3.3.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-schema</goal>
                        </goals>
                        <configuration>
                            <scanDependenciesDisable>true</scanDependenciesDisable>
                        </configuration>
                    </execution>
                </executions>
            </plugin> 
        </plugins>
    </build>
</project>
@grobitto
Copy link
Author

grobitto commented Apr 7, 2023

Just confirmed this is not my eclipse configuration problem: I've downloaded fresh Eclipse 2023-03 and the problem is still there.

@MikeEdgar
Copy link
Member

@grobitto , thank you for opening this. It would be helpful if you could attach or link a small project that has the problem. That just makes it easier to jump in and start diagnosing the issue.

@MikeEdgar MikeEdgar added the bug Something isn't working label Apr 11, 2023
@darkmoonbzh
Copy link

Hi,
Same problem with my spring boot project. Nothing or almost nothing in the output file.
I'm using open api 3 annotations in my code. I cannot share my project.
Any idea about this bug?

Thanks

@MikeEdgar
Copy link
Member

@grobitto , @darkmoonbzh please use release 3.5.1 of the plugin which should be available in Maven central shortly.

@tuffnatty
Copy link
Contributor

@MikeEdgar Can you also please backport the fix to 2.3.x? I tried to cherry-pick this commit, and it seems to be all good except some de-jakartification is needed, but have not yet succeeded in creating an environment where I could build even the original code.

@MikeEdgar
Copy link
Member

@tuffnatty , we can probably do that, but I'm curious what would prevent upgrading your plugin to the latest version? Is there another breaking change somewhere?

@tuffnatty
Copy link
Contributor

@MikeEdgar Sure, it's JDK 1.8 compatibility, that's why 2.3.x still gets any updates, isn't it?

@tuffnatty
Copy link
Contributor

tuffnatty commented Oct 8, 2023

@MikeEdgar BTW I managed to build a 2.3.2-SNAPSHOT and so there's a PR: #1604 but it's basically, as I already said, just cherry-pick + de-jakartification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants