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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:45:49+00:00 2026-06-15T23:45:49+00:00

I have plugins configuration like below: <project> … <build> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.6</version> <executions>

  • 0

I have plugins configuration like below:

<project>
    ...
    <build>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration> 
                        <outputDirectory>${project.build.directory}/libs</outputDirectory>
                        <overWriteReleases>true</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>
                        <overWriteIfNewer>true</overWriteIfNewer>
                    </configuration>
                </execution>
            </executions> 
        </plugin>
        <plugin>
            <groupId>com.pyx4me</groupId>
            <artifactId>proguard-maven-plugin</artifactId>
            <version>2.1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>proguard</goal>
                    </goals>
                </execution>
            </executions>   
            <configuration>
                <proguardVersion>4.8</proguardVersion>
                <obfuscate>true</obfuscate>
                <includeDependency>true</includeDependency> 
                <injar>${project.artifactId}-${project.version}.jar</injar>
                <outjar>${project.artifactId}-${project.version}-obf.jar</outjar> 
                <outputDirectory>${project.build.directory}</outputDirectory> 
                <maxMemory>256m</maxMemory>             
                <options>
                    <option>-keepclasseswithmembers class **, !some.specific.package.** { *; }</option>
                    <option>-keep public class some.specific.package.Main { public *; public static *; }</option>
                    <option>-allowaccessmodification</option>
                    <option>-dontskipnonpubliclibraryclasses</option>
                    <option>-dontskipnonpubliclibraryclassmembers</option>
                    <option>-dontwarn org.apache.log4j.**</option>
                </options>
                <libs>
                    <lib>${java.home}/lib/rt.jar</lib>
                    <lib>${java.home}/lib/javaws.jar</lib>
                    <lib>${javafx_home}/lib/jfxrt.jar</lib>
                </libs>    
            </configuration>

            <dependencies>
                <dependency>
                    <groupId>net.sf.proguard</groupId>
                    <artifactId>proguard-base</artifactId>
                    <version>4.8</version>
                </dependency>
            </dependencies>
        </plugin>
    </build>
...
</project>

I want to obfuscate specific package some.specific.package for jar and their dependencies (before copying). Is there possible to do it?

  • 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-15T23:45:49+00:00Added an answer on June 15, 2026 at 11:45 pm

    did you try the command -keeppackagenames with negation (!) of the package you want to obfuscate? I tried teh following, with the result that just package org.neo4j.cineasts.domain was obfuscated. See below:

    <configuration>
                    <proguardVersion>4.8</proguardVersion>
                    <obfuscate>true</obfuscate>
                    <includeDependency>true</includeDependency>
                    <injar>${project.artifactId}-${project.version}.jar</injar>
                    <outjar>${project.artifactId}-${project.version}-obf.jar</outjar>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                    <maxMemory>256m</maxMemory>
                    <options>
                        <option>-keep public class org.neo4j.cineasts.controller.** { public *; public static *; }</option> 
                        <option>-keeppackagenames !org.neo4j.cineasts.domain</option>
                        <option>-allowaccessmodification</option>
                        <option>-dontskipnonpubliclibraryclasses</option>
                        <option>-dontskipnonpubliclibraryclassmembers</option>
                    </options>
                    <libs>
                        <lib>C:/devtools/Java/jdk1.6.0_29_64/jre/lib/rt.jar</lib>
                        <lib>C:/devtools/Java/jdk1.6.0_29_64/jre/lib/javaws.jar</lib>
                    </libs>
                </configuration>
    

    Bests, Michael

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

Sidebar

Related Questions

I have pom.xml with the structure like: <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5</version> <configuration> <includes>
We have the following config in our POM file: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip>
I have this configuration in my pom <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> <configuration> <excludes> <exclude>**/logging/*</exclude>
I am creating .ear using maven <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.6</version> <configuration> <finalName>wsformatter-ear</finalName> <includeLibInApplicationXml>true</includeLibInApplicationXml> <version>1.4</version>
I am using following WordPress plugin to send email. http://coffee2code.com/wp-plugins/configure-smtp/ I have done configuration,
I have a java maven project , i installed scala plugin for eclipse and
I would like to have the maven eclipse plugin regenerate my .classpath whenever a
I have a web-app with the configuration below (inherited from a parent's pluginManagement). JSPC
I have a used the maven assembly plugin to create multiple jar from one
My multi-module Maven project looks like: /foo pom.xml /foo-parent /foo-core /foo-something /src /site Pay

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.