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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:08:50+00:00 2026-06-10T09:08:50+00:00

I am using jenkins with hudson cli through java. I want clean a particular

  • 0

I am using jenkins with hudson cli through java. I want clean a particular directory before each build. Any idea ? I have provided the maven command clean package which clean target folder for each build. What i want is i want to clean some other directory before each build. How to do this ?

In jenkins i specified URL of maven project , Which ll download files to workspace when building. When i give clean package command, it clears target folder every time when building. There is another folder parallel to target folder. i want to clear that folder which is inside maven project.

  • 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-10T09:08:52+00:00Added an answer on June 10, 2026 at 9:08 am

    In pom.xml add the profile tag like below

        <profiles>
            <profile>
                <id>ci</id>
                <activation>
                    <activeByDefault>false</activeByDefault>
                </activation>
                <build>
                    <plugins>
                        <plugin>
                            <artifactId>maven-clean-plugin</artifactId>
                            <version>2.5</version>
                            <executions>
                                <execution>
    <id>default-clean</id>
    <phase>pre-clean</phase>
    <goals>
        <goal>clean</goal>
    </goals>
                                </execution>
                            </executions>
                            <configuration>
                                <filesets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <fileset>
        <directory>do_not_checkin/build</directory>
        <includes>
            <include>**/*</include>
                                  </includes>
        <followSymlinks>false</followSymlinks>
                                </fileset>
                              </filesets>
                            </configuration>
                        </plugin>
                    </plugins>
                </build>
            </profile>
        </profiles>
    

    While executing commad just execute the maven command mvn -Pci clean.

    Which uses the maven clean plugin to clear a particular directory, before each build starts.

    We can package like mvn -Pci clean package.

    After cleaning the directory , package phase is executed.

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

Sidebar

Related Questions

We are using Hudson / Jenkins to build a Flex application and we want
I'm using Hudson/Jenkins.I want to know is it possible after executing tests with a
I am using Jenkins CI to run java from execute shell build step :
I am using jenkins with svn repository. Usually I want only to update svn
When using the Groovy Jenkins plugin (not the Groovy Post Build Plugin, which is
I'm trying to set up Jenkins (v1.47) to build a project using the ClearCase
I have jenkins set up to build any branch and merge it into master.
I am using Jenkins..After specifying repository URL and credentials When i click build now,
Using Jenkins or Hudson I would like to create a pipeline of builds with
We are planning on using Jenkins (used to be Hudson) for the automated builds

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.