swagger-api / swagger-api/swagger-codegen

maven-swagger-codegen-maven-plugin java language breaks intellij

Open
#7,660 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

the first problem is that test-sources is assigned within the intellij IDE as a main source tree. this produces a scoping failure in maven.

I have a workaround for this to run ant-run to delete the test-sources which provide no value anyways. (because i cannot find a switch to disable test generation.)
shown here https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3#file-gistfile1-txt-L147

a second bug surfaces, the ant-run succeeds in deleting the test dir. but maven re-runs generation before package.

shown here: https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3#file-gistfile1-txt-L175

https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3 shows the maven transcript and the pom

a switch to disable test generation would solve the issue.

Im not sure what causes the plugin to jump the rails outside of the designated phase https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3#file-pom-xml-L49

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked gist's pom.xml section and Maven transcript, focusing on the plugin configuration, test-sources assignment, and generation phase. Reproduce the IntelliJ and Maven behavior, then verify that test generation can be disabled and that Maven does not regenerate the deleted test directory before package.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.