title: How to include automatically xmlbeans generated java sources into maven jar?
body: <p>I' m using xmlbeans-maven-plugin for generating sources from xsds. I
  successfully generate jar file with compiled classes. But
  unfortunately i can not include java sources(.java) files into maven
  generated jar file. When i want to use maven-resources-plugin or
  maven-sources-plugin it creates a jar file with .java sources but it
  adds the postfix (-resources or -sources) at the end of the jar file.</p>
  
  <p>I do not want to use any other plugin. I only want to use
  xmlbeans-maven-plugin to create my jar file with xmlbeans created java
  sources.</p>
  
  <p>My pom.xml is as follows :</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:repository="http://www.springframework.org/schema/data/repository"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
      http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
  &lt;!-- Properties Definitions --&gt;
  &lt;properties&gt;
      &lt;project.name&gt;myxmlbeansproject&lt;/project.name&gt;
      &lt;project.version&gt;5.0.6&lt;/project.version&gt;
      &lt;project.packaging&gt;jar&lt;/project.packaging&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.sources.directory&gt;src/main/resources/xsds&lt;/project.sources.directory&gt;
      &lt;project.java.version&gt;1.4&lt;/project.java.version&gt;
  &lt;/properties&gt;
  &lt;!-- End 0f Properties Definitions --&gt;
  
  &lt;!-- Project Defaults Definitions --&gt;  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;my.xmlbeans&lt;/groupId&gt;
  &lt;artifactId&gt;my.xmlbeans.project.artifact&lt;/artifactId&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;version&gt;${project.version}&lt;/version&gt;
  &lt;name&gt;myxmlbeansproject&lt;/name&gt;
  &lt;description&gt;TMGW Schema Project&lt;/description&gt;
  &lt;!-- End of Project Defaults Definitions --&gt;
  
  &lt;!-- Dependencies --&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.xmlbeans&lt;/groupId&gt;
          &lt;artifactId&gt;xmlbeans&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;!-- End of Dependencies --&gt;
  
  &lt;!-- Build Definitions &amp; xmlbean Plugin Definition --&gt;
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;xmlbeans-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;generate-sources&lt;/id&gt;
                      &lt;phase&gt;generate-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;xmlbeans&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;configuration&gt;
              &lt;schemaDirectory&gt;${project.sources.directory}/${project.version}&lt;/schemaDirectory&gt;
              &lt;javaSource&gt;${project.java.version}&lt;/javaSource&gt;
              &lt;sourceGenerationDirectory&gt;javasources/&lt;/sourceGenerationDirectory&gt;
              &lt;staleFile&gt;stalefile/xsd.stale&lt;/staleFile&gt;
              &lt;outputJar&gt;${project.name}-${project.version}.${project.packaging}&lt;/outputJar&gt;
              &lt;detail&gt;true&lt;/detail&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.7&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;copy-resources&lt;/id&gt;
                  &lt;phase&gt;validate&lt;/phase&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;copy-resources&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                      &lt;outputDirectory&gt;/javasources&lt;/outputDirectory&gt;
                      &lt;resources&gt;
                          &lt;resource&gt;
                              &lt;directory&gt;javasources/&lt;/directory&gt;
                          &lt;/resource&gt;
                      &lt;/resources&gt;
                  &lt;/configuration&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;attach-sources&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;jar-no-fork&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
              &lt;finalName&gt;${project.name}-${project.version}.${project.packaging}&lt;/finalName&gt;
              &lt;attach&gt;true&lt;/attach&gt;
          &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;!-- End of Build Definitions &amp; xmlbean Plugin Definition --&gt;
  
  &lt;!-- Nexus Repository &amp; Distribution Management Definitions --&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;RepoNexus&lt;/id&gt;
          &lt;url&gt;${REPO_SERVER}content/repositories/public/&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;RepoNexusPluginRep&lt;/id&gt;
          &lt;url&gt;${REPO_SERVER}content/repositories/public&lt;/url&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  &lt;distributionManagement&gt;
      &lt;snapshotRepository&gt;
          &lt;id&gt;nexus.snapshots&lt;/id&gt;
          &lt;name&gt;nexus.snapshots&lt;/name&gt;
          &lt;url&gt;${REPO_SERVER}content/repositories/snapshots&lt;/url&gt;
      &lt;/snapshotRepository&gt;
      &lt;repository&gt;
          &lt;id&gt;nexus.releases&lt;/id&gt;
          &lt;name&gt;nexus.releases&lt;/name&gt;
          &lt;url&gt;${REPO_SERVER}content/repositories/releases&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  &lt;!-- End of Nexus Repository &amp; Distribution Management finitions --&gt;
  </code></pre>
  
  <p></p>