• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

linking my own application jar file to my maven build.

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,

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

A great help as always.

Thanks
Sam
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote: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?



Hi
I am writing these few lines to find out whether i can use my execuable jar  
to deploy in a java server and if so how to write the command to upload  my jar file into the server
Since the pom and executable jar are ok.
please help on the same lines as you explained for hellworld .jar as per qoute
Thanks
CRMK
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic