You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Jackman <Da...@fastsearch.com> on 2005/11/01 20:09:45 UTC

Building C++ projects with Maven (2)

I've just found out that I'm going to need to expand our Maven build
process to include several C++ project (which I believe are built using
gcc).  I seem to remember seeing some traffic on this list from people
doing this sort of thing (which I promptly ignored because I wasn't at
the time).  Can anyone offer some insight on how you got this to work
and how you overcame the problems that came up?  What plugins are
available to build this way and do they do everything you need?  Are you
able to have dependencies in the Maven repository and have the build use
them from there (similar to .jar dependencies)?  How do you access the
header files, possible library, and runtime library for the different
portions of the build?  Is there a mini guide for this kind of project
in the works?
 
Thanks,
..David..

Re: Building C++ projects with Maven (2)

Posted by Roger Hoover <ro...@gmail.com>.
Right. I suspect that native artifacts will have to be delineated by both
CPU architecture and OS distribution. There's generally a tight coupling
between the binary and the compiler version and glibc version and possibly
other system libraries. So the repository would need a scheme something like
${groupId}/${artifactId}/${version}/${os}/${march}. The OS would be more
specific than just "linux". I think we would need to specify a distro family
(where major versions of systems libs are fixed) like Red Hat Enterprise
Linux 3.x, Red Hat Enterprise Linux 4.x, Suse Linux Enterprise Server 9,
Fedore Core 4, etc.

Roger

On 11/1/05, Chris Berry <ch...@gmail.com> wrote:
>
> This brings up a bigger question; How does maven want to handle OS
> information in the repo?? To be successful w/ other languages like C, the
> repo will need to delineate information such as "i586" and "linux". Are
> these to be rolled into the groupId?? That doesn't smell right. Seems that
> we may need new Artifact Resolvers that understand this sort of info
> natively and can transparently supply the the correct pieces to the URL.
>
> Cheers,
> -- Chris
>
> On 11/1/05, dan tran <da...@gmail.com> wrote:
> >
> > Hi David,
> > There is a work in progress for native-maven-plugin
> > http://svn.mojo.codehaus.org/trunk/mojo/maven-native/
> > You can build it and take a look at some doc.
> > -Dan
> >
> >
> > On 11/1/05, David Jackman <Da...@fastsearch.com> wrote:
> > >
> > > I've just found out that I'm going to need to expand our Maven build
> > > process to include several C++ project (which I believe are built
> using
> > > gcc). I seem to remember seeing some traffic on this list from people
> > > doing this sort of thing (which I promptly ignored because I wasn't at
> > > the time). Can anyone offer some insight on how you got this to work
> > > and how you overcame the problems that came up? What plugins are
> > > available to build this way and do they do everything you need? Are
> you
> > > able to have dependencies in the Maven repository and have the build
> use
> > > them from there (similar to .jar dependencies)? How do you access the
> > > header files, possible library, and runtime library for the different
> > > portions of the build? Is there a mini guide for this kind of project
> > > in the works?
> > >
> > > Thanks,
> > > ..David..
> > >
> > >
> >
> >
>
>

Re: Building C++ projects with Maven (2)

Posted by Chris Berry <ch...@gmail.com>.
I think not. Using groupId or artifactId is insufficient -- at least in it's
present form.

If I have a dependency on, say, version 1.2 of a shared library -- that
dependency is platform independent. If not, then you would have to have
different POMs for different platforms. Obviously that doesn't work and is
not what a POM is about (a holistic project recipe)

Although when I am actually building, maven needs to supply OS specifics to
grab the right stuff for my platform. For Java this is a no-op and would
thus default to noarch or nothing at all. But for languages like C, the
system must somehow transparently fill in OS info when constructing the URL.
Cheers,
-- Chris

