Classpath when using swagger-codegen-maven-plugin
When I use the:
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.29</version>
the CLASSPATH, that propably IntelliJ creates seems to be wrong:

It should include the third entry which I added manually:

Otherwise building the project with just maven from the command-prompt works just fine.
Using an older version, like
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
works fine, on the command-prompt and using IntelliJ.
So I am afraid, that there is a problem with IntelliJ getting the CLASSPATH from Maven.
Btw:
I tried a workaround using:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>addsource</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.generated-src-path}/swagger/src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
which did not do the trick.
Is there any chance to get this fixed?
Regards
Stephan
I have uploaded a ZIP that contains a simple project to reproduce:
Upload id: 2021_10_25_GHKbeNWwMvJVMVQg (file: swagger-demo.zip)
This is the Version I am using:
IntelliJ IDEA 2019.3.5 (Ultimate Edition)
Build #IU-193.7288.26, built on May 6, 2020
Licensed to Sparda-Bank Hamburg eG / Stephan Klanck
You have a perpetual fallback license for this version
Subscription is active until January 7, 2022
Runtime version: 11.0.6+8-b520.66 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 966M
Cores: 6
Registry:
Non-Bundled Plugins: Batch Scripts Support, CMD Support
Please sign in to leave a comment.
>It should include the third entry which I added manually:
Works for me with 2021.2.3 version:
Please try this version from https://www.jetbrains.com/idea/download/
Hello Andrey,
thx for very fast response. We (me and some collegues) have upgraded to
and still we see:
Do you have any idea what we are missing?
Regards Stephan
What do you have set for this option:
Does it help to use other values there? Please re-import Maven project after you change it.
Also try this action in Maven tool window:
Try as a workaround also to make sure the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Importing | Keep source and test folders on project reload option is enabled and mark the src\gen\java directory as a source root manually (form the right context menu).
If issue remains, could you please provide complete sample project where it happens for you? You can upload it at https://uploads.jetbrains.com Thanks.