1

I am trying to revive my old project. I want to use maven for it and I want to add AbsoluteLayout dependency. I am kinda new in maven so I have no idea what is wrong. I have found that this should work:

<dependency>
<groupId>org.netbeans.external</groupId>
<artifactId>AbsoluteLayout</artifactId>
<version>RELEASE802</version>
</dependency>

but I only get this error:

Failed to execute goal on project XXX: Could not resolve dependencies for project xx.xxxx:XXX:jar:1.0-SNAPSHOT: Failure to find org.netbeans.external:AbsoluteLayout:jar:RELEASE802 in http://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]

After this I manually added this dependency from my netbeans folder in my computer. And it is working. Is there another way how to add this dependency? I would like to include it in my pom file. Any ideas?

jv95
  • 681
  • 4
  • 18
  • Since it's not publicly available library (at least not at [Maven central](http://search.maven.org/)) you need to [install it in your local repository](http://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-in-maven-project). – MirMasej Mar 20 '17 at 16:55
  • Hi, its public library and its working for user Eric B. Any ideas why? – jv95 Mar 20 '17 at 18:09
  • It is available in Netbeans repository, see my answer. – MirMasej Mar 20 '17 at 18:18

3 Answers3

3

You need to add a Netbeans repository to your POM:

<repositories>
    <repository>
      <id>netbeans</id>
      <name>Netbeans rep</name>
      <url>http://bits.netbeans.org/maven2/</url>
    </repository>
</repositories>
MirMasej
  • 1,592
  • 12
  • 17
2

I added the below dependency block to my POM and after updating my maven indices it worked just fine.

<!-- https://mvnrepository.com/artifact/org.netbeans.external/AbsoluteLayout -->
<dependency>
    <groupId>org.netbeans.external</groupId>
    <artifactId>AbsoluteLayout</artifactId>
    <version>RELEASE802</version>
</dependency>

So you might want to try updating your maven indices and see if that does it for you. This dependency block came directly from mvnrepository.com/, and worked without me needing to add any special repo as far as I'm aware.

Eric B
  • 217
  • 1
  • 14
  • @jv95 are you running it from command line or an IDE? If it's just straight command line do: `mvn clean install -U` That will do a clean install and the -U forces updates of dependencies. – Eric B Mar 20 '17 at 20:00
0

Look like that dependency is not exists in the public repository, you can register an account and upload it, or, from my view point is better, you can setup your own private maven repository server, there many software support to do this, for example JFrog Artifactory, it is easy to install and manipulate.

Yu Jiaao
  • 4,444
  • 5
  • 44
  • 57
  • Hello, it looks like the dependency exists in the public repository. I found it on the internet in topics related to my problem "how to use AbsoluteLayout in maven" and also it works for user Eric B. Can you try it it is it working for you too ? :/ – jv95 Mar 20 '17 at 18:05