You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tim O'Brien <to...@discursive.com> on 2009/07/30 01:17:51 UTC

Re: How to install jars into local maven repo (with $mvn ) - want to configure init profile in pom.xml

On Wed, Jul 29, 2009 at 6:06 PM, jvsrvcs<jv...@gmail.com> wrote:
>
>
> I want to create a maven profile called "init", such
> that a person would type:   $mvn init

This won't work, Maven has a lifecycle that consists of phases when
you execute "mvn init", Maven is going to complain because there is no
"init" phase.   What you need to do is configure a goal execution to
execute during one of the phases in the Maven build lifecycle:

http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

>
> and this profile would take jars from the lib/ directory
> (on the same level as the pom.xml)
> and install every jar in the lib (and subdirectories)
> into the local maven repo only.
>

You are looking to use the Maven Install plugin, but take a step back
before you decide to do this with Maven.   The goal you want to run is
here: http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
- but Maven isn't going to be able to traverse the lib directory and
deploy every single file recursively.    It wasn't designed to do
this, and my advice is not to attempt to try to get Maven to do this.
 One Maven project, produces one artifact.

Do this using the Maven Ant Tasks, better yet... do this with a Groovy
script that calls out to the Maven Ant Tasks.

> I have many docs on maven profiles, but no good
> examples on integrating that with another plugin
> where I could use XML (pom.xml) to configure and install
> jars to the local repo.
>
> if anyone has done this and has a code sample
> they can post please send.  I have read all
> the docs that are available on the subject
> and do not need to be pointed there
> as I have read and googled all the
> documentation for about 3 hrs with
> no resolution.
>
> What I am looking for is the ability to type
>        $mvn init
>
> and have all jars under lib/ get installed to
> the local maven repo (and all /lib/<dir>/*.jar
> and so on.
>
> thank you for your assistance
> --
> View this message in context: http://www.nabble.com/How-to-install-jars-into-local-maven-repo-%28with-%24mvn-%3Ctarget%3E%29---want-to-configure-init-profile-in-pom.xml-tp24729720p24729720.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: How to install jars into local maven repo (with $mvn ) - want to configure init profile in pom.xml

Posted by jvsrvcs <jv...@gmail.com>.
I guess I meant to say I want to run:
  $mvn -P init

to run an init profile (I understand about build life cycles and do not want
to write a new one)
but rather want to type $mvn -P init

and have specific already built .jar files in /lib/*.jar to be installed
into my local repo.  These jars are not available in any public maven
repository.

thanks

jvsrvcs


Tim O'Brien wrote:
> 
> On Wed, Jul 29, 2009 at 6:06 PM, jvsrvcs<jv...@gmail.com> wrote:
>>
>>
>> I want to create a maven profile called "init", such
>> that a person would type:   $mvn init
> 
> This won't work, Maven has a lifecycle that consists of phases when
> you execute "mvn init", Maven is going to complain because there is no
> "init" phase.   What you need to do is configure a goal execution to
> execute during one of the phases in the Maven build lifecycle:
> 
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> 
>>
>> and this profile would take jars from the lib/ directory
>> (on the same level as the pom.xml)
>> and install every jar in the lib (and subdirectories)
>> into the local maven repo only.
>>
> 
> You are looking to use the Maven Install plugin, but take a step back
> before you decide to do this with Maven.   The goal you want to run is
> here:
> http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
> - but Maven isn't going to be able to traverse the lib directory and
> deploy every single file recursively.    It wasn't designed to do
> this, and my advice is not to attempt to try to get Maven to do this.
>  One Maven project, produces one artifact.
> 
> Do this using the Maven Ant Tasks, better yet... do this with a Groovy
> script that calls out to the Maven Ant Tasks.
> 
>> I have many docs on maven profiles, but no good
>> examples on integrating that with another plugin
>> where I could use XML (pom.xml) to configure and install
>> jars to the local repo.
>>
>> if anyone has done this and has a code sample
>> they can post please send.  I have read all
>> the docs that are available on the subject
>> and do not need to be pointed there
>> as I have read and googled all the
>> documentation for about 3 hrs with
>> no resolution.
>>
>> What I am looking for is the ability to type
>>        $mvn init
>>
>> and have all jars under lib/ get installed to
>> the local maven repo (and all /lib/<dir>/*.jar
>> and so on.
>>
>> thank you for your assistance
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-install-jars-into-local-maven-repo-%28with-%24mvn-%3Ctarget%3E%29---want-to-configure-init-profile-in-pom.xml-tp24729720p24729720.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-install-jars-into-local-maven-repo-%28with-%24mvn-%3Ctarget%3E%29---want-to-configure-init-profile-in-pom.xml-tp24729720p24739591.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: How to install jars into local maven repo (with $mvn ) - want to configure init profile in pom.xml

Posted by jvsrvcs <jv...@gmail.com>.
I'm not sure that the mvn install is what I need.  It looks like you have to
run mvn install <options> such that all of the options are on the command
line.

I do not want to write a script, but rather a maven profile that will
execute to install all the jars into the local repository.

I have seen this done before.  In other words, I want all the <options>
inside the xml file and not in a bash script, which is what initially the
install plugin only has to offer.

any help or ideas would be appreciated.

thanks



Tim O'Brien wrote:
> 
> On Wed, Jul 29, 2009 at 6:06 PM, jvsrvcs<jv...@gmail.com> wrote:
>>
>>
>> I want to create a maven profile called "init", such
>> that a person would type:   $mvn init
> 
> This won't work, Maven has a lifecycle that consists of phases when
> you execute "mvn init", Maven is going to complain because there is no
> "init" phase.   What you need to do is configure a goal execution to
> execute during one of the phases in the Maven build lifecycle:
> 
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> 
>>
>> and this profile would take jars from the lib/ directory
>> (on the same level as the pom.xml)
>> and install every jar in the lib (and subdirectories)
>> into the local maven repo only.
>>
> 
> You are looking to use the Maven Install plugin, but take a step back
> before you decide to do this with Maven.   The goal you want to run is
> here:
> http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
> - but Maven isn't going to be able to traverse the lib directory and
> deploy every single file recursively.    It wasn't designed to do
> this, and my advice is not to attempt to try to get Maven to do this.
>  One Maven project, produces one artifact.
> 
> Do this using the Maven Ant Tasks, better yet... do this with a Groovy
> script that calls out to the Maven Ant Tasks.
> 
>> I have many docs on maven profiles, but no good
>> examples on integrating that with another plugin
>> where I could use XML (pom.xml) to configure and install
>> jars to the local repo.
>>
>> if anyone has done this and has a code sample
>> they can post please send.  I have read all
>> the docs that are available on the subject
>> and do not need to be pointed there
>> as I have read and googled all the
>> documentation for about 3 hrs with
>> no resolution.
>>
>> What I am looking for is the ability to type
>>        $mvn init
>>
>> and have all jars under lib/ get installed to
>> the local maven repo (and all /lib/<dir>/*.jar
>> and so on.
>>
>> thank you for your assistance
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-install-jars-into-local-maven-repo-%28with-%24mvn-%3Ctarget%3E%29---want-to-configure-init-profile-in-pom.xml-tp24729720p24729720.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-install-jars-into-local-maven-repo-%28with-%24mvn-%3Ctarget%3E%29---want-to-configure-init-profile-in-pom.xml-tp24729720p24739589.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