reset password
Author Message
ummata
Posts: 68
Posted 00:40 Sep 26, 2012 |

OS: Ubuntu 12.10
jdk 1.7 sun
Eclipse j2EE Juno


There are many Maven Dependency Problems detected in Eclipse, each looks like this

ArtifactTransferException: Failure to transfer commons-collections:commons-collections:jar:3.2.1 from 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. Original error: Could not transfer artifact commons-collections:commons-collections:jar:3.2.1 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 pom.xml /csns2 line 2 Maven Dependency Problem

What I see from that, It simply doesn't load the required libraries. And I did check in the .m2 repo directory, there is no file.
I spent a fair amount of time searching for a solution, I might switch to Windows.

cysun
Posts: 2935
Posted 07:42 Sep 26, 2012 |

Well, the problem doesn't seem to have anything to do with environment variable. It looks like either the central Maven repository was down at that time or you had some network problems. If you are sure your network is fine, just wait some time, remove $HOME/.m2 (in case there are some corrupted packages in there), and try again.

ummata
Posts: 68
Posted 13:04 Sep 26, 2012 |

First of all, I have set up environment on Windows7 and everything works fine. This post is just my problem with Ubuntu 12.10 that I want to share to others.
I did fix dependency  problems but there are some problems remain.
What I did was I updated version of JavaHL for Subclipse on Ubuntu by following steps from this site below.
http://subclipse.tigris.org/wiki/JavaHL 
And I did try delete .m2 directory as well.
Now there are one Maven Configuration Problem and four Maven Problems detected by Eclipse and they look like this.

 

Maven Configuration Problem(1)
============================
Description Resource Path Location Type
Failure to transfer org.codehaus.plexus:plexus-utils:pom:3.0 from 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. Original error: Could not transfer artifact org.codehaus.plexus:plexus-utils:pom:3.0 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom pom.xml /csns2 line 1 Maven Configuration Problem
 
 
Maven Problem(4, this is one of them)
==============
Description Resource Path Location Type
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1 (): ArtifactDescriptorException: Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:3.0: ArtifactResolutionException: Failure to transfer org.codehaus.plexus:plexus-utils:pom:3.0 from 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. Original error: Could not transfer artifact org.codehaus.plexus:plexus-utils:pom:3.0 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom pom.xml /csns2 line 40 Maven Project Build Lifecycle Mapping Problem

 

Problems may not be about the internet connection. I guess it is probably the version of Eclipse or Ubuntu environment.

Last edited by ummata at 13:08 Sep 26, 2012.
cbly80
Posts: 8
Posted 11:32 Oct 09, 2012 |

I'm having similar problems setting up my development environment on Ubuntu 12.04.


First I got an error saying that JavaHL wasn't available, and after following the directions on http://subclipse.tigris.org/wiki/JavaHL I got a different error saying that JavaHL version was incompatible.  Apparently, the newest version of JavaHL available on repos is Ubuntu is 1.6, and Subversion 1.8 requires JavaHL 1.7.  I even tried downloading the older Subversion 1.6 plug-in instead, just to see if it would work, but then I had compatibility issues with the Maven plug-in.


I've tried several different installation methods--downloading JavaJDK and Eclipse directly from web as in CS520 setup demo, and downloading them via a package manager--with the same results.  I've tried both Eclipse Indigo and Juno (Indigo is the latest version available via package manager) with the same results.  I even tried setting up in Debian Squeeze, just to see, but with no luck.

I had no problem setting up on Windows, but can't seem to do the same here.

cysun
Posts: 2935
Posted 14:36 Oct 09, 2012 |

I don't use Eclipse on Linux, but if I do, here's how I would set up the environment (assuming Ubuntu):

1. Use the package manager to install JDK 7. OpenJDK should work just fine, i.e. you don't have to use Sun JDK. Use "sudo update-alternatives --config java" to make sure the default JDK is the one you want.

2. Download Eclipse from eclipse.org. I wouldn't use the package manager to install Eclipse because I don't know if the package manager will install any additional plugins/libraries that may cause problem.

3. For the Subclipse plugin, install the following:

  • Subclipse (Required)
  • Subclipse Client Adapter (Required)
  • JNA Library
  • SVNKit Client Adapter (Not Required)
  • SVNKit Library

If I understand correctly, Subclipse has two client libraries. JavaHL uses native libraries - it's faster but it's not available on all platforms. SVNKit is the pure Java client so it should work everywhere.

4. All other plugins are pure Java so they should work.

cbly80
Posts: 8
Posted 20:39 Oct 09, 2012 |

That's actually what I tried doing after I posted my problem.  It allows me to connect to subversion ok now, but I have some cleanup to do on csns2.  I'm getting all kinds of Maven dependency problems and build path problems now.  I've figured some of them out, but not all.

cbly80
Posts: 8
Posted 20:41 Oct 09, 2012 |

Just curious, if you don't use Eclipse on Linux, do you use another IDE?  Is there one you can recommend?

cysun
Posts: 2935
Posted 20:50 Oct 09, 2012 |
cbly80 wrote:

Just curious, if you don't use Eclipse on Linux, do you use another IDE?  Is there one you can recommend?

There are three major Java IDEs: IntelliJ IDEA, NetBeans, and Eclipse (and tons of Eclipse-based IDEs like Orcale JDeveloper, Spring Tool Studio, myEclipse, ...). Intellij is commercial, so if you don't use Eclipse and don't want to pay money, NetBeans is pretty much the only choice.

cbly80
Posts: 8
Posted 20:50 Oct 09, 2012 |

Also, there seems to be some different opinions on the web about where to declare environment variables.  What is the difference between declaring those variables in .bashrc and .profile.  Also, is it necessary to declare JAVA_HOME and JRE_HOME?

cysun
Posts: 2935
Posted 20:55 Oct 09, 2012 |
cbly80 wrote:

Also, there seems to be some different opinions on the web about where to declare environment variables.  What is the difference between declaring those variables in .bashrc and .profile.  Also, is it necessary to declare JAVA_HOME and JRE_HOME?

You can declare in either .bashrc or .profile. .bashrc is only for bash, while .profile would work for any shell, but since you are probably using bash, it doesn't really matter.

You shouldn't need JRE_HOME, and in theory you only need JAVA_HOME if Eclipse cant' figure out the correct JDK directory on its own.

Now that there seems to be some interests in using Eclipse on Linux, I'll try setting up the environment on Ubuntu and see if it works.

cysun
Posts: 2935
Posted 22:51 Oct 09, 2012 |

I just set up everything on Ubuntu 12.04 Desktop without any problem. Please see my notes.

When you set up Eclipse/Maven/CSNS2 for the first time, it takes a long time for Maven to update the repository index and download all the libraries. Be patient. Wait until all the background processes finish before trying to run the project (you can see the background processes in the Progress view). If you interrupt the background processes, you may end up with incomplete libraries that would cause dependency errors. To fix these errors, you need to go to $HOME/.m2/repository, which is where Maven stores the downloaded libraries, delete the libraries that are causing problem, then in Eclipse, do Maven -> Update Project so Maven can re-download those libraries.

ummata
Posts: 68
Posted 23:58 Oct 09, 2012 |

Thank you again, Dr.Sun.
I will try this and I hope it will work fine this time.

Last edited by ummata at 00:00 Oct 10, 2012.
ummata
Posts: 68
Posted 00:23 Oct 16, 2012 |

It finally works on my Ubuntu.
Thank you for your help, Dr.Sun