Question

This question is really, really stupid as I have no experience with Maven.

I was interested in NanoHTTPD as an embedded web server in my project, but upon downloading the source and testing it out, I get the following error:

Failed to execute goal on project nanohttpd-samples: Could not resolve dependencies for project fi.iki.elonen:nanohttpd-samples:jar:2.0.2: The following artifacts could not be resolved: fi.iki.elonen:nanohttpd:jar:2.0.2, fi.iki.elonen:nanohttpd-webserver:jar:2.0.2: Failure to find fi.iki.elonen:nanohttpd:jar:2.0.2 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]

I tried the -e flag and netbeans spat out a tonne more errors related to Maven, which none made sense.

I also tried putting together one that did not involve Maven myself, which it didn't work.

I Googled for an hour and absolutely no answers are avail. Results are <10 and none are related to nanohttpd.

I know Maven is similar to Ant, but I have no idea how it works.

Anyway,

NanoHTTPD > https://github.com/NanoHttpd/nanohttpd

I am using netbeans, with JDK 7 downloaded today on this new linux box.

Help is appreciated. Below is the error reproduced on Fedora Netbeans, Stock JDK7 + NB bundle.

enter image description here

Full resolution : http://img10.imageshack.us/img10/2061/screenshot0608201310360.png

Thank you!

Was it helpful?

Solution

I notice that there are 2 failing tests in the main (core) package of NanoHttpd. I've fixed those and the build runs cleanly on a Ubuntu VM.

I would suggest pulling the latest from master and trying the build again, should all be fixed.

Oh, and thanks ... without you running into this issue, I might not have known about build errors when running on a a linux platform!

OTHER TIPS

You can try multiple things:

1: Try deleting the corresponding failed to download artifact directory in your local repo. Next time I run the maven command the artifact download is triggered again. Therefore I'd say it's a client side setting. Local repo path:

Unix/Mac OS X – ~/.m2

Windows – C:\Documents and Settings{your-username}.m2

2: As specified in the settings reference, I guess what you need is to change the default value of updatePolicy in Maven Settings, which is daily. I am not sure if this applies to a failed download though. Also, always is ok for snapshots not for releases.

<profiles>
    <profile>
      ...
      <repositories>
        <repository>
          <id>myRepo</id>
          <name>My Repository</name>
          <releases>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
         </repository>
      </repositories>
      ...
    </profile>
  </profiles>
  ...
</settings>

3: Use the -U in the build goal

4: Make sure you are using proper maven version Maven3/Maven2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top