Last updated
on 22-11-2012
at 12:00 AM

Blog

As part of my work on my JS-Test-Runner, I’ve been setting up Maven to do all my packaging for me. Deb packaging was relatively straight-forward (using the jDeb maven plugin), and happily builds on my Linux CI box and the my home Windows dev machine, but building RPMs requires a little more hackery.

The main issue is that rather than building it from scratch, as the jdeb plugin does, it uses rpmbuild directly. This unsurprisingly doesn’t exist on Windows! Your options are to hide this step under a profile and not execute it on Windows, or to install Cygwin and work from there. I went for option B:

  1. Configure RPM building in your pom (see mine for an example)
  2. Download cygwin
  3. Run the installer, and select rpm and rpm-build as packages that you’d like to have installed.
  4. Add your Cygwin bin folder (e.g. C:\cygwin\bin) to your PATH
  5. Rename the ‘system file’ (actually a symlink) at cygwin\bin\rpmbuild to cygwin\bin\rpmb
  6. Copy the script provided in this bug ticket comment to a new batch file called ‘rpmbuild.bat’ in your PATH, e.g. C:\cygwin\bin\rpmbuild.bat
  7. Make a small tweak to that file, changing the ‘rpmbuild’ at the start of the last line to ‘rpmb’

Some troubleshooting notes:

With this, I can now build JS-Test-Runner locally on my Windows box, no problemo; feel free to check out that code and try a local ‘mvn package’ to test your machine setup. RPMs will appear in [project]/target/rm/[project name]/RPMS/noarch, by default.

