You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Philipp Kraus <ph...@tu-clausthal.de> on 2016/05/25 20:14:31 UTC

deployment to local repository

Hello,

I’m working on my first Maven framework, I would like to test the framework in another project,
so I build a jar file with „mvn package", and then I install the jar into my local repository with „mvn install:install-file -Dfile=myjar.jar“.

I can use the package in another project with a dependency entry, but my framework has got different dependencies e.g. to AntLR, Guava
or Apache Commons, but in my project the dependencies are not found.

The pom of the framework is defined with:

<groupId>mygroup</groupId>
<artifactId>framework</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>

and the project has got

<dependency>
    <groupId>mygroup</groupId>
    <artifactId>framework</artifactId>
    <version>0.1-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>

IMHO I create a incomplete pom.xml on my framework, but I don’t know how I can create it with the correct
way, so I can deploy the framework to my local repository only for testing-case. Two other test projects should
use this deployed framework.

Can you help me to create a correct pom.xml?

Thanks for help

Phil

Re: deployment to local repository

Posted by Philipp Kraus <ph...@tu-clausthal.de>.
Hi,


Am 25.05.2016 um 23:26 schrieb Adrien Rivard <ad...@gmail.com>:

> Hello,
> 
> On Wed, May 25, 2016 at 10:14 PM, Philipp Kraus <
> philipp.kraus@tu-clausthal.de> wrote:
> 
>> Hello,
>> 
>> I’m working on my first Maven framework, I would like to test the
>> framework in another project,
>> so I build a jar file with „mvn package", and then I install the jar into
>> my local repository with „mvn install:install-file -Dfile=myjar.jar“.
>> 
>> 
> When you have the project source, you should do "mvn install" and not "mvn
> install:install-file -Dxxxxx", it will take the right
> parameters(groupId/artifactid/version ...)  from the project pom.

thanks that was my mistake. I have got the sources and I run „mvn package“, not „mvn install“.
With install everything works fine

Phil

Re: deployment to local repository

Posted by Adrien Rivard <ad...@gmail.com>.
Hello,

On Wed, May 25, 2016 at 10:14 PM, Philipp Kraus <
philipp.kraus@tu-clausthal.de> wrote:

> Hello,
>
> I’m working on my first Maven framework, I would like to test the
> framework in another project,
> so I build a jar file with „mvn package", and then I install the jar into
> my local repository with „mvn install:install-file -Dfile=myjar.jar“.
>
>
When you have the project source, you should do "mvn install" and not "mvn
install:install-file -Dxxxxx", it will take the right
parameters(groupId/artifactid/version ...)  from the project pom.



> I can use the package in another project with a dependency entry, but my
> framework has got different dependencies e.g. to AntLR, Guava
> or Apache Commons, but in my project the dependencies are not found.
>
> The pom of the framework is defined with:
>
> <groupId>mygroup</groupId>
> <artifactId>framework</artifactId>
> <version>0.1-SNAPSHOT</version>
> <packaging>jar</packaging>
>
> and the project has got
>
> <dependency>
>     <groupId>mygroup</groupId>
>     <artifactId>framework</artifactId>
>     <version>0.1-SNAPSHOT</version>
>     <scope>compile</scope>
> </dependency>
>
>
I am not sure to understand, do you have a problem with the framework
dependency (those pom snippets look good), or with AntLR, Guava
dependencies ? in that case did you/how did you declared them?



> IMHO I create a incomplete pom.xml on my framework, but I don’t know how I
> can create it with the correct
> way, so I can deploy the framework to my local repository only for
> testing-case. Two other test projects should
> use this deployed framework.
>
> Can you help me to create a correct pom.xml?
>
>
Additional note, if those projects are used to test the framework, they
probably should be in the same multiproject.


> Thanks for help
>
> Phil
>



-- 
Adrien Rivard

Re: deployment to local repository

Posted by Manfred Moser <ma...@simpligility.com>.
Do not use install-file and package like that.

Just run

mvn install

that will package the jar and install the jar and pom into the local repo. That way the dependency info in the pom will not get lost.

manfred

Philipp Kraus wrote on 2016-05-25 13:14:

> Hello,
> 
> I\u2019m working on my first Maven framework, I would like to test the framework
> in another project,
> so I build a jar file with \u201emvn package", and then I install the jar into my
> local repository with \u201emvn install:install-file -Dfile=myjar.jar\u201c.
> 
> I can use the package in another project with a dependency entry, but my
> framework has got different dependencies e.g. to AntLR, Guava
> or Apache Commons, but in my project the dependencies are not found.
> 
> The pom of the framework is defined with:
> 
> <groupId>mygroup</groupId>
> <artifactId>framework</artifactId>
> <version>0.1-SNAPSHOT</version>
> <packaging>jar</packaging>
> 
> and the project has got
> 
> <dependency>
>    <groupId>mygroup</groupId>
>    <artifactId>framework</artifactId>
>    <version>0.1-SNAPSHOT</version>
>    <scope>compile</scope>
> </dependency>
> 
> IMHO I create a incomplete pom.xml on my framework, but I don\u2019t know how I
> can create it with the correct
> way, so I can deploy the framework to my local repository only for
> testing-case. Two other test projects should
> use this deployed framework.
> 
> Can you help me to create a correct pom.xml?
> 
> Thanks for help
> 
> Phil
> 


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