Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #10917
Closed
Open
Issue created Nov 21, 2021 by Administrator@rootContributor

[REQ] [JAVA] maven plugin generates test in generated-test-sources

Created by: feech

Is your feature request related to a problem? Please describe.

Maven uses two different folders generated-sources and generated-test-sources. Test related files supose to get into generated-test-source folder. In current implementation all generated files in a single forlder - ${project.build.directory}/generated-sources/openapi by default.

there are problems with the approach:

  • test files go to production artifact
  • production artifact becomes dependencies (it increses dangerous in the light of recent vulnerability in logging library - the more non essential libraries in prod the likely to catch new vulnerability)

I suspect that majority of java developers just disable generating the test files

I wonder if it it possible to make mvn plugin alligned with conventional folder-structure

Describe the solution you'd like

The solution is to introduce additional parameter testOutput which is ${project.build.directory}/generated-test-sources/openapi by default.

Describe alternatives you've considered

there are several workarounds:

  • copy test files after generation with another maven plugin
  • use org.codehouse.mojo:build-helper-maven-plugin to mark the folder with test files as mvn-test-source

both of these ways have different flaws

Additional context

Assignee
Assign to
Time tracking