Results 1 to 5 of 5
  1. #1
    superman is offline Member
    Join Date
    Jul 2015
    Posts
    2
    Rep Power
    0

    Default Creating RPM from java code

    Hey,
    I want to create a RPM package (or any other installation package for fedora like OS which install all files and run launch application right after installation), from my Java project.
    Is there any addon which integrates with Eclipse and Maven that I can use?
    I want something that can update the RPM automatically for each new build.

    Thanks!

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Creating RPM from java code

    RPM is too platform specific, Java is platform independent. You won't find much interest of integrating these kind of things.

    But that's why Maven exists to begin with: so you can automate build and packaging tasks.

    https://rombertw.wordpress.com/2010/...tions-as-rpms/
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,983
    Rep Power
    8

    Default Re: Creating RPM from java code

    There is a RPM plugin for Maven. Don't know how up to date it is. It's hosted at SourceForge, that probably means that it's 1) old, 2) bad and 3) injected with bloatware by SF itself.

    RPM Plugin - Maven RPM Plug-in Goals

    Edit: also this:
    https://rombertw.wordpress.com/2010/...tions-as-rpms/
    Tim Perry | Blog
    RPM Maven Plugin ? Introduction
    Package a Maven application in RPM | CyberMega
    Last edited by SurfMan; 07-22-2015 at 03:36 PM.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  4. #4
    superman is offline Member
    Join Date
    Jul 2015
    Posts
    2
    Rep Power
    0

    Default Re: Creating RPM from java code

    SurfMan, I just looked at the Last published date of that plugin to understand that no good will come of this. :)
    However, the second link which also gimbal2 brought, looks interesting.
    Did someone here try this before on Windows?
    I installed cygwin on my machine but still no luck...
    Got this error:
    [ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.0.1:rpm (default) on project Snitcher: RPM build execution returned: '1' executing 'cmd.exe /X /C "rpmbuild -bb --buildroot C:\HG-Dev\apt\server\Snitcher\target\rpm\Snitcher\buildr oot --define "_topdir C:\HG-Dev\apt\server\Snitcher\target\rpm\Snitcher" --target "noarch-unknown-windows 7" Snitcher.spec"' -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.0.1:rpm (default) on project Snitcher: RPM build execution returned: '1' executing 'cmd.exe /X /C "rpmbuild -bb --buildroot C:\HG-Dev\apt\server\Snitcher\target\rpm\Snitcher\buildr oot --define "_topdir C:\HG-Dev\apt\server\Snitcher\target\rpm\Snitcher" --target "noarch-unknown-windows 7" Snitcher.spec"'
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModul eBuilder.buildProject(LifecycleModuleBuilder.java: 108)
    at org.apache.maven.lifecycle.internal.LifecycleModul eBuilder.buildProject(LifecycleModuleBuilder.java: 76)
    at org.apache.maven.lifecycle.internal.builder.single threaded.SingleThreadedBuilder.build(SingleThreade dBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStart er.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.jav a:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java :213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:1 57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher. launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher. launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher. mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher. main(Launcher.java:356)
    Caused by: org.apache.maven.plugin.MojoExecutionException: RPM build execution returned: '1' executing 'cmd.exe /X /C "rpmbuild -bb --buildroot C:\HG-Dev\apt\server\Snitcher\target\rpm\Snitcher\buildr oot --define "_topdir C:\HG-Dev\apt\server\Snitcher\target\rpm\Snitcher" --target "noarch-unknown-windows 7" Snitcher.spec"'

    Thanks!

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Creating RPM from java code

    Well what happens when you invoke the command directly without Maven doing it for you? As you can see it is simply invoking the windows commandline interpreter, so you can just invoke that exact command yourself and see what it outputs. Hopefully: an error message.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 1
    Last Post: 01-27-2014, 06:57 PM
  2. Help with creating a code about Java files
    By incxx in forum New To Java
    Replies: 2
    Last Post: 03-28-2013, 01:30 AM
  3. Creating a java gui to create xml code
    By Jman in forum New To Java
    Replies: 3
    Last Post: 04-27-2008, 06:56 PM
  4. Replies: 8
    Last Post: 01-07-2008, 05:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •