0

I was trying to download the Netty Source Code and run the included examples.

The jdk version I installed is 1.8.0_65.

I tried to convert examples(in the example folder ...\netty-4.1\example) to eclipse project with maven(mvn eclipse:eclipse).

But got build error said below.

[INFO]
[INFO] >>> maven-eclipse-plugin:2.10:eclipse (default-cli) > generate-resources @ netty-example >>>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.558 s
[INFO] Finished at: 2016-02-04T13:40:13+08:00
[INFO] Final Memory: 11M/28M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project netty-example: Could not resolve dependencies for project io.netty:netty-example:jar:4.1.0.CR2-SNAPSHOT: Failure to fi
nd io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be r
eattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project netty-example: Could not resolve dependencies for project io.netty:net
ty-example:jar:4.1.0.CR2-SNAPSHOT: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached i
n the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:352)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:197)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project io.netty:netty-example:jar:4.1.0.CR2-SNAPSHOT: Fai
lure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution wil
l not be reattempted until the update interval of central has elapsed or updates are forced
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:211)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
        ... 27 more
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 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
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205)
        ... 28 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.m
aven.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 fo
rced
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
        ... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 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

        at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
        at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
        ... 31 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

And I followed the clue mentioned in the message. I found this solution which link to the http://netty.io/wiki/forked-tomcat-native.html#wiki-h3-6.

I thought this may not be the work around for my purpose.(I just want to run the examples).

So I want to know any Netty development library to be downloaded to getting start Netty application development. or Any Pom.xml share link could be easy included in the example project ? Thanks.

Joe.wang
  • 11,537
  • 25
  • 103
  • 180
  • Did you try the instructions in [Force maven update](https://stackoverflow.com/questions/4701532/force-maven-update?rq=1)? It helps with the `was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced` problem. – Ferrybig Feb 04 '16 at 07:46
  • Yes. I already tried `mvn clean install -U`. The error is still there. – Joe.wang Feb 04 '16 at 07:57
  • I am confused by the fact it tries to download "io.netty:netty-tcnative:jar:windows-x86_**32**:1.1.33.Fork11". Any weird things with your setup like 32 bit maven or something like that?? – Ferrybig Feb 04 '16 at 08:00
  • I think not , Because maven does works for my others project in my computer . So maven setup is no problem . Right? – Joe.wang Feb 04 '16 at 08:07
  • oh. Found it . `mvn -version` returns `OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"`. Does it mean 32bit maven in my computer? Thanks – Joe.wang Feb 04 '16 at 08:10
  • I am almost sure this is actually a bug in Netty, you can try building the whole netty project instead of only the examples with `mvn clean install -U` in the root, can you report to the [Netty project issues](https://github.com/netty/netty/issues), that it tries to download a dependency they never uploaded to central. – Ferrybig Feb 04 '16 at 08:15
  • Actually, After I got the same error when I tried to build whole project. I turned to the `example` folder try to avoid this error. But I think I was wrong. Because example is part of source code or it depend on the source code like project dependence. Thanks. – Joe.wang Feb 04 '16 at 08:20
  • @Ferrybig Done. https://github.com/netty/netty/issues/4836 – Joe.wang Feb 04 '16 at 08:27

2 Answers2

1

Looking at the logs, it seems to have failed to find the tcnative jar

Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached in the local repository,

Can you try downloading this tcnative jar from command line using maven as below:

mvn org.apache.maven.plugins:maven-dependency-plugin:get -DrepoUrl=http://central.maven.org/maven2/  -DgroupId=io.netty -DartifactId=netty-tcnative -Dversion=1.1.33.Fork11
  • It does't works. The url `http://central.maven.org/maven2/` can be reached on my side. BTW, Why I can't find 'netty-tcnative' or `tcnative` in the url you mentioned ? Thanks. – Joe.wang Feb 04 '16 at 08:00
  • @Joe.wang My mistake. I posted `-Dversion:` instead of `-Dversion=`. Can you try now. I have updated the command. Also you can find the tcnative poms and jars at [http://central.maven.org/maven2/io/netty/netty-tcnative/](http://central.maven.org/maven2/io/netty/netty-tcnative/) – Madhusudana Reddy Sunnapu Feb 04 '16 at 08:35
  • Really Works ! I also want to know where is the wrong url https://repo.maven.apache.org/maven2 provided ? In my maven setting or in the Netty source project ? Thanks. – Joe.wang Feb 04 '16 at 08:53
  • 1
    I cannot say it is wrong URL. But it is configured in the super POM of your maven installation. It can be found in `org/apache/maven/model/pom-4.0.0.xml` file in `maven-model-builder-3.3.9.jar` under maven/lib folder – Madhusudana Reddy Sunnapu Feb 04 '16 at 09:03
  • :) Got it . So I think I'd better add more repository url in my pom.xml . right ? – Joe.wang Feb 04 '16 at 09:06
  • Also, subsequently the error says 'resolution will not be reattempted until the update interval of central has elapsed or updates are forced`. Wondering if if trying with `mvn -U` option could solve the issue as well. I couldn't try `-U` option as I am unable reproduce the error. May be that is worth a try. Regarding adding more repository url, we can do that, but I am thinking why the `https://github.com/netty/netty/blob/4.1/example/pom.xml` itself doesn't have that entry? Or is there a better solution? – Madhusudana Reddy Sunnapu Feb 04 '16 at 09:15
  • The error is the same one If I run with the `mvn eclipse:eclipse -U -e`. Please join the discussion here. https://github.com/netty/netty/issues/4836 – Joe.wang Feb 04 '16 at 09:34
1

This answer was made according to the bug report on the Netty project.

To build the Netty project, you should use a 64 bit operation system in combination with a 64 JVM. This is because 1 of the dependencies used by the Netty project only supports 64 bits.

According to the output of mvn -version, you are running on a 32 bit JVM. You should be able to download a 64 bit JVM from the official java website.

Upgrading to a 64 bit JVM also gives the following advantages:

  • You can run programs with more than 2 GB memory
  • Calculations using long and double will be faster as java can use the native processor

For the differences see: Benefits of 64bit java platform

You are not required to compile the examples yourself, you can also find them on maven central sorted by version: http://central.maven.org/maven2/io/netty/netty-example/

Ferrybig
  • 18,194
  • 6
  • 57
  • 79