Trying to build with maven: package my.external.package does not exist
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi, I created a maven project and did some coding (yay) which required me to use some libraries that are in any maven repository (:sad:)
so I imported the .jar files of those libraries and did happily code without Eclipse complaining about anything (except for staying up too late).
then now I'm proudly trying to build my very first .war with maven, I run -> maven build... clean package and then I get a whole bunch of errors saying that
[ERROR]
Mojo:
org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile
FAILED for project:
myproject:search:war:0.0.1-SNAPSHOT
Reason:
/Users/me/Documents/myproject/src/main/java/com/mydomain/myclass/myController.java:[17,36] package org.someother.project.package does not exist
what is wrong? How can this be? I'm in despair, save my friday the 13th
so I imported the .jar files of those libraries and did happily code without Eclipse complaining about anything (except for staying up too late).
then now I'm proudly trying to build my very first .war with maven, I run -> maven build... clean package and then I get a whole bunch of errors saying that
[ERROR]
Mojo:
org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile
FAILED for project:
myproject:search:war:0.0.1-SNAPSHOT
Reason:
/Users/me/Documents/myproject/src/main/java/com/mydomain/myclass/myController.java:[17,36] package org.someother.project.package does not exist
what is wrong? How can this be? I'm in despair, save my friday the 13th
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
What are the contents of the myController.java file? Do you have this line:
jean-gobert de coster
Ranch Hand
Posts: 49
posted 16 years ago
more like
I'm not sure I can reference org.someother.project.package in my pom.xml, since that package is not a maven project, it's not in any repository.
my pom.xml looks like this:
What I did do, in the build path of the project, was to link the .jar in which org.someother.project.package is. So I have a symbolic link "lib" source folder in my project.
As I said, Eclipse doesn't seem to mind, however I noticed that I don't have any .class files generated (even though auto build is on).
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Peter Johnson wrote:What are the contents of the myController.java file? Do you have this line:
more like
Somewhere in your pom you are referencing org.someother.project.package, where is that?
I'm not sure I can reference org.someother.project.package in my pom.xml, since that package is not a maven project, it's not in any repository.
my pom.xml looks like this:
What I did do, in the build path of the project, was to link the .jar in which org.someother.project.package is. So I have a symbolic link "lib" source folder in my project.
As I said, Eclipse doesn't seem to mind, however I noticed that I don't have any .class files generated (even though auto build is on).
jean-gobert de coster
Ranch Hand
Posts: 49
posted 16 years ago
the pom.xml in my previous post is that of my war project
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Martijn Verburg wrote:Does your pom.xml for the war project have the built jar as a dependency?
the pom.xml in my previous post is that of my war project
jean-gobert de coster
Ranch Hand
Posts: 49
posted 16 years ago
Is it possible to add that as a directory or do I have to add all the .jar manually one by one?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Martijn Verburg wrote:Sorry, didn't have my coffee yet
In that case you need to add in that 3rd party jar as a dependency in your pom.xml file.
Is it possible to add that as a directory or do I have to add all the .jar manually one by one?
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
You need to add the jar manually, see for assistance, you'll need to install that jar into your local repository however.
Cheers, Martijn,
Twitter.
jean-gobert de coster
Ranch Hand
Posts: 49
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
OK will do
I didn't think of adding them to my local, that's brilliant (and simple) thanks
I didn't think of adding them to my local, that's brilliant (and simple) thanks
jean-gobert de coster
Ranch Hand
Posts: 49
posted 16 years ago
Thanks for the input, I've hear of Nexus before and will definitely take it into consideration. My intent is to convince my boss and co-workers that maven is good for us, but I need to tame the beast if I want to present it
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Martijn Verburg wrote:You'll want to probably be able to do this as a long term solution (your local repo is temporary after all). Nexus and Artifactory are two highly recommended dependency managers to try.
Thanks for the input, I've hear of Nexus before and will definitely take it into consideration. My intent is to convince my boss and co-workers that maven is good for us, but I need to tame the beast if I want to present it

| Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |









In that case you need to add in that 3rd party jar as a dependency in your pom.xml file.