Nelson G.
Nelson G.

Reputation: 5441

Build artifact from generated pom and sources

I have a java maven project with only a pom.xml file :

pom.xml

This pom use a code generator (swagger-codegen in my case) to generate a whole project tree in target/generated-sources, my new project tree is:

pom.xml
target
  generated-sources
    pom.xml
      src
        ...

My question is : How to build artifact from my generated project in target/generated-sources ?

Upvotes: 2

Views: 229

Answers (1)

codeaholicguy
codeaholicguy

Reputation: 1691

Update your pom.xml with:

<project>
  <build>
    <sourceDirectory>target/generated-sources/src</sourceDirectory>
  </build>
</project>

Upvotes: 1

Related Questions