Oh damn it! I should have figured that out! It now works. Thanks Anders! /Tommy
Från: Anders Hammar <[email protected]> Svara: Maven Users List <[email protected]> Datum: 24 april 2021 at 19:43:58 Till: Maven Users List <[email protected]> Ämne: Re: Scratching my head over repositories ... Ok, the problem is that you've declared a repository but it should be a pluginRepository as it's a plugin or a dependency of one. /Anders (mobile) Den lör 24 apr. 2021 16:36Tommy Svensson <[email protected]> skrev: > To be clearer: > > [ERROR] Plugin > se.natusoft.tools.codelicmgr:CodeLicenseManager-maven-plugin:2.2.2 or one > of its dependencies could not be resolved: Failure to find > se.natusoft.tools.codelicmgr:CodeLicenseManager-maven-plugin:jar:2.2.2 in > https://repo.maven.apache.org/maven2 was cached in the local repository, > resolution will not be reattempted until the update interval of central has > elapsed or updates are forced -> [Help 1] > > Repo definition in root pom.xml: > <repositories> > <repository> > <id>ns-repo</id> > <name>ns-artifact-repository</name> > <url>https://download.natusoft.se/maven</url> > </repository> > </repositories> > From <pluginManagement> > <plugin> > <groupId>se.natusoft.tools.codelicmgr</groupId> > <artifactId>CodeLicenseManager-maven-plugin</artifactId> > <version>2.2.2</version> > </plugin> > Usage: > > <plugin> > <groupId>se.natusoft.tools.codelicmgr</groupId> > <artifactId>CodeLicenseManager-maven-plugin</artifactId> > > <executions> > <execution> > <id>install-licence-info</id> > ... > And I got the version wrong in first mail, it is 2.2.2, not 2.2.1 and > 2.2.2 also does exist in my webserver repo. From CyberDuck view copy + > paste: > ... > /public_html/maven/se/natusoft/tools/codelicmgr/CodeLicenseManager/2.2.2 > > > .../public_html/maven/se/natusoft/tools/codelicmgr/CodeLicenseManager/2.2.2/_remote.repositories > > > ..../public_html/maven/se/natusoft/tools/codelicmgr/CodeLicenseManager/2.2.2/CodeLicenseManager-2.2.2.pom > > > .../public_html/maven/se/natusoft/tools/codelicmgr/CodeLicenseManager/2.2.2/CodeLicenseManager-2.2.2.pom.md5 > > > .../public_html/maven/se/natusoft/tools/codelicmgr/CodeLicenseManager/2.2.2/CodeLicenseManager-2.2.2.pom.sha1 > > > And yes, the rest of the artifacts are there too. > > /Tommy > > > Från: Tommy Svensson <[email protected]> > Svara: Maven Users List <[email protected]> > Datum: 24 april 2021 at 15:21:03 > Till: Maven Users List <[email protected]> > Ämne: Re: Scratching my head over repositories ... > > I am using latest IDEA which supplies maven 3.6.3. > > No version ranges. > > My interpretation of > https://maven.apache.org/guides/mini/guide-multiple-repositories.html#repository-order > > > says that maven central is always first. > > -- > > About Maven Central: Many years ago I did submit some tools of mine to > maven central. That was a truly painful experience. I wrote a mail to this > mailing list about it where I suggested that it would be greatly beneficial > to everyone if the procedure to get artifacts to maven central was an easy > one. I only got one reply and that was from jbarush at JFrog who asked if I > was aware of Bintray. Bintray showed how easy and trivial this really > should be. I think they set a standard there. > > I recently googled about releasing to maven central thinking that it might > have improved, and it has, but not enough. > > JFrog offered free Artifactory account for open source. Artifactory also > needs its own repository and URL, there is no common like JCenter as far as > I have been able to determine. Thereby it doesn't offer more than my web > server does. And pushing to my web server is 100% painless. It does not > waste my time in any way, and I value my time. What I'm doing on GitHub is > partly for personal need/want, but mostly for fun, and then it should be > fun all the way. > > Don't misunderstand me. I'm a big fan of maven. Its only the maven central > handling that I'm in disagreement with. > > /Tommy > > > Från: Anders Hammar <[email protected]> > Svara: Maven Users List <[email protected]> > Datum: 22 april 2021 at 20:37:20 > Till: Maven Users List <[email protected]> > Ämne: Re: Scratching my head over repositories ... > > But it should work. At least as long as you specify the version. > This is what we do when we create patched versions of external libraries. > We publish them to our internal repo but with the "correct" groupId and > artifactId, but a version that identifies it as patched (1.2-ISSUE123 > e.g.). I admit it's been a while since we did it the last time, but it > worked then. > > But if you're using version ranges (or even LATEST) it might not work. > But > that's a bad pattern in any case. > > /Anders > > On Thu, Apr 22, 2021 at 6:38 PM Tamás Cservenák <[email protected]> > wrote: > > > Howdy Tommy, > > > > I think you are on a thin ice with this setup: if your artifacts are in > > Central, why not publish them in future as well? > > > > Having your "own" repo, while it seems cool at first glance, is usually > NOT > > what you want, unless you can guarantee reliability, availability and > speed > > of that of Central (or let's say 1/3 of it). > > Moreover, bringing your own repo with overlapping GAVs to Central is a > big > > mistake, you are booby-trapping your users: they will always struggle > just > > like you now, and it just complicate their bootstrap and development > setup. > > > > So, IMO, bite the bullet, and continue publishing to Central. Yes, is a > > process, is slow and has many problems, but is still the best way to go. > At > > least for your users. > > > > HTH, > > T > > > > On Thu, Apr 22, 2021 at 6:24 PM Tommy Svensson <[email protected]> > wrote: > > > > > Hello fellow maven fans, > > > > > > A very long time ago I released a package to maven central. That was > such > > > a pain that when Bintray came I switched to Bintray (the best and > > simplest > > > service I've ever used! Really sad to see it gone). Now that Bintray > is > > no > > > more I realized that I can publish my packages on my own web server > and > > > point it out as a repository in pom. So far so good. > > > > > > I'm now having a problem building a maven project using one of my own > > > tools: CodeLicenseManager. I'm using version 2.2.1 which is available > in > > my > > > web server repository. But maven still fails to find this dependency. > It > > > finds the others in the same repo without any problem, but not this. > > > > > > I have come to the realisation that this is because > CodeLicenceManager > > > also exists in maven central, but latest version there is 2.1.1 and > I'm > > > asking for 2.2.1. But since maven is finding CodeLincenseManager in > maven > > > central, it is not looking at other repos for this version. > > > > > > So now my question is: Is there a way to force maven to look in all > > repos > > > when version is not available but artifact is ? Or is the only way out > of > > > this to change the name or group of the artifact ? > > > > > > Best Regards, > > > Tommy Svensson > > > > > > > > >
