Solved

Why external jar's package not  recognised

Posted on 2013-11-15
3
262 Views
Last Modified: 2013-12-16
I have added external jar to my project. upon maven package or install i get a error that :
package com.iess.son.common.data.alarm does not exist.

My code is using a class file under that package. In editor i do not see any compilation error.
0
Comment
Question by:pvinodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
Manish earned 250 total points
ID: 39650833
You can put that in local mavenrepository and entry in pom.xml.
0
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 250 total points
ID: 39655169
I have added external jar to my project
That sounds like you are adding it via the Eclipse IDE's "Build Path" dialog box? Is that correct?  If so, then that is the reason for the error. You are telling Eclipse about the JAR and so you AREN'T getting any errors in Eclipse, but maven is a different thing. It doesn't look at Eclipse's build path, it just looks at what dependencies that you have set in your pom.xml file. So when you are building/installing/packaging via maven that jar isn't being included.

You need to follow @karanw's brief advice and install the jar to your local repository. If the jar is owned by you and it too is a maven project, then by doing a "maven install" on that project should get it into your local repository. Otherwise you can run the following command...
mvn install:install-file -Dfile=<path-to-jar-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=jar

Open in new window

(Replacing all the <xxx> values with appropriate values for the jar file path and maven groupId, artifactId and version values that you decide on.) Then add a new <dependency> element into you pom.xml which references that above maven groupId, artifactId and version values that you have chosen.
0
 

Author Closing Comment

by:pvinodp
ID: 39723191
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
add projects t working set in maven 2 72
Bot application - advice 3 81
spring maven example issues 3 110
Java import explained 4 49
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question