NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Cush1978
Joined: 15 Sep 2008 Posts: 218
|
Posted: Fri Jul 30, 2010 1:15 am Post subject: Another NBM + Maven question... |
|
|
I'm not sure this is the right forum, but it's the closest one I can find. I've run into a situation where a user uses NetBeans (without Maven) to build an NBM. You right-click the NetBeans Module Project and choose "Create NBM..."
I want to use these modules in Maven, but I can't figure out how. A simple deploy:deploy-file with the NBM isn't working. If I deploy an NBM file and then try to build a Maven project that depends on it, it causes an error saying it can't find the JAR file. I just deployed an NBM, not a JAR file, so the error makes sense.
Sure enough, when I check other NetBeans modules in a Maven repository (like the official NetBeans modules), there is an NBM file and a JAR file.
So the short question is, how do I properly deploy a non-Maven NetBeans Module build as an artifact to a Maven repository? |
|
| Back to top |
|
 |
Milos Kleint Posted via mailing list.
|
Posted: Fri Jul 30, 2010 8:21 am Post subject: [platform-dev] Re: Another NBM + Maven question... |
|
|
you will need the module clusters (eg. by having a netbeans platform app with the modules you want to include installed).. and the nbms somewhere and then use the nbm:populate-repository goal to generate the maven metadata..
Milos
On Fri, Jul 30, 2010 at 3:16 AM, Cush1978 <address-removed ([email]address-removed[/email])> wrote:
| Quote: | I'm not sure this is the right forum, but it's the closest one I can find. I've run into a situation where a user uses NetBeans (without Maven) to build an NBM. You right-click the NetBeans Module Project and choose "Create NBM..."
I want to use these modules in Maven, but I can't figure out how. A simple deploy:deploy-file with the NBM isn't working. If I deploy an NBM file and then try to build a Maven project that depends on it, it causes an error saying it can't find the JAR file. I just deployed an NBM, not a JAR file, so the error makes sense.
Sure enough, when I check other NetBeans modules in a Maven repository (like the official NetBeans modules), there is an NBM file and a JAR file.
So the short question is, how do I properly deploy a non-Maven NetBeans Module build as an artifact to a Maven repository?
|
|
|
| Back to top |
|
 |
Cush1978
Joined: 15 Sep 2008 Posts: 218
|
Posted: Fri Jul 30, 2010 1:11 pm Post subject: |
|
|
Ah, I came across the nbm:populate-repository goal but I misunderstood it to be a goal that put all the NetBeans core modules in a repository. So my application has a build/cluster directory. That's what I use as the "NetBeans Install Directory?"
All the JAR files are in build/cluster/modules. I can also "Create NBMs" and they sit in the build/updates directory.
Is there any way to specify a single module as opposed to doing them all in one shot? If I do work on a single module, do I have to update them all? Ultimately I'm trying to get an environment where Maven-based modules and non-Maven-based modules can be built and depend on each other. |
|
| Back to top |
|
 |
Milos Kleint Posted via mailing list.
|
Posted: Fri Jul 30, 2010 1:20 pm Post subject: [platform-dev] Re: Another NBM + Maven question... |
|
|
On Fri, Jul 30, 2010 at 3:11 PM, Cush1978 <address-removed ([email]address-removed[/email])> wrote:
| Quote: | Ah, I came across the nbm:populate-repository goal but I misunderstood it to be a goal that put all the NetBeans core modules in a repository. So my application has a build/cluster directory. That's what I use as the "NetBeans Install Directory?"
|
yes, that should be it.. install dir is the dir where clusters reside..
| Quote: | All the JAR files are in build/cluster/modules. I can also "Create NBMs" and they sit in the build/updates directory.
|
there's other prop to point to the directory..
| Quote: |
Is there any way to specify a single module as opposed to doing them all in one shot? If I do work on a single module, do I have to update them all? Ultimately I'm trying to get an environment where Maven-based modules and non-Maven-based modules can be built and depend on each other.
|
only possible to do one module if you have the cluster layout..
please note that synchronizing maven builds and ant build when developed in sync could be challenging.. probably bets to leave the repo artifact generation for a hudson job..
Milos
|
|
| Back to top |
|
 |