Many thanks for the core elements of this go to the gentlemen (or ladies) of MRPM-4, a bug ticket in the maven RPM plugin covered in comments looking at ways of doiing this. The slight tweaks to their approach are to better deal with paths, as what I could decipher from the discussion on that ticket didn’t quite hit the spot.

  1. Sid Psyko at 11:35AM on 28/08/2013

    Ping back from: http://sidpsyko.blogspot.com/2013/08/another-word-on-using-rpm-maven-plugin.html

  2. Ranjana at 08:42PM on 15/10/2013

    Hiya, I tried your approach. However, rpm build is still failing with this warning:
    [INFO] C:\Users\eranagg\git\BaseConnectivityInfoFlow\ERICbaseconnectivityinfoflowmodel_CXP9030578\target\rpm\ERICbaseconnectivityinfoflowmodel_CXP9030578\SPECS>bash c "rpmb -bb —buildroot /cygdrive/c/Users/eranagg/git/BaseConnectivityInfoFlow/ERICbaseconnectivityinfoflowmodel_CXP9030578/target/rpm/ERICbaseconnectivityinfoflowmodel_CXP9030578/buildroot —define ""_topdir /cygdrive/c/Users/eranagg/git/BaseConnectivityInfoFlow/ERICbaseconnectivityinfoflowmodel_CXP9030578/target/rpm/ERICbaseconnectivityinfoflowmodel_CXP9030578"" —target ""noarch-pc-windows 7"" —define ""_build_name_fmt %{ARCH}/%{NAME}%{VERSION}-%{RELEASE}.%{ARCH}.rpm"" ERICbaseconnectivityinfoflowmodel_CXP9030578.spec"
    [WARNING] error: Target buffer overflow
    [INFO] Building target platforms: noarch-pc-windows 7
    [INFO] Building for target noarch-pc-windows 7
    [INFO] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.47645
    [WARNING] + umask 022
    [WARNING] + cd /cygdrive/c/Users/eranagg/git/Bif ‘[’ -e /cygdrive/c/Users/eranagg/git/BaseConnectivityInfoFlow/ERICbaseconnectivityinfoflowmodel_CXP9030578/target/rpm/ERICbaseconnectivityinfoflowmodel_CXP9030578/buildroot ‘]’
    [WARNING] /var/tmp/rpm-tmp.47645: line 20: cd: /cygdrive/c/Users/eranagg/git/Bif: No such file or directory
    [WARNING] error: Bad exit status from /var/tmp/rpm-tmp.47645 (%install)
    [WARNING] Target buffer overflow
    [WARNING] Bad exit status from /var/tmp/rpm-tmp.47645 (%install)
    [INFO]
    [INFO]
    [INFO] RPM build errors:

    Can you please suggest if tehre is anyway I can increase buffer size or if there is any alternative to this.

    Thanks
    Ranjana

  3. Smithd732 at 07:33PM on 05/05/2014

    There is numerous separate years Los angeles Weight reduction eating plan with each a person can be a necessity. The pioneer part can be your original obtaining rid of belonging towards the extra pounds. la weight loss dkgckgkdfkbeegeg

  4. Pharmd702 at 07:33PM on 05/05/2014

    Very nice site! <a href="http://oixapey2.com/rqsqs/1.html">cheap goods</a>

  5. Pharmb378 at 07:33PM on 05/05/2014

    Very nice site! [url=http://oixapey2.com/rqsqs/2.html]cheap goods[/url]

  6. Pharme660 at 07:33PM on 05/05/2014

    Very nice site! cheap goods http://oixapey2.com/rqsqs/4.html

  7. Pharmk416 at 07:33PM on 05/05/2014

    Very nice site!

  8. Pharma878 at 08:27PM on 07/05/2014

    Very nice site! <a href="http://apxoiey2.com/qovot/1.html">cheap goods</a>

  9. Pharmg176 at 08:27PM on 07/05/2014

    Very nice site! [url=http://apxoiey2.com/qovot/2.html]cheap goods[/url]

  10. Pharmd577 at 08:27PM on 07/05/2014

    Very nice site! cheap goods http://apxoiey2.com/qovot/4.html

  11. Pharmg246 at 08:41PM on 08/05/2014

    Very nice site! <a href="http://apeoixy2.com/xqqsq/1.html">cheap goods</a>

  12. Pharmd841 at 08:41PM on 08/05/2014

    Very nice site! [url=http://apeoixy2.com/xqqsq/2.html]cheap goods[/url]

  13. Pharme26 at 08:41PM on 08/05/2014

    Very nice site! cheap goods http://apeoixy2.com/xqqsq/4.html

  14. Pharmg653 at 08:41PM on 08/05/2014

    Very nice site!

  15. Pharmd603 at 08:57PM on 09/05/2014

    Very nice site! [url=http://oieypxa2.com/kyaokk/2.html]cheap goods[/url]

  16. Pharma579 at 08:57PM on 09/05/2014

    Very nice site! cheap goods http://oieypxa2.com/kyaokk/4.html

  17. Pharmd821 at 08:57PM on 09/05/2014

    Very nice site!

  18. Pharmd578 at 09:31PM on 10/05/2014

    Very nice site! <a href="http://opeyixa2.com/qovqyo/1.html">cheap goods</a>

  19. Pharmd727 at 09:31PM on 10/05/2014

    Very nice site! cheap goods http://opeyixa2.com/qovqyo/4.html

  20. Pharme680 at 09:31PM on 10/05/2014

    Very nice site!

  21. Pharmd526 at 10:07PM on 12/05/2014

    Very nice site! <a href="http://ypxoiea2.com/qyaokq/1.html">cheap goods</a>

  22. Pharme598 at 10:07PM on 12/05/2014

    Very nice site! [url=http://ypxoiea2.com/qyaokq/2.html]cheap goods[/url]

  23. Pharmf312 at 10:07PM on 12/05/2014

    Very nice site! cheap goods http://ypxoiea2.com/qyaokq/4.html

  24. Pharmd236 at 10:07PM on 12/05/2014

    Very nice site!

  25. Pharmb519 at 11:39PM on 16/05/2014

    Very nice site! <a href="http://aieypxo2.com/tovqys/1.html">cheap goods</a>

  26. Pharmg9 at 11:39PM on 16/05/2014

    Very nice site! [url=http://aieypxo2.com/tovqys/2.html]cheap goods[/url]

  27. Pharmd172 at 11:39PM on 16/05/2014

    Very nice site! cheap goods http://aieypxo2.com/tovqys/4.html

  28. Pharmb402 at 11:39PM on 16/05/2014

    Very nice site!

  29. Pharmd345 at 11:39PM on 16/05/2014

    Very nice site! <a href="http://aieypxo2.com/tovqys/1.html">cheap goods</a>

  30. Pharmd87 at 11:39PM on 16/05/2014

    Very nice site! [url=http://aieypxo2.com/tovqys/2.html]cheap goods[/url]

  31. Pharmf19 at 11:39PM on 16/05/2014

    Very nice site! cheap goods http://aieypxo2.com/tovqys/4.html

  32. Pharmd397 at 11:39PM on 16/05/2014

    Very nice site!

  33. Pharmb246 at 11:39PM on 16/05/2014

    Very nice site! <a href="http://aieypxo2.com/tovqys/1.html">cheap goods</a>

  34. Pharme554 at 11:39PM on 16/05/2014

    Very nice site! [url=http://aieypxo2.com/tovqys/2.html]cheap goods[/url]

  35. Pharmb392 at 11:39PM on 16/05/2014

    Very nice site! cheap goods http://aieypxo2.com/tovqys/4.html

  36. Pharmg159 at 11:39PM on 16/05/2014

    Very nice site!

  37. Charles B at 08:05AM on 25/08/2014

    I tried this and didn’t get a failure but the rpm wasn’t generated either.
    with mvn rpm:rpm i get
    [DEBUG] RPM not added as an artifact because project’s packaging type is not ‘rpm’
    with mvn rpm:attached-rpm i get
    [DEBUG] Adding RPM as attached artifact with ‘rpm’ classifier: C:\workspace\test\target\rpm\test\RPMS\noarch\test-0.0.1-SNAPSHOT20140825190824.noarch.rpm

  38. no guarantor loans at 05:33PM on 12/01/2015

    Hello!
    We’ve got all types of loans to the UK will meet your every need, we hope!
    3 month loans, 3 month payday loans, 6 month loans, no guarantor loans, payday loans no guarantor,

    http://3-6monthpaydayloansnoguarantor.co.uk/

  39. mohammed at 05:20AM on 11/02/2015

    Do you need a Loan?
    Are you looking for Finance?
    Are you looking for a Loan to enlarge your business?
    I think you have come to the right place.
    We offer Loans at low interest rate.
    Interested people should please contact us on
    For immediate response to your application, Kindly
    reply to this emails below only:
    mohamendloanservice@gmail.com

    Please, do provide us with the Following information if interested.
    LOAN APPLICATION INFORMATION FORM
    First name:
    Middle name:
    Date of birth (yyyy-mm-dd):
    Gender:
    Marital status:
    Total Amount Needed:
    Time Duration:
    Address:
    City:
    State/province:
    Zip/postal code:
    Country:
    Phone:
    Mobile/cellular:
    Monthly Income:
    Occupation:
    Which sites did you know about us…..
    mohamendloanservice@gmail.com

    http://mohammedloanserviceplc.gnbo.com.ng

  40. Francois Savard at 05:20AM on 11/02/2015

    Thanks for this.

    In my case I found I needed to modify the batch file to avoid a bunch of warnings of the type “Installed (but unpackaged) file(s) found”. The RPM was built by Maven anyway, but it’s annoying.

    I simply added those lines that replace backslashes on %attr lines:

    SET OLD_PATH=%TOPDIR:\=\\%
    SET NEW_PATH=%NEW_TOPDIR:/=\/%
    sed -s -i -e "/%attr(/ “/%attr(/ s/\\\\/\\//g” %8

    I added them after the other sed command.

  41. Mohamend at 07:21AM on 17/02/2015

    Do you need a Loan?
    Are you looking for Finance?
    Are you looking for a Loan to enlarge your business?
    I think you have come to the right place.
    We offer Loans at low interest rate.
    Interested people should please contact us on
    For immediate response to your application, Kindly
    reply to this emails below only:
    mohamendfinance@gmail.com

    Please, do provide us with the Following information if interested.
    LOAN APPLICATION INFORMATION FORM
    First name:
    Middle name:
    Date of birth (yyyy-mm-dd):
    Gender:
    Marital status:
    Total Amount Needed:
    Time Duration:
    Address:
    City:
    State/province:
    Zip/postal code:
    Country:
    Phone:
    Mobile/cellular:
    Monthly Income:
    Occupation:
    Which sites did you know about us…..
    mohamendfinance@gmail.com

  42. marsha at 07:55AM on 18/02/2015

    I am a private loan lender which have all take to be a genuine lender i give out the best loan to my client at a very convenient rate.The interest rate of this loan is 3%.i give out loan to public and private individuals.the maximum amount i give out in this loan is $1,000,000.00 USD why the minimum amount i give out is 5000.for more information contact us email honestloan10@gmail.com
    Your Full Details:
    Full Name :………
    Country :………….
    state:………….
    Sex :………….
    Address…………
    Tel :………….
    Occupation :……..
    Amount Required :…………
    Purpose of the Loan :……..
    Loan Duration :…………
    Phone Number :………
    Contact email:honestloan10@gmail.com

  43. creationfinance00@gmail.com at 08:52AM on 20/02/2015

    Dear Sir/Madam, We give out loans to business people and individuals
    for just 3% interest rate. “BELIEVE IT OR NOT YOU CAN GET YOUR LOANS
    IN LESS THAN AN HOUR”. We can give out loans ranging from US$3,000 up
    to US$500,000. We give out local and international loans to any
    individual/company all over the world and your rate will not change
    during your loan repayment! Our Personal Loans can help make dreams
    possible especially with the present financial crunch in the world at
    large. We do not require much documents if you are interested in
    getting a loan.To apply contact us via the email address below
    Email:(creationfinance00@gmail.com) with the information below:

    Please, do provide us with the Following information if interested.
    LOAN APPLICATION INFORMATION FORM
    First name:
    Middle name:
    Date of birth (yyyy-mm-dd):
    Gender:
    Marital status:
    Total Amount Needed:
    Time Duration:
    Address:
    City:
    State/province:
    Zip/postal code:
    Country:
    Phone:
    Mobile/cellular:
    Monthly Income:
    Occupation:
    Which sites did you know about us…..
    creationfinance00@gmail.com

  44. creationfinance00@gmail.com at 08:52AM on 20/02/2015

    Do you need a Loan?
    Are you looking for Finance?
    Are you looking for a Loan to enlarge your business?
    I think you have come to the right place.
    We offer Loans at low interest rate.
    Interested people should please contact us on
    For immediate response to your application, Kindly
    reply to this emails below only:
    creationfinance00@gmail.com

    Please, do provide us with the Following information if interested.
    LOAN APPLICATION INFORMATION FORM
    First name:
    Middle name:
    Date of birth (yyyy-mm-dd):
    Gender:
    Marital status:
    Total Amount Needed:
    Time Duration:
    Address:
    City:
    State/province:
    Zip/postal code:
    Country:
    Phone:
    Mobile/cellular:
    Monthly Income:
    Occupation:
    Which sites did you know about us…..
    creationfinance00@gmail.com

  45. Purva Sharegistry at 10:56AM on 10/03/2015

    I am anne from usa, i received my loan of $48,000 in my account on 9-3-2015 from Purva Firm, and i promised to advertise their Firm to all loan seekers round the world, contact them now email: urgentloan22@gmail.com

  46. Mr John at 02:43AM on 12/03/2015

    Do you need a quick long or short term loan with a relatively low interest rate as low as 3%? We offer business loan, personal loan, home loan, auto loan,student loan, debt consolidation loan e.t.c. no matter your credit score. We are guaranteed in giving out financial services to our numerous clients all over world. With our flexible lending packages, loans can be processed and transferred to the borrower within the shortest time possible, contact our specialist for advice and finance planning. If you need a quick loan contact us via Email: mrjohnwilliams537@gmail.com

  47. Susan williams at 11:13AM on 28/03/2015

    Good day Sir/Madam,

    This is Central Trust Micro Financial Service International. . We are a reputable, legitimate & Registered Company. Approved by the United kingdom (UK) and South Africa Government to assist people with loan financial assistance local and international at this particular new month of January 2015,we are also part of the finance company and money rendering firm. We help in encouraging and act as facilitator to reduce your financial stresses at a very encouraging rate. We give out Loans to individuals and cor-operate body in need of financial assistance at ones convenience with a reasonable interest of 4.9% Do you have a bad credit or you are in need of money to pay bills? if you are desperately in need of our assistance then you will have to read carefully the company loan application form that is attached to this message then fill and get back to us if you are satisfy with it so we can proceed on your transaction. We await for your quick response.

    Services Rendered include:

    Refinance
    Home Improvement
    Inventor Loans
    Auto Loans
    Debt Consolidation
    Line of Credit
    Second Mortgage
    Business Loans
    Personal Loans
    International Loans
    Best secured loan
    Cash Loan
    Low cost Loan
    Internet Loan
    Cheap Loan Rate
    Lifestyle Loan
    Joint Loan
    Equity Loan
    Small Loan
    Direct
    Finance Loan Money
    Home Owner Loan
    Bank Loan

    Whatever your financial requirement are, A Loan from Central Trust Micro Financial Service will always help. No social security and no credit check, 100% Guaranteed. We Look forward permitting us to be of service to you. Sincerely, We await your Quick Respond. Central Trust is a trading style of Central Trust Micro Financial Limited. Central Trust Limited: Cassiobury House, 11-19 Station Road, Watford, Hertfordshire, WD17 1AP. Registered Office: St Crispin’s House, Duke Street, Norwich, Norfolk, NR3 1PD. Registered in England: 07020381, VAT number 765353512 Authorized and Regulated by the Financial Conduct Authority under number 631303, You should kindly contact us via our Email address Centraltrust.uk.za@inbox.lv or Centraltrust_consultant.uk.za@outlook.com, We await your respond to help you solve your financial problems….

  48. Jason Rappaport. at 12:11PM on 31/03/2015

    AFFORDABLE LOAN NOW AVAILABLE @ ICC Mortgage And financial Services, Is a sincere and certified private Loan

    company approved by the Government, we give out international and local loans to all countries in the

    world,Amount given out $2,500 $100,000,000 Dollars, Euro and Pounds.We offer loans with a dependable

    guarantee all of our clients. Our loan interest rates are very low and affordable with and

    duration.Available now MORTGAGE, PERSONAL, TRAVEL, STUDENT, EXPANSION OF BUSINESS AND NEW UNSECURED, SECURE,
    Consolidate Apply for a loan today with your loan amount and duration, Its Easy and fast to get. 3% interest

    rates and monthly installment payments.

    Regards. Jason Rappaport.(Email) appraisalsiccmortgage@gmail.com
    Office address:1600 Stewart Ave, Suite 404 Westbury, NY 11590

  49. CAHYA GOUTAM at 06:46PM on 24/04/2015

    I am CAHYA GOUTAM an i live in UK. I wanted a loan badly to start a
    business of my own because I realize working for other people makes the
    owner of the business richer, I came across a post on a site were i can get
    a loan without any collateral or credit card. To cut the long story short i
    applied for the loan and i the company was able to give me a loan of
    $50,000 to start my business and now my business is growing well and have
    been able to pay half of the loan within the space of 2 years. My friends i
    decided to share this testimony with everyone if you want any type of loan
    please contact JULIA NAVARO at navaroloancompany@yahoo.com, am very
    positive he will be willing to help.

  50. CAHYA GOUTAM at 06:46PM on 24/04/2015

    I am CAHYA GOUTAM an i live in UK. I wanted a loan badly to start a
    business of my own because I realize working for other people makes the
    owner of the business richer, I came across a post on a site were i can get
    a loan without any collateral or credit card. To cut the long story short i
    applied for the loan and i the company was able to give me a loan of
    $50,000 to start my business and now my business is growing well and have
    been able to pay half of the loan within the space of 2 years. My friends i
    decided to share this testimony with everyone if you want any type of loan
    please contact JULIA NAVARO at navaroloancompany@yahoo.com, am very
    positive he will be willing to help.

  51. marsha at 07:29PM on 26/04/2015

    I am a private loan lender which have all take to be a genuine lender i give out the best loan to my client at a very convenient rate.The interest rate of this loan is 3%.i give out loan to public and private individuals.the maximum amount i give out in this loan is $1,000,000.00 USD why the minimum amount i give out is 5000.for more information contact us email honestloan10@gmail.com
    Your Full Details:
    Full Name :………
    Country :………….
    state:………….
    Sex :………….
    Address…………
    Tel :………….
    Occupation :……..
    Amount Required :…………
    Purpose of the Loan :……..
    Loan Duration :…………
    Phone Number :………
    Contact email:honestloan10@gmail.com

  52. marsha at 07:29PM on 26/04/2015

    Are You In Need Of A Private Or Business Loans At 2% Rate For Various Purposes? If Yes; Contact us with this details below take note we give out from $20,000.00USD to 10million USD
    Full Name:
    Amount Needed:
    Duration:
    Country
    Cell No:
    Sex:
    contact us via email fasterloanservice@gmail.com
    Best Regards
    Mr.Marsha Goodman

  53. Scot Licon at 11:18PM on 03/05/2015

    Hello

    We offer private, commercial and personal loans rates
    a very low percentage of only 2.34% in one year to 32 years
    amortization anywhere in the world. We offer loans ranging
    from $ 500 to US $ 100 000 000.
    Our loans are well insured for maximum security is
    our top priority. Are you losing sleep at nights worrying how
    get a legitimate loan lender? reliable contact
    Personal loans (confidence) is now specialists
    help stop bad credit loans
    find a solution that victory is our mission.
    E-mail: scotlicon@gmail.com

  54. helpingtogetlove@gmail.com at 11:18PM on 03/05/2015

    Do you believe inLove Spells Relationship spells and
    Sorceries from Antiquity Love spells???

    If you dont please dont inbox me

    If you want or need to get your lover back,
    Reuniting lovers,
    Make him or her love and want you.
    Rekindle a fading romance.
    Find your soul mate.
    Draw a new love into your life.
    Win a persons heart.
    Attract love for a gay male.
    Attract a lover,
    Get romantic attention from the opposite sex,
    Attract women,
    Attract men,
    Get the love you desire,
    Attract love and amorous attention,
    Keep your lover faithful,
    Find love,
    Enhance sex with your partner,
    Find your one true love,
    Enhance passion,
    Draw and protect love,
    Help a woman find another woman,
    Help a female find romance,
    Attract a woman that wants to make you happy,
    Make yourself more attractive to women,
    Attract your soul mate keep your love interested and true. Renew a fading love or romance,
    Make your love last,
    Heal arguments between couples,
    Bind your lover or partner to you permanently,
    Protect against abusive relationships,
    Break up and end the relationship,
    Stop unwanted romantic advances,
    Stop a break up,
    Reconcile with your lover,
    Help heal from a broken heart. Forget old
    lovers,
    Make yourself irresistible to the opposite sex,
    Have a person think lustful erotic thoughts about you. Get the truth from your lover,
    Have your lover love only you,
    Keep her faithful,
    Enhance passion and love,
    Bring back a lover.
    Summon a lover home,
    Enhance your chances for success at love,
    Fix love and relationship-related issues,
    Help you attract wealthy men,
    Attract wealthy women,
    You can get a fully customized spell cast for your exact needs.

    If you need help, I can be reached at
    helpingtogetlove@gmail.com

    THANKS

  55. diskanke at 12:18AM on 06/05/2015

    Are you looking for Finance?
    Are you looking for Money to enlarge your business?
    I think you have come to the right place.
    We offer Cash at low interest rate.
    Interested people should please contact us on
    For immediate response to your application, Kindly
    reply to this emails below only. diskanke@hotmail.com

    Mr Mohamend Kanke
    ds.kanke@gmail.com

  56. SEEKING A LOAN, CONTACT US TODAY at 12:18AM on 06/05/2015

    I am a Private Loan Lender and a cooperate financial for real estate
    and any kinds of business financing. I also offer Loans to
    individuals, Firms and cooperate bodies We help in encouraging and act
    as facilitator to reduce your financial stresses at a very encouraging
    rate at low interest rate of 2%,Loan amount between the sum of $2 to
    $1 Million Dollars. contact us via E-mail: diskanke@hotmail.com

    Mr Mohamend Kanke
    ds.kanke@gmail.com