You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by vvkbtnkr <vv...@yahoo.com> on 2012/01/13 05:51:25 UTC

Help with installing a non-maven jar in local repo .

I am trying to install a jar into my local repo by using pom.xml, and just so
no one in my team may need to manually install the jar into local repo, I am
using the approach outlined here:
http://stackoverflow.com/questions/6571022/is-it-best-to-mavenize-your-project-jar-files-or-put-them-in-web-inf-lib/6592613#6592613
auto install of jars . 


However, for some reason this is not working for me. I keep getting this
error  on running mvn clean install -


On running mvn -U clean install, i get this error: 


its still looking for the jar in central repo, whereas I expect it to be
picked up from my local repo. 

Relevant portions from my pom.xml: 





What is it that I am doing wrong here? 


Thanks, 
V

--
View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7182923.html
Sent from the maven users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with installing a non-maven jar in local repo .

Posted by Ron Wheeler <rw...@artifact-software.com>.
I think that you can install the Nexus on your own machine where you are 
doing the test.

You have to remember that your first level dependencies also have 
dependencies and you may want to include a dependency and exclude some 
of the dependencies that it has (so called transitive dependencies)

ie if
a) your project depends on artifact xyz.com:common_library:1.2 and 
abc.com:utilities:6.4
  and
b) xyz.com:common_library has a dependency on abc.com:utilities:4.7
then your total dependency tree has 2 versions of abc.com:utilities 
requested.

In your reference to xyz.com:common_library should also include an 
exclude on abc.com:utilities so that maven does not try to add version 
4.7 to your package.

Not sure if this is what is happening but that is very common. Maven 
will tell you that you have conflicts like this.

Ron


On 13/01/2012 1:24 PM, vvkbtnkr wrote:
> Thanks all for responding on this, I think  I see the logic behind the common
> theme of the responses. I expected to mavenize the POC in a jiffy, but far
> from it, have spent the max time now on getting it to any reasonable shape,
> And the worst part is I am not even close to solving all issues , getting a
> clean standalone jar to experiment on!!!
>
> Instead of trying to get ops (we thought the repo has to be central so had
> to get the ops involved and all )  to give us a machine to install the repo
> manager to be used as a real "central" repo, we manually installed the
> non-maven jar on our local(stop gap arrangement). And now we are struggling
> with the wrong version of a particular jar being included in the final
> installed jar, even though in my pom.xml I am referring to the correct
> version. Seems like the Shade plugin is somewhere prioritizing the wrong
> jar, completely ignoring the version in my pom.xml and ends up packaging the
> wrong version.  Been struggling with this now, and may be this might be my
> next question on forum pretty soon.
>
> I know I am talking to the maven experts, so cannot really curse this tool,
> but at least my initial experience has been very rough.
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7185027.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Help with installing a non-maven jar in local repo .

Posted by Ron Wheeler <rw...@artifact-software.com>.
I am not sure if I would be described as an expert.
Survivor is more like it.

Some of the guys that are trying to help you out do deserve the moniker.

Ron

On 13/01/2012 1:24 PM, vvkbtnkr wrote:
> Thanks all for responding on this, I think  I see the logic behind the common
> theme of the responses. I expected to mavenize the POC in a jiffy, but far
> from it, have spent the max time now on getting it to any reasonable shape,
> And the worst part is I am not even close to solving all issues , getting a
> clean standalone jar to experiment on!!!
>
> Instead of trying to get ops (we thought the repo has to be central so had
> to get the ops involved and all )  to give us a machine to install the repo
> manager to be used as a real "central" repo, we manually installed the
> non-maven jar on our local(stop gap arrangement). And now we are struggling
> with the wrong version of a particular jar being included in the final
> installed jar, even though in my pom.xml I am referring to the correct
> version. Seems like the Shade plugin is somewhere prioritizing the wrong
> jar, completely ignoring the version in my pom.xml and ends up packaging the
> wrong version.  Been struggling with this now, and may be this might be my
> next question on forum pretty soon.
>
> I know I am talking to the maven experts, so cannot really curse this tool,
> but at least my initial experience has been very rough.
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7185027.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Help with installing a non-maven jar in local repo .

Posted by vvkbtnkr <vv...@yahoo.com>.
Thanks all for responding on this, I think  I see the logic behind the common
theme of the responses. I expected to mavenize the POC in a jiffy, but far
from it, have spent the max time now on getting it to any reasonable shape,
And the worst part is I am not even close to solving all issues , getting a
clean standalone jar to experiment on!!!  

Instead of trying to get ops (we thought the repo has to be central so had
to get the ops involved and all )  to give us a machine to install the repo
manager to be used as a real "central" repo, we manually installed the
non-maven jar on our local(stop gap arrangement). And now we are struggling
with the wrong version of a particular jar being included in the final
installed jar, even though in my pom.xml I am referring to the correct
version. Seems like the Shade plugin is somewhere prioritizing the wrong
jar, completely ignoring the version in my pom.xml and ends up packaging the
wrong version.  Been struggling with this now, and may be this might be my
next question on forum pretty soon. 

I know I am talking to the maven experts, so cannot really curse this tool,
but at least my initial experience has been very rough.

--
View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7185027.html
Sent from the maven users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with installing a non-maven jar in local repo .

