You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/03 21:09:30 UTC

[GitHub] [netbeans] tigerinus opened a new issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

tigerinus opened a new issue #3690:
URL: https://github.com/apache/netbeans/issues/3690


   ### Apache NetBeans version
   
   Apache NetBeans 12.6
   
   ### What happened
   
   I use `openapi-generator-maven-plugin` for generating classes based off a provided `openapi.yaml` file. The corresponding java files are generated under `target` folder instead of `src` folder since I don't want to commit any auto-generated code.
    
   This works fine with VSCode + Eclipse based Java extension, but not with Apache Netbeans extension. Clearly it doesn't look into target folder for any Java code.
   
   ### How to reproduce
   
   `git clone https://github.com/tigerinus/invesla_backend.git`
   
   Then load the project in vscode
   
   ### Did this work correctly in an earlier version?
   
   No
   
   ### Operating System
   
   Linux
   
   ### JDK
   
   JDK8
   
   ### Apache NetBeans packaging
   
   Apache VSNetBeans for VSCode
   
   ### Anything else
   
   This is how `pom.xml` looks like for auto-generating java code:
   
   ```xml
   <plugin>
       <groupId>org.openapitools</groupId>
       <artifactId>openapi-generator-maven-plugin</artifactId>
       <version>5.3.0</version>
       <executions>
           <execution>
               <id>1</id>
               <goals>
                   <goal>generate</goal>
               </goals>
               <configuration>
                   <inputSpec>${project.basedir}/src/main/java/com/tensorsmart/invesla/controller/api/stocks.api.yaml</inputSpec>
                   <generatorName>spring</generatorName>
                   <configOptions>
                       <sourceFolder>src/gen/java/main</sourceFolder>
                       <interfaceOnly>true</interfaceOnly>
                   </configOptions>
               </configuration>
           </execution>
           <execution>
               <id>2</id>
               <goals>
                   <goal>generate</goal>
               </goals>
               <configuration>
                   <inputSpec>${project.basedir}/src/main/java/com/tensorsmart/invesla/questrade/controller/api/token.api.yaml</inputSpec>
                   <generatorName>spring</generatorName>
                   <configOptions>
                       <sourceFolder>src/gen/java/main</sourceFolder>
                       <interfaceOnly>true</interfaceOnly>
                   </configOptions>
               </configuration>
           </execution>
       </executions>
   </plugin>
   ```
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] vieiro commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
vieiro commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059533501


   @tigerinus , you want to read openapi-generator-maven-plugin documentation at https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md 
   
   Specifically the generated-sources output directory
   ```
   <output>${project.build.directory}/generated-sources</output>
   ```
   And the files to generate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059520725


   The generated project structure looks strange on the verge of broken. When I use a maven project and generate code (for example from annotations), it is common, that the generated code is placed in:
   
   `target/generated-sources/<name_of_generator_or_custom_set>/<packages>`
   
   In the case of your sample, a whole maven project is generated in `target/generated-sources/<name_of_generator_or_custom_set>` (there is even a pom.xml there). This is irritating and IMHO broken. The code generator for maven should do just that: generate code, not whole projects. Generating projects might be helpful for POM projects, but even then the placement looks broken.
   
   I found an option to change the source base, but I'm missing an option to surpress the wrongly created pom.xml. I did not look into the code, but I assume, that NetBeans detects the pom.xml and assumes a new projects starts at that point. Again IMHO a valid assumption.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tigerinus commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
tigerinus commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059578835


   > The generator generates a broken structure, so why should NetBeans try to make sense from the broken structure? Given, that you can already change the source directory, it should be doable to add a "don't generate project file" option to the generator.
   
   Got it. I guess I will have to stay with VSCode + Eclipse JDT extension for now.
   
   Thanks guys!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tigerinus commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
tigerinus commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059567995


   >  The code generator for maven should do just that: generate code, not whole projects. 
   @matthiasblaesing  - I'm afraid I can't do anything to the openapi generator project since I don't own it.
   
   >   you want to read openapi-generator-maven-plugin documentation...
   @vieiro  - I'm sorry but what exactly are you proposing?
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing edited a comment on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
matthiasblaesing edited a comment on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059569407


   > > The code generator for maven should do just that: generate code, not whole projects.
   
   >  @matthiasblaesing  - I'm afraid I can't do anything to the openapi generator project since I don't own it.
   
   The generator generates a broken structure, so why should NetBeans try to make sense from the broken structure? Given, that you can already change the source directory, it should be doable to add a "don't generate project file" option to the generator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059569407


   > > The code generator for maven should do just that: generate code, not whole projects.
   > > @matthiasblaesing  - I'm afraid I can't do anything to the openapi generator project since I don't own it.
   
   The generator generates a broken structure, so why should NetBeans try to make sense from the broken structure? Given, that you can already change the source directory, it should be doable to add a "don't generate project file" option to the generator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059710285


   @tigerinus this is one interpretation. I think I outlined what would be required to get a sane result from the generator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tigerinus commented on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
tigerinus commented on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059760614


   If the project can be built successfully using `mvn` then an IDE should be able to load the project. I believe `mvn` simply choose to ignore any extra `pom.xml` in the sub directory, so does Eclipse JDT. Technically speaking from perspective of a compiler at root project level this structure is not broken. 
   
   But I understand the rationale behind that Netbeans treats it as broken structure and refuses to build. That's completely fine to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing edited a comment on issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
matthiasblaesing edited a comment on issue #3690:
URL: https://github.com/apache/netbeans/issues/3690#issuecomment-1059569407


   > > The code generator for maven should do just that: generate code, not whole projects.
   >  @matthiasblaesing  - I'm afraid I can't do anything to the openapi generator project since I don't own it.
   
   The generator generates a broken structure, so why should NetBeans try to make sense from the broken structure? Given, that you can already change the source directory, it should be doable to add a "don't generate project file" option to the generator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tigerinus closed issue #3690: [vscode] LSP does not respect auto generated code in `target` folder

Posted by GitBox <gi...@apache.org>.
tigerinus closed issue #3690:
URL: https://github.com/apache/netbeans/issues/3690


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists