• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Install 3rd party jars

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a 3rd party jar I need to install to my local repository. I followed the instructions here:
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
and the jar installed to my local repository just fine.
When I try to build my project it pulls the jar but then gives me an error about the pom file missing.
Can someone give me some pointers about how to get around this error? Do I need to code a pom for each of 3rd party jar that I install?
Eventually I'll deploy the jar to the our remote repo, but for now I just want to get it working locally.

Sincerely

Kev.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The plugin should have created the pom for you: what's in the repo?
 
Kevin Eddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the path to the jar I'm installing is this:
C:\LocalRepository\spring\j2ee\mail\spring-mail\0.0.0
inside of that is spring-mail-0.0.0.jar and no pom.

Here is the exact command i used.
mvn install:install-file -Dfile=spring-framework-2.5.5\lib\j2ee\mail.jar -DgroupId=spring.j2ee.mail -DartifactId=spring-mail -Dversion=0.0.0 -Dpackaging=jar

my version of maven is:
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_16
Java home: C:\Program Files\Java\jdk1.6.0_16\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

my version of the install plugin is:
Name: Maven Install Plugin
Description: Copies the project artifacts to the user's local repository.
Group Id: org.apache.maven.plugins
Artifact Id: maven-install-plugin
Version: 2.3.1
Goal Prefix: install

I opened up the jar with 7zip and everything looks normal there so the jar is being installed to the localRepository.
David, I too read that the pom is supposed to be auto generated. Is there a version conflict or something happening here?

Thanks,

Kevin.

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The pom would be in the repository, not in the jar. I find it unlikely to be a version issue, because unless you explicitly state what version of something you want to use it's going to use the latest (in other words, I'm using the same version of Maven2, same install plugin version, and even the same Java version, though on Linux).

I'm not sure what to tell you; I've run similar installs countless times across Linux, Windows, and OS X without issue.

Perhaps posting the actual error would be a good idea.
 
Kevin Eddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David, I wasn't suggesting the pom would be in the jar. Thanks for taking the time to reply. Sincerely appreciated.

I put -DgeneratePom=true on the end of the command above and the pom was generated.

So, to replicate the problem I was having regarding pom generation, I deleted the spring/j2ee/mail directory which wiped out the jar and pom. Reissued my original command without -DgenereatePom=true. I looked in my local repo, checked the spring/j2ee/mail/spring-mail, found maven-metadata-local.xml and a folder named 0.0.0. Inside 0.0.0 was only a single jar named mail.jar and no pom.

I then ran a clean and build in netbeans, here is the dump.

NetBeans: Executing 'mvn.bat -Dnetbeans.execution=true clean install'
NetBeans: JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
Scanning for projects...
------------------------------------------------------------------------
Building solr-maven
task-segment: [clean, install]
------------------------------------------------------------------------
[clean:clean]
[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\workspace\solr-maven\src\main\resources
Downloading: http://dis.local/repo/spring/j2ee/mail/spring-mail/0.0.0/spring-mail-0.0.0.pom
Unable to find resource 'spring.j2ee.mail:spring-mail:pom:0.0.0' in repository remoteRepo (http://dis.local/repo)
Downloading: http://dis.local/opt/snapshotRepo/spring/j2ee/mail/spring-mail/0.0.0/spring-mail-0.0.0.pom
Unable to find resource 'spring.j2ee.mail:spring-mail:pom:0.0.0' in repository remoteSnapshotRepo (http://dis.local/opt/snapshotRepo)
Downloading: http://repo1.maven.org/maven2/spring/j2ee/mail/spring-mail/0.0.0/spring-mail-0.0.0.pom
Unable to find resource 'spring.j2ee.mail:spring-mail:pom:0.0.0' in repository central (http://repo1.maven.org/maven2)
[compiler:compile]
Compiling 8 source files to C:\workspace\solr-maven\target\classes
[resources:testResources]
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\workspace\solr-maven\src\test\resources
[compiler:testCompile]
Compiling 1 source file to C:\workspace\solr-maven\target\test-classes
[surefire:test]
Surefire report directory: C:\workspace\solr-maven\target\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running ok.tax.gov.solr.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[jar:jar]
Building jar: C:\workspace\solr-maven\target\solr-maven-1.0-SNAPSHOT.jar
[install:install]
Installing C:\workspace\solr-maven\target\solr-maven-1.0-SNAPSHOT.jar to c:\LocalRepository\blah\blah\left this out\
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 4 seconds
Finished at: Wed Aug 11 09:07:09 CDT 2010
Final Memory: 20M/36M
------------------------------------------------------------------------

Although it says build successful, there's a lot of dependencies I have on apache poi etc, that Netbeans is telling me that it can't find.

for example this class: NoPropertySetStreamException
which I have defined in the pom here

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.6</version>
</dependency>

lol, geeze, this is getting weirder as I go. By the way, I know these jar's are correct as I'm converting this existing project to maven.
I used this link http://www.jarvana.com/jarvana/digest-check to get the dependency settings for the apache poi stuff.

Any suggestions are most welcome. I can't spend to much time on trying to convert this project. I really really really want it to be a maven project though.

Kev.

 
Kevin Eddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I pulled my maven project up in Netbeans 6.7.1 and the dependency issues regarding apache poi have vanished. The problems I was experiencing regarding dependencies seemed to be specific to Netbeans 6.9.1. I apologize for not realizing this earlier. Hopefully, this info will be helpful to someone else. And if anyone can confirm they are having the same problems with 6.9.1, please do so.

However, the auto generated pom issue is still a mystery. I still have to explicitly state -DgeneratePom=true.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're having problems with NetBeans, post a question in the IDE forum--that kind of issue would be related to Maven/NetBeans integration, not Maven itself.
 
Kevin Eddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem with netbeans mentioned above was just something I noticed as I was working on my project. My issue with the generatePom not defaulting to true still stands. I'm using windows xp. I ran the install command from the dos prompt. I replicated the issue several times yesterday. Could there be a setting in the super pom that I'm unaware of that could be causing the issue? If I wasn't the only java guy in the shop, I'd ask someone else to try the same command on their machine. But I'm a Lone Ranger here. So I have no basis for comparison.

Kevin.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic