Solved

Why external jar's package not  recognised

Posted on 2013-11-15
3
241 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
Comment Utility
You can put that in local mavenrepository and entry in pom.xml.
0
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 250 total points
Comment Utility
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
Comment Utility
thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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 …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now