NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Publishing nbm artifacts from an Ant project to a Maven repository

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Fabrizio Giudici
Posted via mailing list.





PostPosted: Thu Sep 17, 2009 5:32 pm    Post subject: Publishing nbm artifacts from an Ant project to a Maven repository Reply with quote

During the conversion to Maven of my Platform projects made with Ant,
one of the most frustrating thing is the lack of incrementality in my
process related to dependencies. I have hundreds of modules and, of
course, the regular way is to start from wrapper libraries, then modules
that don't depend on anything else but libraries and the Platform, then
modules depending on the previous set modules, etc etc. until I've done.
Unfortunately, this means that the most interesting artifact (the final
application) will come last.

Using the Ant Tasks for Maven I'm being able to use both systems at the
same time (of course, temporarily). For instance, I've started using
Maven to create my custom platform (via mvn nbm:cluster) and retrieving
some dependant NBM modules that are ready. Unfortunately, I have still
dozens of dependant modules that aren't ready yet and are blocking me.
My concern about the lack of incrementality in this process is that I
can't incrementally test. I'm sure that if I go on making conversions
for two weeks without testing in the meantime I'll get a broken toy,
with a myriad of small introduced bugs hard to find.

So, my question. Is it possible to take an Ant Platform Project and
deliver the nbm artifacts to a Maven Repo? It's ok if I have to manually
add some meta-info for the published POMs. If it is possible, I could
instantly make available dozens of low-level modules, then focus on the
application, and then incrementally move the modules to a purely Maven
project. I suppose it's possible, as NetBeans itself is compiled with
Ant, still you can find its NBM in a Maven repo.

Thanks.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
address-removed - mobile: +39 348.150.6941
Back to top
mkleint
Posted via mailing list.





PostPosted: Thu Sep 17, 2009 5:39 pm    Post subject: Publishing nbm artifacts from an Ant project to a Maven repository Reply with quote

http://mojo.codehaus.org/nbm-maven-plugin/populate-repository-mojo.html
it's used for creating netbeans.org module repository. but beware that
the maven pom generated is not entirely correct. it's good for depending
on in your maven app, but not for building the project itself.

Milos

Fabrizio Giudici wrote:
Quote:
During the conversion to Maven of my Platform projects made with Ant,
one of the most frustrating thing is the lack of incrementality in my
process related to dependencies. I have hundreds of modules and, of
course, the regular way is to start from wrapper libraries, then
modules that don't depend on anything else but libraries and the
Platform, then modules depending on the previous set modules, etc etc.
until I've done. Unfortunately, this means that the most interesting
artifact (the final application) will come last.

Using the Ant Tasks for Maven I'm being able to use both systems at
the same time (of course, temporarily). For instance, I've started
using Maven to create my custom platform (via mvn nbm:cluster) and
retrieving some dependant NBM modules that are ready. Unfortunately, I
have still dozens of dependant modules that aren't ready yet and are
blocking me. My concern about the lack of incrementality in this
process is that I can't incrementally test. I'm sure that if I go on
making conversions for two weeks without testing in the meantime I'll
get a broken toy, with a myriad of small introduced bugs hard to find.

So, my question. Is it possible to take an Ant Platform Project and
deliver the nbm artifacts to a Maven Repo? It's ok if I have to
manually add some meta-info for the published POMs. If it is possible,
I could instantly make available dozens of low-level modules, then
focus on the application, and then incrementally move the modules to a
purely Maven project. I suppose it's possible, as NetBeans itself is
compiled with Ant, still you can find its NBM in a Maven repo.

Thanks.
Back to top
Robert C Kelsey
Posted via mailing list.





PostPosted: Thu Sep 17, 2009 5:49 pm    Post subject: Publishing nbm artifacts from an Ant project to a Maven repository Reply with quote

Yours is an excellent question. I have a similar problem, although I am
converting from VB6 to Java. Trying to do this within the NetBeans IDE has
been a challenge, with over 100 modules and 50 forms. Now, I am looking at
the NetBeans Platform, and it seems to me that I can use it to incrementally
develop a piece at a time. At least, this is what I think I am seeing in
the videos and tutorials.

