Regardless, all you have to do is set it in the parent pom (ideally with a
good <dependencyManagement> section with everything you're going to use),
and then if the IDE adds <version> to anything, delete it (really, I think
the dependency adding feature should detect if the library is already
referenced from the parent's <dependencyManagement> section - but Maven can
get really weird about dependencies [add a library with a
<scope>provided</scope> library you already depend on, and it can make the
library disappear from your runtime classpath), so I can imagine that might
break things once in a while).

-Tim

On Mon, Nov 18, 2019 at 8:54 PM Dmitry Avtonomov <
[email protected]> wrote:

> Thanks for the suggestion John, I tried both buttons - nothing worked for
> me. I also tried building the complete NBP:
>
> *ant -Dcluster.config=full build-nozip build-nbms build-source-zips
> build-javadoc*
>
> Tried building just the platform:
>
> *ant -Dcluster.config=platform build-nozip build-nbms build-source-zips
> build-javadoc*
>
> None worked.
> And I do see the built artifacts in ~/.m2/repository. They are right there
> next to RELEASE110, RELEASE111 etc downloaded by maven when I tried
> building a test app after first installing netbeans.
>
> The only difference between the downloaded artifacts (like RELEASE112)
> compared to my built ones is that the downloaded ones' pom files had the
> *<parent>* entry:
>
> *<parent>    <groupId>org.apache.netbeans</*
> *groupId>    <artifactId>netbeans-parent</*
>
> *artifactId>    <version>2</version></parent>*
>
> That parent pom doesn't seem to add anything build-related, it's mostly
> license notices etc. But in the end I added parentGAV configuration entry
> to nb-repository-plugin like this:
>
>
>
>
>
>
> *<plugin>  <groupId>org.apache.netbeans.utilities</groupId>
> <artifactId>nb-repository-plugin</artifactId>  <version>1.4</version>
> <configuration>
> <parentGAV>org.apache.netbeans:netbeans-parent:2</parentGAV>      ....*
>
> Now the NetBeans wizard (New Project -> Java with Maven -> NetBeans
> Application) still does not see my artifacts. But if I still create an app
> with one of the RELEASExxx versions it does see and change RELEASExxx in
> the parent project pom to my version, it seems to work. At least I don't
> get build errors as before. I frankly don't know what might have changed
> except for me adding the praentGAV, but it does seem to work. In the
> pom.xml of *...-parent* project created by the wizard set netbeans.version
> to RELEASE1236 (which is locally built):
>
>
>
> *<properties>        <netbeans.version>RELEASE1236</netbeans.version>
>   <brandingToken>mavenproject4</brandingToken>    </properties>*
>
> This is a new computer with a fresh install of everything, including the
> OS, so hard to tell.
> I also didn't have any luck building+running with Java 11 (tried zulu and
> adoptopenjdk) so switched everything back to 8.
>
>
>
>
> On Sun, Nov 17, 2019 at 10:43 AM John Neffenger <[email protected]> wrote:
>
> > On 11/17/19 2:06 AM, Dmitry Avtonomov wrote:
> > > I did do that - there's a button to re-index maven repos afair.
> >
> > If that's the button in the Options under Java > Maven, I think that
> > just pulls down the latest list from Maven Central again.
> >
> > Instead, open the Services Window (Ctrl-5), expand Maven Repositories,
> > right-click the entry for Local, and select Update Index to re-index the
> > local repository and save it in the NetBeans cache.
> >
> > That's how I got NetBeans to recognize the artifacts that I had copied
> > into the local Maven cache when working around NETBEANS-1396.
> >
> > John
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
>


-- 
http://timboudreau.com

Reply via email to