On 11/1/05, dan tran <da...@gmail.com> wrote:
>
> You can use groupId for platform specific or add platform specific string
> to
> your artifact id.
> -D
>
>
> On 11/1/05, Chris Berry <ch...@gmail.com> wrote:
> >
> > This brings up a bigger question; How does maven want to handle OS
> > information in the repo?? To be successful w/ other languages like C,
> the
> > repo will need to delineate information such as "i586" and "linux". Are
> > these to be rolled into the groupId?? That doesn't smell right. Seems
> that
> > we may need new Artifact Resolvers that understand this sort of info
> > natively and can transparently supply the the correct pieces to the URL.
> >
> > Cheers,
> > -- Chris
> >
> > On 11/1/05, dan tran <da...@gmail.com> wrote:
> > >
> > > Hi David,
> > > There is a work in progress for native-maven-plugin
> > > http://svn.mojo.codehaus.org/trunk/mojo/maven-native/
> > > You can build it and take a look at some doc.
> > > -Dan
> > >
> > >
> > > On 11/1/05, David Jackman <Da...@fastsearch.com> wrote:
> > > >
> > > > I've just found out that I'm going to need to expand our Maven build
> > > > process to include several C++ project (which I believe are built
> > using
> > > > gcc). I seem to remember seeing some traffic on this list from
> people
> > > > doing this sort of thing (which I promptly ignored because I wasn't
> at
> >
> > > > the time). Can anyone offer some insight on how you got this to work
> > > > and how you overcame the problems that came up? What plugins are
> > > > available to build this way and do they do everything you need? Are
> > you
> > > > able to have dependencies in the Maven repository and have the build
> > use
> > > > them from there (similar to .jar dependencies)? How do you access
> the
> > > > header files, possible library, and runtime library for the
> different
> > > > portions of the build? Is there a mini guide for this kind of
> project
> > > > in the works?
> > > >
> > > > Thanks,
> > > > ..David..
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Re: Building C++ projects with Maven (2)

Posted by Roger Hoover <ro...@gmail.com>.
The concern I would have with this is that you have the same logical package
(let's say apr 1.2.2) built for different architectures needing to have a
different groupId or artifactId for each architecture type. Unless the
groupId or artifactId is constructed dynamically, poms that depend on a
native artifact have to depend on a specific architecture type. I think it
would be nice to write generic poms that depend on just the logical package
(apr 1.2.2 instead of apr 1.2.2 x86_64) and have maven sense the machine
architecture (and OS) and fetch the correct native artifact.

Roger

On 11/1/05, dan tran <da...@gmail.com> wrote:
>
> You can use groupId for platform specific or add platform specific string
> to
> your artifact id.
> -D
>
>
> On 11/1/05, Chris Berry <ch...@gmail.com> wrote:
> >
> > This brings up a bigger question; How does maven want to handle OS
> > information in the repo?? To be successful w/ other languages like C,
> the
> > repo will need to delineate information such as "i586" and "linux". Are
> > these to be rolled into the groupId?? That doesn't smell right. Seems
> that
> > we may need new Artifact Resolvers that understand this sort of info
> > natively and can transparently supply the the correct pieces to the URL.
> >
> > Cheers,
> > -- Chris
> >
> > On 11/1/05, dan tran <da...@gmail.com> wrote:
> > >
> > > Hi David,
> > > There is a work in progress for native-maven-plugin
> > > http://svn.mojo.codehaus.org/trunk/mojo/maven-native/
> > > You can build it and take a look at some doc.
> > > -Dan
> > >
> > >
> > > On 11/1/05, David Jackman <Da...@fastsearch.com> wrote:
> > > >
> > > > I've just found out that I'm going to need to expand our Maven build
> > > > process to include several C++ project (which I believe are built
> > using
> > > > gcc). I seem to remember seeing some traffic on this list from
> people
> > > > doing this sort of thing (which I promptly ignored because I wasn't
> at
> >
> > > > the time). Can anyone offer some insight on how you got this to work
> > > > and how you overcame the problems that came up? What plugins are
> > > > available to build this way and do they do everything you need? Are
> > you
> > > > able to have dependencies in the Maven repository and have the build
> > use
> > > > them from there (similar to .jar dependencies)? How do you access
> the
> > > > header files, possible library, and runtime library for the
> different
> > > > portions of the build? Is there a mini guide for this kind of
> project
> > > > in the works?
> > > >
> > > > Thanks,
> > > > ..David..
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Re: Building C++ projects with Maven (2)

Posted by dan tran <da...@gmail.com>.
You can use groupId for platform specific or add platform specific string to
your artifact id.
 -D


 On 11/1/05, Chris Berry <ch...@gmail.com> wrote:
>
> This brings up a bigger question; How does maven want to handle OS
> information in the repo?? To be successful w/ other languages like C, the
> repo will need to delineate information such as "i586" and "linux". Are
> these to be rolled into the groupId?? That doesn't smell right. Seems that
> we may need new Artifact Resolvers that understand this sort of info
> natively and can transparently supply the the correct pieces to the URL.
>
> Cheers,
> -- Chris
>
> On 11/1/05, dan tran <da...@gmail.com> wrote:
> >
> > Hi David,
> > There is a work in progress for native-maven-plugin
> > http://svn.mojo.codehaus.org/trunk/mojo/maven-native/
> > You can build it and take a look at some doc.
> > -Dan
> >
> >
> > On 11/1/05, David Jackman <Da...@fastsearch.com> wrote:
> > >
> > > I've just found out that I'm going to need to expand our Maven build
> > > process to include several C++ project (which I believe are built
> using
> > > gcc). I seem to remember seeing some traffic on this list from people
> > > doing this sort of thing (which I promptly ignored because I wasn't at
>
> > > the time). Can anyone offer some insight on how you got this to work
> > > and how you overcame the problems that came up? What plugins are
> > > available to build this way and do they do everything you need? Are
> you
> > > able to have dependencies in the Maven repository and have the build
> use
> > > them from there (similar to .jar dependencies)? How do you access the
> > > header files, possible library, and runtime library for the different
> > > portions of the build? Is there a mini guide for this kind of project
> > > in the works?
> > >
> > > Thanks,
> > > ..David..
> > >
> > >
> >
> >
>
>

Re: Building C++ projects with Maven (2)

Posted by Chris Berry <ch...@gmail.com>.
This brings up a bigger question; How does maven want to handle OS
information in the repo?? To be successful w/ other languages like C, the
repo will need to delineate information such as "i586" and "linux". Are
these to be rolled into the groupId?? That doesn't smell right. Seems that
we may need new Artifact Resolvers that understand this sort of info
natively and can transparently supply the the correct pieces to the URL.

Cheers,
-- Chris

On 11/1/05, dan tran <da...@gmail.com> wrote:
>
> Hi David,
> There is a work in progress for native-maven-plugin
> http://svn.mojo.codehaus.org/trunk/mojo/maven-native/
> You can build it and take a look at some doc.
> -Dan
>
>
> On 11/1/05, David Jackman <Da...@fastsearch.com> wrote:
> >
> > I've just found out that I'm going to need to expand our Maven build
> > process to include several C++ project (which I believe are built using
> > gcc). I seem to remember seeing some traffic on this list from people
> > doing this sort of thing (which I promptly ignored because I wasn't at
> > the time). Can anyone offer some insight on how you got this to work
> > and how you overcame the problems that came up? What plugins are
> > available to build this way and do they do everything you need? Are you
> > able to have dependencies in the Maven repository and have the build use
> > them from there (similar to .jar dependencies)? How do you access the
> > header files, possible library, and runtime library for the different
> > portions of the build? Is there a mini guide for this kind of project
> > in the works?
> >
> > Thanks,
> > ..David..
> >
> >
>
>

Re: Building C++ projects with Maven (2)

Posted by dan tran <da...@gmail.com>.
Hi David,
 There is a work in progress for native-maven-plugin
 http://svn.mojo.codehaus.org/trunk/mojo/maven-native/
 You can build it and take a look at some doc.
  -Dan


 On 11/1/05, David Jackman <Da...@fastsearch.com> wrote:
>
> I've just found out that I'm going to need to expand our Maven build
> process to include several C++ project (which I believe are built using
> gcc). I seem to remember seeing some traffic on this list from people
> doing this sort of thing (which I promptly ignored because I wasn't at
> the time). Can anyone offer some insight on how you got this to work
> and how you overcame the problems that came up? What plugins are
> available to build this way and do they do everything you need? Are you
> able to have dependencies in the Maven repository and have the build use
> them from there (similar to .jar dependencies)? How do you access the
> header files, possible library, and runtime library for the different
> portions of the build? Is there a mini guide for this kind of project
> in the works?
>
> Thanks,
> ..David..
>
>