aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes linking my own application jar file to my maven build. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "linking my own application jar file to my maven build." Watch "linking my own application jar file to my maven build." New topic
Author

linking my own application jar file to my maven build.

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hello.

I have created 2 applications:
1. hello-world-service
2. hello-world-service-impl

And then I have created a hello-world-service.jar file for the hello-world-service package in my hello-world application.
I cd into hello-world-service-impl directory and execute the maven command "mvn clean package", it thrown the following exception:



I am wondering how to configure maven to get a local copy of my hello-world-service-SNAPSHOT.jar file, rather than going to grab it from my local repository ?

Thanks
Sam,
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

When you created hello-world-service, did you run "mvn install"? That will place the JAR into your local repository. And the local repository is the proper place for the JAR; that is the only place where Maven will look for it.

How is the hello-world-service declared in its POM? And how is it referenced in the hello-world-service-impl POM? If they are short, please post them. If they are long, please attach them.

Also, it appears that Maven can't find two of the Liferay JARs. Have you configured the build to look in the correct repository for those JARs? (I don't know which repository would have those JARs, you might have to look on the Liferay website. If nothing else you can install the JARs in your local repository.

By the way, have you read this: http://www.sonatype.com/index.php/Support/Books/Maven-The-Complete-Reference


JBoss In Action
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Thank you very much for the quick response and suggestion again.

I have executed mvn install commandline,



It seems ok for building and installing the hello-world-service module.

then having error when I tried to build hello-world-service-impl:



Here is the parent pom.xml file:



pom.xml file for hello-world-service module:



pom.xml file for hello-world-service-impl:



Thanks again
Sam
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

The problem with building hello-world-service-impl is that Maven cannot find the parent POM. Did you build the parent POM using "mvn install"? Doing so will place the parent POM into the local repository so that all the builds can see it.

By the way, where is the parent pom.xml file located? Is it in the same directory as the hello-world-service POM?
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hi Peter,

Your solution works.
Thank you very much indeed for the precise suggestion.

A great help as always.

Thanks
Sam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: linking my own application jar file to my maven build.