Solved

Why external jar's package not  recognised

Posted on 2013-11-15
3
271 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 36

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

Industry Leaders: 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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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

632 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