Cush1978
Joined: 15 Sep 2008 Posts: 218
|
Posted: Fri Jul 30, 2010 1:43 pm Post subject: |
|
|
OK, makes sense. I haven't messed with Hudson yet, but I think you're right. Unless the pure NetBeans developers do the nbm:populate-repository goal on a regular basis, things will easily get out of sync. I might have to look into setting up Hudson.
| Quote: | | only possible to do one module if you have the cluster layout.. |
I'm not sure what this means. The directories for individual modules only have an NBM and a "classes" directory in "build", no "cluster" directory. I'm not sure how I'd get a cluster layout for a single module.
Also, I see it's possible to specify a version or get it from the "OpenIDE-Module-Specification-Version." How do I specify groupId and artifactId? |
|
| Back to top |
|
 |
Milos Kleint Posted via mailing list.
|
Posted: Fri Jul 30, 2010 1:47 pm Post subject: [platform-dev] Re: Another NBM + Maven question... |
|
|
On Fri, Jul 30, 2010 at 3:43 PM, Cush1978 <address-removed ([email]address-removed[/email])> wrote:
| Quote: | OK, makes sense. I haven't messed with Hudson yet, but I think you're right. Unless the pure NetBeans developers do the nbm:populate-repository goal on a regular basis, things will easily get out of sync. I might have to look into setting up Hudson.
| Quote: | only possible to do one module if you have the cluster layout..
|
I'm not sure what this means. The directories for individual modules only have an NBM and a "classes" directory in "build", no "cluster" directory. I'm not sure how I'd get a cluster layout for a single module.
Also, I see it's possible to specify a version or get it from the "OpenIDE-Module-Specification-Version." How do I specify groupId and artifactId?
|
oups, you probably don't specify groupid.. it will just dump it into org.netbeans.FOO
artifactid constructed from codebasename
|
|
| Back to top |
|
 |
Cush1978
Joined: 15 Sep 2008 Posts: 218
|
Posted: Fri Jul 30, 2010 2:34 pm Post subject: |
|
|
Ouch, that seems tough. With this plugin, I have little control over managing NBM artifacts. I was envisioning something like the deploy:deploy-file goal where I'd specify a JAR (and optionally an NBM), a version, groupId, artifactId, etc. and just have it deploy like other artifacts. That or have something akin to the library wrapper.
So I have to do all the modules in one shot (which makes sense for an application), but can't control the identifying information? That seems limiting. Thanks for the information though. Good to understand what my options are and how to do things like this. |
|
| Back to top |
|
 |
Milos Kleint Posted via mailing list.
|
Posted: Fri Jul 30, 2010 2:43 pm Post subject: [platform-dev] Re: Another NBM + Maven question... |
|
|
yup, it's limiting.. but the goal was always just used (and created) for generating the base platform module artifacts.. that's what it is optimized for.
Milos
On Fri, Jul 30, 2010 at 4:35 PM, Cush1978 <address-removed ([email]address-removed[/email])> wrote:
| Quote: | Ouch, that seems tough. With this plugin, I have little control over managing NBM artifacts. I was envisioning something like the deploy:deploy-file goal where I'd specify a JAR (and optionally an NBM), a version, groupId, artifactId, etc. and just have it deploy like other artifacts. That or have something akin to the library wrapper.
So I have to do all the modules in one shot (which makes sense for an application), but can't control the identifying information? That seems limiting. Thanks for the information though. Good to understand what my options are and how to do things like this.
|
|
|
| Back to top |
|
 |
Cush1978
Joined: 15 Sep 2008 Posts: 218
|
Posted: Fri Jul 30, 2010 2:58 pm Post subject: |
|
|
Yeah, that's how that goal reads. I came across it because I was looking at pushing base platform modules into our own repository as opposed to using "deadlock" and/or "bits." I think some of the auto-generated POMs suggest using the nbm:populate-repository goal in an XML comment.
It just seems odd that I can create a Maven NetBeans Module project and build/deploy it without issue, but if I don't build it with Maven, the deployment to a repository isn't straightforward.
I'm working on a platform project with another developer. He had numerous issues with building a NetBeans application on Mac OS with Maven (lost ability to generate OSX binaries, wrong file permissions on build files, etc), so he switched to pure NetBeans. My modules depend on his modules, but mine are currently built with Maven. So I thought being able to deploy his modules as artifacts would be straightforward. It appears the only way to do this is to do them all at once and let them derive their own identifying information.
It sounds like there's a reasonable use case for having a goal in the NBM Maven plugin to deploy a single module. Technically, can all the metadata be generated, given a JAR and possibly an NBM?
That's one nice thing about both platforms...constantly evolving and the functionality gets better and better. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|