Solved

Why external jar's package not  recognised

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
javap bin 2 41
more than one jdk and one jre 1 50
servlet web applications   metadata-complete="true" or false 3 132
mysql jsp example issue 32 53
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

821 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