1

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!

William Yang
  • 759
  • 9
  • 30

2 Answers2

1

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!

Paul Hawke
  • 1,141
  • 10
  • 12
0

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

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
  • @WilliamYang You can try deleting the package folder which is causing the proble. If you don't know that then clean the contents of .m2 and don't remove it. – Juned Ahsan Jun 09 '13 at 02:35
  • I've tried rm -rf. The dependencies re-download again but I run into the same problem. (It is as if I am building it for the first time). I've also tried removing the project on disk and re-extracting the archive and build. I've done this about at least 40 times now. No luck. – William Yang Jun 09 '13 at 02:37