3

Is there a way to resolve/suppress the error "No marketplace entries found to handle swagger-codegen-maven-plugin:3.0.23:generate in Eclipse." when importing projects into Eclipse?

swagger-codegen in my pom.xml is shown below,

    <plugin>
        <groupId>io.swagger.codegen.v3</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <version>3.0.23</version>
        <executions>
            <execution>
                <id>generate-swagger-model</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
                <configuration>
                ....
                </configuration>
            </execution>
        </executions>
    </plugin>

and there is an error saying "Plugin execution is not covered by lifecycle configuration", as shown below. swagger-codegen-pom

I looked at this question and reply How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds, but I dont have parent-child pom files, its a standalone project. Also tried the other solution, putting the plugin inside pluginManagement and the swagger-codegen stopped working, meaning, it stopped generating java files.

The errors are not causing any build issues, or impacting any development. But curious on how to resolve/suppress these from happening!

swagger-codegen-eclipse

Jimson James
  • 2,937
  • 6
  • 43
  • 78
  • hello Jimson , i am facing the same issue could you please let me know if you have figures a resolution for the same ? – Mayur Aug 16 '21 at 07:40

1 Answers1

0

I ran into the same problem. It seems the swagger-codegen-maven-plugin is not associated with the generate goal.

I checked the global Eclipse maven lifecycle mapping settings (Preferences -> Maven -> Lifecycle Mappings) to recognize that the mapping file location points to a file which did not exist.

So at the specified location I created a new global mapping file with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>io.swagger.codegen.v3</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <goals>
          <goal>generate</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <execute />
      </action>
    </pluginExecution>
  </pluginExecutions>
</lifecycleMappingMetadata>

Then after a Maven update the swagger-codegen plugin finally started working.

jsteltze
  • 23
  • 4