You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Tim Moloney <ti...@gmail.com> on 2015/04/14 21:48:02 UTC

Help using Gradle to create a custom Karaf assembly

Has anyone created a Gradle build script to create a custom Karaf assembly?

I work on project whose application is developed on a network with Internet
access, but runs on a standalone computer (no Internet access).  We
currently create a custom Karaf assembly using Maven and then install the
assembly on the the standalone computer.  The project has to move its
development environment to a network without any Internet access.  Running
Maven on this isolated network
is problematic, so we are switching to Gradle.  We have successfully built
and tested the individual modules that go into the custom Karaf assembly.
However, we are having trouble creating a Gradle build script that creates
the custom Karaf assembly.  The specific problems that we are having are:

   - identifying dependencies and copying them to the system directory
   - identifying the three Karaf library jar files and copying them to the
   lib directory
   - creating a feature file as a separate artifact
   - creating a jar file that only contains resources (for branding)

I was hoping that someone had some experience that could provide some
insight and be able to answer questions.

I've attatched the pom.xml that we are currently using with Maven so that
it is clear what we need to do in Gradle.

Thanks,
Tim

Re: Help using Gradle to create a custom Karaf assembly

Posted by Tim Moloney <ti...@gmail.com>.
I neglected to mention how the dependencies were managed.  Gradle
understands both Maven and Ivy repositories.  I've hand-crafted an Ivy
repository for initial use, but we will eventually have a Nexus repository
on the isolated network.  The Nexus repository will have all of the
third-party dependencies and be a place where we can deploy our locally
generated modules.

What I was looking for was a way to specify what the dependencies are, then
use a Gradle equivalent of maven-dependency-plugin to retrieve the
dependencies from Nexus and stage them for the assembly.  I just don't know
what that Gradle equivalent is.

Thanks,
Tim

On Tue, Apr 14, 2015 at 3:54 PM, Jamie G. <ja...@gmail.com> wrote:

> Hi Tim,
>
> My initial thoughts is to build a Kar then deploy that to the machine
> with out internet access. Would it be possible for you to build an
> offline Maven repo of artifacts for your build environment?
>
> See Cave:
> https://karaf.apache.org/index/subprojects/cave.html
>
> Or use the Karaf-Maven-Plugin to build a repo:
>
> http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin-features-add-to-repository.html
>
>
> I'm not familiar enough with Gradle to offer advice as an alternative
> to Maven build :(
> Let's see if some other community members know.
>
> Cheers,
> Jamie
>
> On Tue, Apr 14, 2015 at 5:18 PM, Tim Moloney <ti...@gmail.com>
> wrote:
> > Has anyone created a Gradle build script to create a custom Karaf
> assembly?
> >
> > I work on project whose application is developed on a network with
> Internet
> > access, but runs on a standalone computer (no Internet access).  We
> > currently create a custom Karaf assembly using Maven and then install the
> > assembly on the the standalone computer.  The project has to move its
> > development environment to a network without any Internet access.
> Running
> > Maven on this isolated network
> > is problematic, so we are switching to Gradle.  We have successfully
> built
> > and tested the individual modules that go into the custom Karaf assembly.
> > However, we are having trouble creating a Gradle build script that
> creates
> > the custom Karaf assembly.  The specific problems that we are having are:
> >
> > identifying dependencies and copying them to the system directory
> > identifying the three Karaf library jar files and copying them to the lib
> > directory
> > creating a feature file as a separate artifact
> > creating a jar file that only contains resources (for branding)
> >
> > I was hoping that someone had some experience that could provide some
> > insight and be able to answer questions.
> >
> > I've attatched the pom.xml that we are currently using with Maven so
> that it
> > is clear what we need to do in Gradle.
> >
> > Thanks,
> > Tim
> >
>

Re: Help using Gradle to create a custom Karaf assembly

Posted by "Jamie G." <ja...@gmail.com>.
Hi Tim,

My initial thoughts is to build a Kar then deploy that to the machine
with out internet access. Would it be possible for you to build an
offline Maven repo of artifacts for your build environment?

See Cave:
https://karaf.apache.org/index/subprojects/cave.html

Or use the Karaf-Maven-Plugin to build a repo:
http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin-features-add-to-repository.html


I'm not familiar enough with Gradle to offer advice as an alternative
to Maven build :(
Let's see if some other community members know.

Cheers,
Jamie

On Tue, Apr 14, 2015 at 5:18 PM, Tim Moloney <ti...@gmail.com> wrote:
> Has anyone created a Gradle build script to create a custom Karaf assembly?
>
> I work on project whose application is developed on a network with Internet
> access, but runs on a standalone computer (no Internet access).  We
> currently create a custom Karaf assembly using Maven and then install the
> assembly on the the standalone computer.  The project has to move its
> development environment to a network without any Internet access.  Running
> Maven on this isolated network
> is problematic, so we are switching to Gradle.  We have successfully built
> and tested the individual modules that go into the custom Karaf assembly.
> However, we are having trouble creating a Gradle build script that creates
> the custom Karaf assembly.  The specific problems that we are having are:
>
> identifying dependencies and copying them to the system directory
> identifying the three Karaf library jar files and copying them to the lib
> directory
> creating a feature file as a separate artifact
> creating a jar file that only contains resources (for branding)
>
> I was hoping that someone had some experience that could provide some
> insight and be able to answer questions.
>
> I've attatched the pom.xml that we are currently using with Maven so that it
> is clear what we need to do in Gradle.
>
> Thanks,
> Tim
>