• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how do i add a jar file externally as a maven dependency in eclipse?

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am not getting selenium-server2.17.0 as a listed item in eclipse when i try to add from Maven --> Add Dependency

so i want to add it externally
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The selenium-server JARs appear to be in Maven Central at:
http://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-server/

Just enter the proper coordinate and it should download.

I have noticed that the search function in Eclipse doesn't always find everything, the indexing capabilities of m2e are not that good. But if you know the coordinates, then you can always enter them manually.


 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a jar file named selenium-server-2.17.0 . how do i add it manually in the pom.xml file?

i do not know how to name in the groups!!!


<dependency>
<groupId>??</groupId>
<artifactId>??</artifactId>
<version>??</version>
</dependency>
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linda

You can use the install plugin to manually upload a jar into your local repository.

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>


However, if the jar you require is on Maven Central, you should be able to find its coordinates from here: http://search.maven.org/

 
James Boswell
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Available from Maven Central:



Be aware, there is a newer version available - 2.18.0
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply James.

When i add the above jar file by editing the POM.xml file. i get a error in the pom.xml file. i do not understand why??
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.17.0</version>
</dependency>


i added the above jar file for my Webdriver API's i used. But i do not understand why i am getting the error in pom.xml file
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the error as soon as i edited the pom.xml file as above
 
James Boswell
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linda

People won't be able to help you unless you give specific error details. What is the error you receive?
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its not a specific error. Eclipse shows that pom.xml file has error saying that there is a spelling mistake in few words in the pom.xml even though there is none.

 
James Boswell
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linda

What happens when you run a build using Maven?
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



i am getting a error with the following jar file now.

how can i correct it?

the previous jar file was taken properly.
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



following is the error trace when i do maven install from eclipse. its not able to find that jar!!!
what is the workaround ??
 
James Boswell
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linda

Re-run the install build, thus time with the 'Force Updates' option checked (or -U on the command line if you prefer)
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where is the Force updates option in eclipse?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't run that from Eclipse. Go to the command line and run "mvn -U package" within your project's directory.
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter :-)
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



whenever i clean and try to rebuild i get the above errors?

can somebody help me why i am getting this errors?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try opening the JAR file using the jar utility. Here is an example:

jar -tf C:\Users\prasanna\.m2\repository\com\google\guava\guava\10.0.1\guava-10.0.1.jar

If that is not successful, then the JARs are corrupt. Delete the entire directory containing the artifacts. For example, for the guava JAR, delete C:\Users\prasanna\.m2\repository\com\google\guava\.
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



how can i put the dependency for ScreenRecorder.jar in maven?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used Jarfinder (http://www.jarfinder.com/index.php/java) to look up that class. Jarfinder knows about almost all open source classes. It could not find this class. Unless the owner of the JAR file that contains this class provides instructions on how to access the JAR via a Maven dependency, you will either have to import the JAR into your local Maven repository or deploy the JAR file to Nexus (or some other remote repository server). In my environment, we always do the latter. Oh, look in the JAR and see if there is a META-INF/maven directory; if there is, and you go to the subdirectories you will see the pom.xml which will give you the details about the artifact.

When we do this, we generally use the common package name for all classes in the JAR as the groupId (in your case, this might be "ch.randelshofer.screenrecorder"), and the JAR file name (minus the extension) as the artifactId. We also look at the META-INF/MANIFEST.MF file to see if it contains any version info. If it doesn't, we use the timestamp on the class files as the artifact's version.
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much for this important information.. :-)
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added a Settings.xml file and changed the control to local repository after adding the ScreenRecorder.jar . It worked. Thanks a lot for all your help
 
reply
    Bookmark Topic Watch Topic
  • New Topic