redhat-developer / redhat-developer/vscode-java
Out of the box support for swagger-codegen-maven-plugin
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 2.3k
- Forks
- 546
- Merge moyen
- 20 h 1 min
- PR mergées (30 j)
- 11
Description
There is no support for automatically detecting and adding to the classpath the automatically generated code by the swagger-codegen-maven-plugin.
This means that, even though the project builds without issues from the command line, all the java classes that import the auto-generated code complain that those imports don't exist from within VSCode.
A work-around is following the same advice you gave for "Annotation Processing support for Maven projects" at: https://github.com/redhat-developer/vscode-java/wiki/Annotation-Processing-support-for-Maven-projects.
i.e. you add the generated source code path with the build-helper-maven-plugin to your pom manually, but this is not ideal.
e.g. assuming <sourceFolder>src/main/java</sourceFolder>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<!-- Need to ensure the generated source folder is added to the project classpath, in jdt.ls -->
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/swagger/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Any chances to get this done automatically? Or at the very least, could you add this to the documentation for others that stumble on the same issue?
Thanks
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la configuration du projet Maven indiquée dans l’issue, notamment la configuration de pom.xml de build-helper-maven-plugin et la documentation liée sur la prise en charge d’Annotation Processing. Comparez la gestion du classpath de VSCode avec le build en ligne de commande pour la sortie de swagger-codegen-maven-plugin ; le travail est terminé lorsque les imports Java générés sont résolus automatiquement ou que le workaround est documenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, vscode
- Domaine
- build-system
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100