What I am doing is to identify the individual parts and develop starting
with the most basic leg, from top to bottom, and then develop the next leg,
and so forth. It seems to be an approach that, for me at least, was next to
impossible using the barebones IDE.

Robert Kelsey

-----Original Message-----
From: Fabrizio Giudici [mailto:address-removed]
Sent: Thursday, September 17, 2009 12:32 PM
To: address-removed
Subject: [openide-dev] Publishing nbm artifacts from an Ant project to a
Maven repository

During the conversion to Maven of my Platform projects made with Ant, one of
the most frustrating thing is the lack of incrementality in my process
related to dependencies. I have hundreds of modules and, of course, the
regular way is to start from wrapper libraries, then modules that don't
depend on anything else but libraries and the Platform, then modules
depending on the previous set modules, etc etc. until I've done.
Unfortunately, this means that the most interesting artifact (the final
application) will come last.

Using the Ant Tasks for Maven I'm being able to use both systems at the same
time (of course, temporarily). For instance, I've started using Maven to
create my custom platform (via mvn nbm:cluster) and retrieving some
dependant NBM modules that are ready. Unfortunately, I have still dozens of
dependant modules that aren't ready yet and are blocking me.
My concern about the lack of incrementality in this process is that I can't
incrementally test. I'm sure that if I go on making conversions for two
weeks without testing in the meantime I'll get a broken toy, with a myriad
of small introduced bugs hard to find.

So, my question. Is it possible to take an Ant Platform Project and deliver
the nbm artifacts to a Maven Repo? It's ok if I have to manually add some
meta-info for the published POMs. If it is possible, I could instantly make
available dozens of low-level modules, then focus on the application, and
then incrementally move the modules to a purely Maven project. I suppose
it's possible, as NetBeans itself is compiled with Ant, still you can find
its NBM in a Maven repo.

Thanks.

--
Fabrizio Giudici - Java Architect, Project Manager Tidalwave s.a.s. - "We
make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
address-removed - mobile: +39 348.150.6941
Back to top
Fabrizio Giudici
Posted via mailing list.





PostPosted: Thu Sep 17, 2009 6:45 pm    Post subject: Publishing nbm artifacts from an Ant project to a Maven repository Reply with quote

mkleint wrote:
Quote:
http://mojo.codehaus.org/nbm-maven-plugin/populate-repository-mojo.html
it's used for creating netbeans.org module repository. but beware that
the maven pom generated is not entirely correct. it's good for
depending on in your maven app, but not for building the project itself.
I've seen and tried it, but it doesn't do what I need - probably I'm
using it in the wrong way.

So, in my project the platform has been created in

platform/target/metadata

and the .nbm artifact of the project have been created in

target/updates

The plugin is configured as:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>3.1</version>
<extensions>true</extensions>
<configuration>
<brandingToken>metadata</brandingToken>

<netbeansNbmDirectory>target/updates</netbeansNbmDirectory>

<netbeansInstallDirectory>platform/target/metadata</netbeansInstallDirectory>
</configuration>
</plugin>


When I run mvn nbm:populate-repository, I see

[INFO] [nbm:populate-repository]
[INFO] Populate repository with netbeans modules
[INFO] Copying Netbeans artifacts from
/Users/fritz/Projects/blueMarine/blueMarine/src/Metadata/platform/target/metadata
[INFO] Processing 1/79
[INFO] Installing
/Users/fritz/Projects/blueMarine/blueMarine/src/Metadata/platform/target/metadata/platform9/modules/org-netbeans-modules-options-api.jar
to
/Users/fritz/.m2/repository/org/netbeans/api/org-netbeans-modules-options-api/1.10.1/org-netbeans-modules-options-api-1.10.1.jar
[INFO] Processing 2/79
[INFO] Installing
/Users/fritz/Projects/blueMarine/blueMarine/src/Metadata/platform/target/metadata/libraries/modules/org-apache-batik.jar
to
/Users/fritz/.m2/repository/org/netbeans/api/org-apache-batik/1.7.5/org-apache-batik-1.7.5.jar
...

[WARNING] Version not specified, cannot create cluster POMs.

In case 1, it's installing a part of the NetBeans platform - I don't
understand why, since clearly the platform has been already put in my
repository when Maven downloaded it from the repository. In case 2, it
is actually installing one of my libraries (part of the platform for
this project), but it's putting it under org/netbeans/api, while my
groupId is different. I don't see anything installed that is one of the
compiled artifact, and above all I don't see .nbm files installed, only
.jar's.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
address-removed - mobile: +39 348.150.6941
Back to top
mkleint
Posted via mailing list.





PostPosted: Thu Sep 17, 2009 7:01 pm    Post subject: Publishing nbm artifacts from an Ant project to a Maven repository Reply with quote

yes, as the documentation suggests, it will convert the netbeans
installation. whatever there is will be generated, if you want to skip
platform cluster, you have to remove it. it doesn't know and care
whether you've constructed the installation from a maven repo. It
actually has no way to tell anyway..
it will use org.netbeans.api groupid for everything with public api and
org.netbeans.modules for non-public modules. Again it has no way to tell
what groupid you would like to have, there is no such information
anywhere in the installation.
I have no idea what the format of files in target/updates is, but the
goal requires a flat folder content just with nbm files (with the
correct codenamebase as file name)..

if it's not good enough for your purpose, you will have to write your
own maven metadata generating goal I guess.

Milos

Fabrizio Giudici wrote:
Quote:
mkleint wrote:
Quote:
http://mojo.codehaus.org/nbm-maven-plugin/populate-repository-mojo.html
it's used for creating netbeans.org module repository. but beware
that the maven pom generated is not entirely correct. it's good for
depending on in your maven app, but not for building the project itself.
I've seen and tried it, but it doesn't do what I need - probably I'm
using it in the wrong way.

So, in my project the platform has been created in

platform/target/metadata

and the .nbm artifact of the project have been created in

target/updates

The plugin is configured as:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>3.1</version>
<extensions>true</extensions>
<configuration>
<brandingToken>metadata</brandingToken>

<netbeansNbmDirectory>target/updates</netbeansNbmDirectory>

<netbeansInstallDirectory>platform/target/metadata</netbeansInstallDirectory>

</configuration>
</plugin>


When I run mvn nbm:populate-repository, I see

[INFO] [nbm:populate-repository]
[INFO] Populate repository with netbeans modules
[INFO] Copying Netbeans artifacts from
/Users/fritz/Projects/blueMarine/blueMarine/src/Metadata/platform/target/metadata

[INFO] Processing 1/79
[INFO] Installing
/Users/fritz/Projects/blueMarine/blueMarine/src/Metadata/platform/target/metadata/platform9/modules/org-netbeans-modules-options-api.jar
to
/Users/fritz/.m2/repository/org/netbeans/api/org-netbeans-modules-options-api/1.10.1/org-netbeans-modules-options-api-1.10.1.jar

[INFO] Processing 2/79
[INFO] Installing
/Users/fritz/Projects/blueMarine/blueMarine/src/Metadata/platform/target/metadata/libraries/modules/org-apache-batik.jar
to
/Users/fritz/.m2/repository/org/netbeans/api/org-apache-batik/1.7.5/org-apache-batik-1.7.5.jar

...

[WARNING] Version not specified, cannot create cluster POMs.

In case 1, it's installing a part of the NetBeans platform - I don't
understand why, since clearly the platform has been already put in my
repository when Maven downloaded it from the repository. In case 2, it
is actually installing one of my libraries (part of the platform for
this project), but it's putting it under org/netbeans/api, while my
groupId is different. I don't see anything installed that is one of
the compiled artifact, and above all I don't see .nbm files installed,
only .jar's.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo