What do you think? Discuss, post comments, or ask questions at the end of this article [More about me]

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Problem

Maven is wonderful.  However, often you might also want to product a .jar for your .war maven project.

Solution

Add the following to your maven pom.xml.

<build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        ...
        <configuration>
          <attachClasses>true</attachClasses>
        </configuration>
      </plugin>
	</plugins>
</build>

References

  1. https://stackoverflow.com/questions/10188495/how-to-use-class-file-from-another-war/10189767#10189767
  2. https://maven.apache.org/plugins/maven-war-plugin/faq.html#attached

  • No labels