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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:46:21+00:00 2026-05-16T04:46:21+00:00

I only need to use this class org.apache.commons.io.FileUtils, and yet I’m downloading all commons

  • 0

I only need to use this class org.apache.commons.io.FileUtils, and yet I’m downloading all commons Classes which I actually don’t need, is there a way to say to maven download just FileUtils class? Not whole commons like from dependency below

<dependency>
   <groupId>commons-io</groupId>
   <artifactId>commons-io</artifactId>
   <version>1.4</version>
</dependency>
  • 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-16T04:46:22+00:00Added an answer on May 16, 2026 at 4:46 am

    is there a way to say to maven download just FileUtils class?

    No. But depending on your exact use case, you could maybe use the Maven Shade Plugin to create an uber-jar and filter the content of the included dependencies:

    Selecting Contents for Uber JAR

    …

    For fine-grained control of which
    classes from the selected dependencies
    are included, artifact filters can be
    used:

    <project>
      ... 
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.3.3</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <filters>
                    <filter>
                      <artifact>junit:junit</artifact>
                      <includes>
                        <include>junit/framework/**</include>
                        <include>org/junit/**</include>
                      </includes>
                      <excludes>
                        <exclude>org/junit/experimental/**</exclude>
                        <exclude>org/junit/runners/**</exclude>
                      </excludes>
                    </filter>
                    <filter>
                      <artifact>*:*</artifact>
                      <excludes>
                        <exclude>META-INF/*.SF</exclude>
                        <exclude>META-INF/*.DSA</exclude>
                        <exclude>META-INF/*.RSA</exclude>
                      </excludes>
                    </filter>
                  </filters>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      ...
    </project>
    

    Here, Ant-like patterns are used to
    specify that from the dependency
    junit:junit only certain
    classes/resources should be included
    in the uber JAR. The second filter
    demonstrates the use of wildcards for
    the artifact identity which was
    introduced in plugin version 1.3. It
    excludes all signature related files
    from every artifact, regardless of its
    group or artifact id.

    But note that FileUtils depends on other classes:

    import org.apache.commons.io.filefilter.DirectoryFileFilter;
    import org.apache.commons.io.filefilter.FalseFileFilter;
    import org.apache.commons.io.filefilter.FileFilterUtils;
    import org.apache.commons.io.filefilter.IOFileFilter;
    import org.apache.commons.io.filefilter.SuffixFileFilter; // depends on org.apache.commons.io.IOCase
    import org.apache.commons.io.filefilter.TrueFileFilter;
    import org.apache.commons.io.output.NullOutputStream;
    

    That you’ll obviously need to include too.

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

Sidebar

Related Questions

(ns db-example (:use [clojure.contrib.sql :only (with-connection with-query-results)] ) (:import (java.sql DriverManager))) ;; need this
I am in need to use This Class to server multiple files (img/video/mp3) from
I have a use case where I only need to store certain fields to
I use huge data files, sometimes I only need to know the number of
Quick version of my question: Is the only time you need to use lock
Background We need to develop a specialised CMS (internal use only) to support a
I need to get only 1 record from sql result. we use SELECT TOP
I only need a table to show 3 rows which get top 3 selling
This is WebKit browsers specific (meaning that I only need to make it work
I only need to download the first few kilobytes of a file via HTTP.

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.