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

  • Home
  • SEARCH
  • 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 6650025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:50:39+00:00 2026-05-26T00:50:39+00:00

I have been trying to convert a web project that produces a war file

  • 0

I have been trying to convert a web project that produces a war file to maven. my existing project structure is as follows –

MyWebProject
|
— WEB-INF/src – contains a bunch of packages like com.myweb.client, com.myweb.server etc
— WEB-INF/test – contains 1 package com.myweb.tests
— web-scripts – contains bunch of scripts (just a folder; not on classpath)
— misc-files1 – contains misc files sets 1
— misc-files2 – similar to above

presently a war file is being created using ant script with the resulting war file structure as follows

myweb.war
– Meta-INF (only contains MANIFEST.MF)
– WEB-INF
– classes
– com.myweb.client
– com.myweb.server etc.
– web-scripts
– misc-files1
– misc-files2

i created a basic maven project using simple-artifact and added my packages. i am using maven assembly plugin to generate the war file and using filesets to filter. but my resultant war file is no where close to what i get with ant. here is a shortened version of my assembly.xml file

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

  <id>assembler</id>
  <formats>
    <format>war</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<dependencySet/>
</dependencySets>

<fileSets>

    <fileSet>
        <directory>src/main/java</directory>
        <outputDirectory>WEB-INF</outputDirectory>
        <includes>
        <include>**</include>
        </includes>        
    </fileSet>

    <fileSet>
        <directory>es</directory>
        <outputDirectory>resources1</outputDirectory>
        <includes>
        <include>**</include>
        </includes>        
    </fileSet>
    <fileSet>
        <directory>resources2</directory>
        <outputDirectory>resources2</outputDirectory>
        <includes>
        <include>**/*</include>
        </includes>        
    </fileSet>
    <fileSet>           
    <fileSet>
        <directory>test</directory>
        <outputDirectory>WEB-INF</outputDirectory>
        <includes>
        <include>**</include>
        </includes>        
    </fileSet>

  </fileSets>


</assembly>

To create a custom war, is assembly plugin the right approach. I can always include my ant script in pom using maven-antrun-plugin, but i want to avoid using ant if possible. any suggestions.

  • 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-26T00:50:40+00:00Added an answer on May 26, 2026 at 12:50 am

    You should be using maven-war-plugin for this.

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

Sidebar

Related Questions

I have a working sql query that I have been trying to convert to
I have been trying to work my way through Project Euler, and have noticed
I have been trying to learn how to add testing to existing code --
I have been trying to figure out a way to convert bitmap files into
I have been trying to call a C function that has the following signature
I have been trying to put together something that allows me to extract points
I've been tasked with a project that requires me to convert a quote for
I have been trying to convert my rails 2.2.2 app over to jQuery, and
I have been trying to convert sdot like this html_entity_decode(&sdot;); Any tips?
I have been fighting with this for a bit now. I’m trying to convert

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.