问题
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?
回答1:
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>
回答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.
回答3:
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.
来源:https://stackoverflow.com/questions/42909316/maven-absolutelayout-dependency