Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Maven repository

 
Ranch Hand
Posts: 124
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In POM.xml, how do I set up dependancies for the already exisitng libraries (.jar) withoout 'maven's dependancy structure' ?
For example I am using Jdom. jar and I have this jar file in my local repostitory, but maven looks for it in its m2/repository location with groupId and artifactId structure (Which I am unaware of). Simply pointing to the jar doesnt work. Hope I explained it right.
Thanks
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Short answer is you shouldn't. Maven expects your dependencies to be in your local repository. Is there a reason why your dependency can't go into the repository? It should automatically download it from central...
 
Saloon Keeper
Posts: 23692
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can include jars in a Maven project that aren't in the repository, but in that case, you don't define them as a dependency in the pom, you define them as included resources.

However, it's better to install them in a repository, unless they are unique to the project. That way everything's in one place and easier to manage.
 
Sachin Patil
Ranch Hand
Posts: 124
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys for the reply.
I did install it using maven's file-install command and its working now.
I have one more problem though (apologies for stretching it but trust me I am asking questions after searching the answers by myself), How do I compile jsps through maven? (I tried compile option in build and plugins. didnt work)
Moreover, I get this strange message 'sun.net.smtp.SmtpClient is Sun proprietary API and may be removed in a future release' for one of the java class.
Help will be much appreciated.
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is that there is a Maven2 JSPC plugin you can use to precompile JSPs. As for the warning, it's basically saying that you are directly (or perhaps indirectly) using a class within the JDK that is likely to be ripped out entirely in a future version. I would try to find an alternative if possible.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sachin,

Yes, you can use the codehaus jspc-maven-plugin to precompile your JSPs.

A couple examples of using jspc-maven-plugin can be found at:
http://www.avajava.com/tutorials/lessons/how-do-i-precompile-my-jsps.html
http://www.avajava.com/tutorials/lessons/how-do-i-precompile-my-jstl-jsps.html

Hope that helps,
Edwin
 
Sachin Patil
Ranch Hand
Posts: 124
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks folks again for the help. Apreciated. Thanks Edwin for examples.
I have got it working. Have explored a lot (Maven) these couple of weeks and learnt much and will try to share amongst ranchers if required.
Thanks again. No place like ranch to get help.
cheers
Sachin
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic