Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 723017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:03:30+00:00 2026-05-14T06:03:30+00:00

There are two projects: 1) applet project that outputs jar file 2) web app

  • 0

There are two projects:
1) applet project that outputs jar file
2) web app project that should host the jar file.

After (1) finished building, the applet jar file should be copied into the webapp folder of (2). The purpose is that (2) will host the applet (1) on the Internet.

A lot of examples explain how to use another project as a library dependency. Other examples, show how to use ant plugin to copy files. I am unsure on how to properly set this up, so that ‘mvn install’ on the parent project will do the copying at the right time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:03:30+00:00Added an answer on May 14, 2026 at 6:03 am

    I would declare the applet as a dependency of the webapp, copy it to the webapp just before packaging using the Dependency plugin and its copy goal. The whole solution might looks like this:

    <project>
      ...
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>my-applet</artifactId>
          <version>${project.version}</version>
          <scope>provided</scope> <!-- we don't want the applet in WEB-INF/classes -->
        </dependency>
        ...
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
              <execution>
                <id>copy</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>my-applet</artifactId>
                      <version>${project.version}</version>
                      <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
                      <destFileName>the-applet.jar</destFileName>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          ...
        </plugins>
      </build>
    </project>
    

    Declaring the applet as dependency is for the reactor build order (but I’m not 100% sure it is required).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that there is a solution that contains two projects (Project1 and Project2).
After having looked at each of these two projects, it seems that both are
In .NET there are two version numbers available when building a project, File Version
My current development project has two aspects to it. First, there is a public
There seems to be two major conventions for organizing project files and then many
I'm writing a WinForms app which has two modes: console or GUI. Three projects
Can these two SVN clients collaborate? I have my projects checked out with Tortoise,
There are two weird operators in C#: the true operator the false operator If
There are two popular closure styles in javascript. The first I call anonymous constructor
There are two popular naming conventions: vc90/win64/debug/foo.dll foo-vc90-win64-debug.dll Please discuss the problems/benefits associated with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.