Posted by Ron Wheeler <rw...@artifact-software.com>.
We use Nexus and it is well worth the hour to set it up.
RTFM carefully since the file setup is a bit different from what you 
might expect but if you do what it says, you will get it up very fast.
It will save you the hour in the first day that you work on your POC.
It will also make sure that your POC project is actually relevant. No 
point trying a POC that fails because you are missing a crucial part of 
the solution.
Just because the Maven project does not include the repo side, does not 
mean that it is intended to be used without one.
It just means that Maven does not care which repo you use. Pick one of 
the 3 available products.

Trust me (and everyone else that has responded to you) Maven without a 
repo is hell. You are only hitting the first of many issues that will 
plague your project if you try to run with only part of the environment.

You might as well do a proper POC with all the parts.
Ron

On 13/01/2012 8:34 AM, Stephen Connolly wrote:
> Step 1. Download Nexus OSS (i.e. free)
> Step 2. Run Nexus
> Step 3. Configure your settings.xml to point to Nexus
>
> Done. Done. Done.
>
> NOTE 1: Does not have to be Nexus, there are others: Artifactory,
> Archivia, etc. I only mention Nexus OSS because: 1. it's free, 2. it's
> very low footprint in terms of memory.
>
> NOTE 2: Artifactory provide a 30 day free trial of cloud based repo
> hosting if you don't want to manage your own repo manager yourself. I
> only mention Artifactory because I know they have cloud based repo
> hosting.
>
> NOTE 3: I work for CloudBees, not Sonatype nor JFrog. My opinions are
> my own and not those of my employers
>
> On 13 January 2012 13:03, vvkbtnkr<vv...@yahoo.com>  wrote:
>> I am aware of the repo manager concept, but setting it  up is more work than
>> what I want for the quick-fire poc that I am working on, would be reaally
>> helpful if some one can point out the mistake in the pom snippet posted
>> earlier and help me fix that ...
>>
>> --
>> View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7183920.html
>> Sent from the maven users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Help with installing a non-maven jar in local repo .

Posted by Stephen Connolly <st...@gmail.com>.
Step 1. Download Nexus OSS (i.e. free)
Step 2. Run Nexus
Step 3. Configure your settings.xml to point to Nexus

Done. Done. Done.

NOTE 1: Does not have to be Nexus, there are others: Artifactory,
Archivia, etc. I only mention Nexus OSS because: 1. it's free, 2. it's
very low footprint in terms of memory.

NOTE 2: Artifactory provide a 30 day free trial of cloud based repo
hosting if you don't want to manage your own repo manager yourself. I
only mention Artifactory because I know they have cloud based repo
hosting.

NOTE 3: I work for CloudBees, not Sonatype nor JFrog. My opinions are
my own and not those of my employers

On 13 January 2012 13:03, vvkbtnkr <vv...@yahoo.com> wrote:
> I am aware of the repo manager concept, but setting it  up is more work than
> what I want for the quick-fire poc that I am working on, would be reaally
> helpful if some one can point out the mistake in the pom snippet posted
> earlier and help me fix that ...
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7183920.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with installing a non-maven jar in local repo .

Posted by Guillaume Polet <gu...@gmail.com>.
What you are trying to do does not seem possible (at least the first 
time). Remove the dependency first, then do the install, then re-add the 
dependency. And you are good to go, but this is really against all good 
practices.

Cheers,
Guillaume


Le 13/01/2012 14:03, vvkbtnkr a écrit :
> I am aware of the repo manager concept, but setting it  up is more work than
> what I want for the quick-fire poc that I am working on, would be reaally
> helpful if some one can point out the mistake in the pom snippet posted
> earlier and help me fix that ...
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7183920.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with installing a non-maven jar in local repo .

Posted by vvkbtnkr <vv...@yahoo.com>.
I am aware of the repo manager concept, but setting it  up is more work than
what I want for the quick-fire poc that I am working on, would be reaally
helpful if some one can point out the mistake in the pom snippet posted
earlier and help me fix that ... 

--
View this message in context: http://maven-users.828.n2.nabble.com/Help-with-installing-a-non-maven-jar-in-local-repo-tp7182923p7183920.html
Sent from the maven users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with installing a non-maven jar in local repo .

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Jan 13, 2012 at 3:21 PM, vvkbtnkr <vv...@yahoo.com> wrote:
> I am trying to install a jar into my local repo by using pom.xml, and just so
> no one in my team may need to manually install the jar into local repo, I am
> using the approach outlined here:
> http://stackoverflow.com/questions/6571022/is-it-best-to-mavenize-your-project-jar-files-or-put-them-in-web-inf-lib/6592613#6592613
> auto install of jars .
>
>
> However, for some reason this is not working for me. I keep getting this
> error  on running mvn clean install -
>
>
> On running mvn -U clean install, i get this error:
>
>
> its still looking for the jar in central repo, whereas I expect it to be
> picked up from my local repo.
>
> Relevant portions from my pom.xml:
>
>
>
>
>
> What is it that I am doing wrong here?
>
>
> Thanks,
> V

Please dont use the Nabble list to send emails.
As you can see - it strips the information because its XML.

Just subscribe to the list, post your question, get your answer, and
unsubscribe.

The short answer to your problem is that you should be using a Maven
Repository Manager (MRM).
Please read http://maven.apache.org/repository-management.html.

You have a team of people, and you have non-open source libraries that
need to be shared.
You do not want to deal with the pain of manually installing these
into every developers local repository.
You upload this artifact once to your MRM and then everyone downloads
it like normal.
Plus once you have a MRM installed it will act as a local proxy and
will drastically speed up your intial seeding of the ~/.m2/repository.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org