No content to display due to nested plugin

I am including security definitions in a file pom.xml. When I run the target mvn compile, it throws an exception:

org.apache.maven.lifecycle.LifecycleExecutionException: failed to complete the target com.github.kongchen: swagger-maven-plugin: 3.1.2: generate (by default) when testing the project: com.fasterxml.jackson.databind.JsonMappingException: No content to display due to end of input

I have included security definitions in the Swagger Maven plugin as shown below

<securityDefinitions>
  <securityDefinition>
     <json>src/main/resources/securityDefinition.json</json>
  </securityDefinition>
</securityDefinitions>  

I tried with ${basedir}, but still get the exception above. How can this be solved, as the specification says?

The file will be read getClass().getResourceAsStream, so please pay attention to the path you configured. How can I fulfill this condition?

+4
1

(3.1.6). classpath, . , , , Java.

<jsonPath>, <json> classpath ( ).


():

, 3.1.6-SNAPSHOT.

POM:

<securityDefinitions>
    <securityDefinition>                            
      <jsonPath>${project.basedir}/securityDefinition.json</jsonPath>
    </securityDefinition>                                                                   
</securityDefinitions>

JSON :

https://github.com/kongchen/swagger-maven-plugin

+2

Source: https://habr.com/ru/post/1666580/


All Articles