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 8989815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:21:16+00:00 2026-06-15T22:21:16+00:00

How to write java program (mojo) to unzip folders in specific location? I’m new

  • 0

How to write java program (mojo) to unzip folders in specific location?
I’m new to maven if anyone help me highly appreciate.

/**
    * The Zip archiver.
    * @parameter \
    expression="${component.org.codehaus.plexus.archiver.Archiver#zip}"
    */

    private ZipArchiver zipArchiver;

    /**
    * Directory containing the build files.
    * @parameter expression="${project.build.directory}/Test"
    */

    private File buildDirectory;

    /**
    * Base directory of the project.
    * @parameter expression="${basedir}"
    */

    private File baseDirectory;
  • 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-06-15T22:21:17+00:00Added an answer on June 15, 2026 at 10:21 pm

    You can either use the maven-dependency-plugin like this:

    <project>
       [...]
       <build>
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-dependency-plugin</artifactId>
             <version>2.6</version>
             <executions>
               <execution>
                 <id>unpack</id>
                 <phase>package</phase>
                 <goals>
                   <goal>unpack</goal>
                 </goals>
                 <configuration>
                   <artifactItems>
                     <artifactItem>
                       <groupId>junit</groupId>
                       <artifactId>junit</artifactId>
                       <version>3.8.1</version>
                       <type>jar</type>
                       <overWrite>false</overWrite>
                       <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
    
                     </artifactItem>
                   </artifactItems>
                    ...
                   <overWriteReleases>false</overWriteReleases>
                   <overWriteSnapshots>true</overWriteSnapshots>
                 </configuration>
               </execution>
             </executions>
           </plugin>
         </plugins>
       </build>
       [...]
     </project>
    

    Or you can use the truezip-maven-plugin like the following:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>truezip-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <id>unpack</id>
            <goals>
              <goal>cp</goal>
            </goals>
            <phase>ThePhaseYouLike</phase>
            <configuration>
              <from>${project.build.directory}/WhatEveryArchive.zip</from>
              <to>${project.build.directory}</to>
            </configuration>
          </execution>
        </executions>
      </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to programming, but I'm preparing to write a Java program. As I'm
I am trying to write a java program that takes a maven pom.xml file
I have to write a Java program that tells what coins to give out
I need to write one java program which monitors a folder containing excel sheets
I want to write a java program that acts as a user interface to
How to write a java program which will tell me whether I have internet
I'm looking to write a Java program which will download a Java source file
I am trying at write a java program that hits a url over ssl,
I am trying to write a Java program that reads an input file consisting
I am trying to write a Java program or Hadoop Pig script which will

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.