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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:23:15+00:00 2026-06-08T10:23:15+00:00

I would like to know how to run JarJar with Ant, passing the rules

  • 0

I would like to know how to run JarJar with Ant, passing the rules in with an external Rules file.


1) I know I can pass the rules in one by one as below:

    <jarjar destfile="B.jar" >
        <zipfileset src="A.jar" />

        <rule pattern="com.a.**" result="test.b.@1" />
    </jarjar>

2) I know I can pass the rules in a file if I run it from the command line:

    java -jar jarjar.jar process <rulesFile> <inJar> <outJar>

3) I can use the above command line in an Ant <exec> task. (best workaround)

4) I found some reference to using a <rulesFile> tag in Maven.


The above options are not ideal for what I would like to do.

I want to run JarJar from an Ant task, passing in a rules file.

  • 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-08T10:23:17+00:00Added an answer on June 8, 2026 at 10:23 am

    I have been unable to get any information about this, from any forum, or by mailing the developers of JarJar, so I have decided to answer this question with a workaround that I am using:

    • Use the DOCTYPE & ENTITY xml entities (as per suggestion on Ant website)

    As an example, the below build.xml file includes the contents of another test.txt file inline. I import the text file using the tag include_this (this is my name – you can use any name here):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE project [
        <!ENTITY include_this SYSTEM "test.txt">
    ]>
    
    <project name="Test" default="build" >
    
        <target name="build" >
            &include_this;
        </target>
    
    </project>
    

    In this simple example, the contents of the test.txt file is:

    <echo>This is a test.</echo>
    

    So I’ve been using this workaround to replace the rules in the jarjar call. Putting the rules in the test.txt file:

    <rule pattern="com.**" result="${project.output}.com.@1" />
    <rule pattern="org.**" result="${project.output}.org.@1" />
    

    My jarjar call then becomes:

    <!-- jarjar uses the same syntax as the jar task -->
    <jarjar destfile="${jarjar.output.dir}/${project.output}.jar" >
        <!-- source files -->
        <zipfileset src="${jar.output.dir}/${project.output}.jar" />
    
        <!-- refactoring rules -->
        &include_this;
    </jarjar>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how to run a file like this: Search-Mailbox -Identity
I would like to know how I can run linux command to mount /
I would like to know the difference? I can run both and they install
I would like to know if I can run a request like that: INSERT
I would like to know how you would run a stored procedure from a
i would like know some reference. I know i can googling it. but prefer
I would like to know, how can we change the SRC url for IFRAME
I would like to know how I can verify a user's credential against an
I would like to know if I can get a list of popups opened
I would like to know how can I start a crawler based on Scrapy.

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.