You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jvsrvcs <jv...@gmail.com> on 2009/07/30 16:50:38 UTC

How to use mvn install but have all options in the pom.xml?

The docs on the mvn install plugin state:

mvn install:install-file -Dfile=your-artifact-1.0.jar \
                         [-DpomFile=your-pom.xml] \
                         [-Dsources=src.jar] \
                         [-Djavadoc=apidocs.jar] \
                         [-DgroupId=org.some.group] \
                         [-DartifactId=your-artifact] \
                         [-Dversion=1.0] \
                         [-Dpackaging=jar] \
                         [-Dclassifier=sources] \
                         [-DgeneratePom=true] \
                         [-DcreateChecksum=true]

So I could build a bash shell script that executes the above $mvn install
command for each jar that I want to install into the local repo.

What I want to do is to put all the options above into a pom.xml such that
the user would only have to run a single maven profile and type only:
   $mvn -P init

and have this profile run the  install plugin run on each of about 20 dot
jar files in lib/.

I have seen this done before on a project but did not write the code nor do
I have a copy of the code with me.  I know it is possible but can't find any
documentation on how to put options to $mvn install inside the pom.xml file
(instead of the command line).
-- 
View this message in context: http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24739597.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 use mvn install but have all options in the pom.xml?

Posted by Alexander <th...@gmail.com>.
Ow, I got it.

2009/7/31 Edelson, Justin <Ju...@mtvstaff.com>

> build-helper:attach-artifacts attaches artifacts to the build, i.e. so
> that they will be installed/deployed at the appropriate stage. This is
> almost the opposite of that - the artifacts are dependencies of the
> project, not part of the output of it.
>
> Justin
>
> ________________________________
>
> From: Alexander [mailto:the.malkolm@gmail.com]
> Sent: Thursday, July 30, 2009 3:47 PM
> To: Maven Users List
> Subject: Re: How to use mvn install but have all options in the pom.xml?
>
>
> Hello,
>
> Have you looked at builder-helper plugin? Seems like attach-artifacts
> goal exactly what you need. Am I wrong?
>
> 2009/7/31 jvsrvcs <jv...@gmail.com>
>
>
>
>        Another things is that we plan to open source the product and
> post the code
>        on a website.
>        People that download will need to build the product.  We are not
> going to
>        put our repo manager out there for the world to use.
>
>        this requirement makes configuring a pom like this a necessity.
> Ideally it
>        would be nice to have some of these jars on a maven repo but
> with some of
>        them, it's simply not going to happen.
>
>        thanks
>
>
>
>
>        Tim O'Brien wrote:
>        >
>        > On Thu, Jul 30, 2009 at 1:23 PM, jvsrvcs<jv...@gmail.com>
> wrote:
>        >>
>        >> Thanks, the reason we are doing this is because:
>        >>
>        >> 1.  We have a lot of new programmers coming on board (10)
> that need to
>        >> quickly setup their local repo
>        >
>        > Use a repository manager.   Distribute a settings.xml file.
>        >
>        >> 2.  Many of these programmers/consultants are bash
> handicapped and don't
>        >> have cygwin installed
>        >> 3.  Doing it locally first is better than getting from a repo
> (and we can
>        >> use this init to provision the repo
>        >> once and will have it should we need to do it again).
>        >>
>        >> I appreciate the help and will give it a spin.
>        >>
>        >> thanks
>        >>
>        >> jv
>        >>
>        >> justinedelson wrote:
>        >>>
>        >>> It's no different than any other plugin. Something like this
> should
>        >>> work:
>        >>>
>        >>>             <plugin>
>        >>>                 <groupId>org.apache.maven.plugins</groupId>
>        >>>
> <artifactId>maven-install-plugin</artifactId>
>        >>>                 <executions>
>        >>>                     <execution>
>        >>>                         <id>install-1</id>
>        >>>                         <phase>generate-sources</phase>
>        >>>                         <goals>
>        >>>                             <goal>install-file</goal>
>        >>>                         </goals>
>        >>>                               <configuration>
>        >>>
> <artifactId>blah</artifactId>
>        >>>
> <groupId>blah</groupId>
>        >>>                                       <version>v</version>
>        >>>
> <file>lib/somefile.jar</file>
>        >>>                               </configuration>
>        >>>                         </execution>
>        >>>                     ...repeat...
>        >>>                       </executions>
>        >>>               </plugin>
>        >>>
>        >>> I don't think this is particularly common because a) it's
> very verbose
>        >>> compared with doing it on the command line and b)
> install-file only
>        >>> needs to be run once, so including it in the build isn't
> necessary.
>        >>>
>        >>> Justin
>        >>>
>        >>>
>        >>> -----Original Message-----
>        >>> From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>        >>> Sent: Thursday, July 30, 2009 10:51 AM
>        >>> To: users@maven.apache.org
>        >>> Subject: How to use mvn install but have all options in the
> pom.xml?
>        >>>
>        >>>
>        >>> The docs on the mvn install plugin state:
>        >>>
>        >>> mvn install:install-file -Dfile=your-artifact-1.0.jar \
>        >>>                          [-DpomFile=your-pom.xml] \
>        >>>                          [-Dsources=src.jar] \
>        >>>                          [-Djavadoc=apidocs.jar] \
>        >>>                          [-DgroupId=org.some.group] \
>        >>>                          [-DartifactId=your-artifact] \
>        >>>                          [-Dversion=1.0] \
>        >>>                          [-Dpackaging=jar] \
>        >>>                          [-Dclassifier=sources] \
>        >>>                          [-DgeneratePom=true] \
>        >>>                          [-DcreateChecksum=true]
>        >>>
>        >>> So I could build a bash shell script that executes the above
> $mvn
>        >>> install command for each jar that I want to install into the
> local repo.
>        >>>
>        >>> What I want to do is to put all the options above into a
> pom.xml such
>        >>> that the user would only have to run a single maven profile
> and type
>        >>> only:
>        >>>    $mvn -P init
>        >>>
>        >>> and have this profile run the  install plugin run on each of
> about 20
>        >>> dot jar files in lib/.
>        >>>
>        >>> I have seen this done before on a project but did not write
> the code nor
>        >>> do I have a copy of the code with me.  I know it is possible
> but can't
>        >>> find any documentation on how to put options to $mvn install
> inside the
>        >>> pom.xml file (instead of the command line).
>        >>> --
>        >>> View this message in context:
>        >>>
> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>        >>> -pom.xml--tp24739597p24739597.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-use-mvn-install-but-have-all-options-in-the
> -pom.xml--tp24739597p24744063.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-use-mvn-install-but-have-all-options-in-the
> -pom.xml--tp24739597p24745709.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
>
>
>
>
>
>
> --
> Alexander
>
>
>


-- 
Alexander

RE: How to use mvn install but have all options in the pom.xml?

Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
build-helper:attach-artifacts attaches artifacts to the build, i.e. so
that they will be installed/deployed at the appropriate stage. This is
almost the opposite of that - the artifacts are dependencies of the
project, not part of the output of it.
 
Justin

________________________________

From: Alexander [mailto:the.malkolm@gmail.com] 
Sent: Thursday, July 30, 2009 3:47 PM
To: Maven Users List
Subject: Re: How to use mvn install but have all options in the pom.xml?


Hello,

Have you looked at builder-helper plugin? Seems like attach-artifacts
goal exactly what you need. Am I wrong?  

2009/7/31 jvsrvcs <jv...@gmail.com>



	Another things is that we plan to open source the product and
post the code
	on a website.
	People that download will need to build the product.  We are not
going to
	put our repo manager out there for the world to use.
	
	this requirement makes configuring a pom like this a necessity.
Ideally it
	would be nice to have some of these jars on a maven repo but
with some of
	them, it's simply not going to happen.
	
	thanks
	



	Tim O'Brien wrote:
	>
	> On Thu, Jul 30, 2009 at 1:23 PM, jvsrvcs<jv...@gmail.com>
wrote:
	>>
	>> Thanks, the reason we are doing this is because:
	>>
	>> 1.  We have a lot of new programmers coming on board (10)
that need to
	>> quickly setup their local repo
	>
	> Use a repository manager.   Distribute a settings.xml file.
	>
	>> 2.  Many of these programmers/consultants are bash
handicapped and don't
	>> have cygwin installed
	>> 3.  Doing it locally first is better than getting from a repo
(and we can
	>> use this init to provision the repo
	>> once and will have it should we need to do it again).
	>>
	>> I appreciate the help and will give it a spin.
	>>
	>> thanks
	>>
	>> jv
	>>
	>> justinedelson wrote:
	>>>
	>>> It's no different than any other plugin. Something like this
should
	>>> work:
	>>>
	>>>             <plugin>
	>>>                 <groupId>org.apache.maven.plugins</groupId>
	>>>
<artifactId>maven-install-plugin</artifactId>
	>>>                 <executions>
	>>>                     <execution>
	>>>                         <id>install-1</id>
	>>>                         <phase>generate-sources</phase>
	>>>                         <goals>
	>>>                             <goal>install-file</goal>
	>>>                         </goals>
	>>>                               <configuration>
	>>>
<artifactId>blah</artifactId>
	>>>
<groupId>blah</groupId>
	>>>                                       <version>v</version>
	>>>
<file>lib/somefile.jar</file>
	>>>                               </configuration>
	>>>                         </execution>
	>>>                     ...repeat...
	>>>                       </executions>
	>>>               </plugin>
	>>>
	>>> I don't think this is particularly common because a) it's
very verbose
	>>> compared with doing it on the command line and b)
install-file only
	>>> needs to be run once, so including it in the build isn't
necessary.
	>>>
	>>> Justin
	>>>
	>>>
	>>> -----Original Message-----
	>>> From: jvsrvcs [mailto:jvsrvcs@gmail.com]
	>>> Sent: Thursday, July 30, 2009 10:51 AM
	>>> To: users@maven.apache.org
	>>> Subject: How to use mvn install but have all options in the
pom.xml?
	>>>
	>>>
	>>> The docs on the mvn install plugin state:
	>>>
	>>> mvn install:install-file -Dfile=your-artifact-1.0.jar \
	>>>                          [-DpomFile=your-pom.xml] \
	>>>                          [-Dsources=src.jar] \
	>>>                          [-Djavadoc=apidocs.jar] \
	>>>                          [-DgroupId=org.some.group] \
	>>>                          [-DartifactId=your-artifact] \
	>>>                          [-Dversion=1.0] \
	>>>                          [-Dpackaging=jar] \
	>>>                          [-Dclassifier=sources] \
	>>>                          [-DgeneratePom=true] \
	>>>                          [-DcreateChecksum=true]
	>>>
	>>> So I could build a bash shell script that executes the above
$mvn
	>>> install command for each jar that I want to install into the
local repo.
	>>>
	>>> What I want to do is to put all the options above into a
pom.xml such
	>>> that the user would only have to run a single maven profile
and type
	>>> only:
	>>>    $mvn -P init
	>>>
	>>> and have this profile run the  install plugin run on each of
about 20
	>>> dot jar files in lib/.
	>>>
	>>> I have seen this done before on a project but did not write
the code nor
	>>> do I have a copy of the code with me.  I know it is possible
but can't
	>>> find any documentation on how to put options to $mvn install
inside the
	>>> pom.xml file (instead of the command line).
	>>> --
	>>> View this message in context:
	>>>
http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
	>>> -pom.xml--tp24739597p24739597.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-use-mvn-install-but-have-all-options-in-the
-pom.xml--tp24739597p24744063.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-use-mvn-install-but-have-all-options-in-the
-pom.xml--tp24739597p24745709.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
	
	




-- 
Alexander



Re: How to use mvn install but have all options in the pom.xml?

Posted by Alexander <th...@gmail.com>.
Hello,

Have you looked at builder-helper plugin? Seems like attach-artifacts
goal exactly
what you need. Am I wrong? [?]
2009/7/31 jvsrvcs <jv...@gmail.com>

>
> Another things is that we plan to open source the product and post the code
> on a website.
> People that download will need to build the product.  We are not going to
> put our repo manager out there for the world to use.
>
> this requirement makes configuring a pom like this a necessity.  Ideally it
> would be nice to have some of these jars on a maven repo but with some of
> them, it's simply not going to happen.
>
> thanks
>
>
>
> Tim O'Brien wrote:
> >
> > On Thu, Jul 30, 2009 at 1:23 PM, jvsrvcs<jv...@gmail.com> wrote:
> >>
> >> Thanks, the reason we are doing this is because:
> >>
> >> 1.  We have a lot of new programmers coming on board (10) that need to
> >> quickly setup their local repo
> >
> > Use a repository manager.   Distribute a settings.xml file.
> >
> >> 2.  Many of these programmers/consultants are bash handicapped and don't
> >> have cygwin installed
> >> 3.  Doing it locally first is better than getting from a repo (and we
> can
> >> use this init to provision the repo
> >> once and will have it should we need to do it again).
> >>
> >> I appreciate the help and will give it a spin.
> >>
> >> thanks
> >>
> >> jv
> >>
> >> justinedelson wrote:
> >>>
> >>> It's no different than any other plugin. Something like this should
> >>> work:
> >>>
> >>>             <plugin>
> >>>                 <groupId>org.apache.maven.plugins</groupId>
> >>>                 <artifactId>maven-install-plugin</artifactId>
> >>>                 <executions>
> >>>                     <execution>
> >>>                         <id>install-1</id>
> >>>                         <phase>generate-sources</phase>
> >>>                         <goals>
> >>>                             <goal>install-file</goal>
> >>>                         </goals>
> >>>                               <configuration>
> >>>                                       <artifactId>blah</artifactId>
> >>>                                       <groupId>blah</groupId>
> >>>                                       <version>v</version>
> >>>                                       <file>lib/somefile.jar</file>
> >>>                               </configuration>
> >>>                         </execution>
> >>>                     ...repeat...
> >>>                       </executions>
> >>>               </plugin>
> >>>
> >>> I don't think this is particularly common because a) it's very verbose
> >>> compared with doing it on the command line and b) install-file only
> >>> needs to be run once, so including it in the build isn't necessary.
> >>>
> >>> Justin
> >>>
> >>>
> >>> -----Original Message-----
> >>> From: jvsrvcs [mailto:jvsrvcs@gmail.com]
> >>> Sent: Thursday, July 30, 2009 10:51 AM
> >>> To: users@maven.apache.org
> >>> Subject: How to use mvn install but have all options in the pom.xml?
> >>>
> >>>
> >>> The docs on the mvn install plugin state:
> >>>
> >>> mvn install:install-file -Dfile=your-artifact-1.0.jar \
> >>>                          [-DpomFile=your-pom.xml] \
> >>>                          [-Dsources=src.jar] \
> >>>                          [-Djavadoc=apidocs.jar] \
> >>>                          [-DgroupId=org.some.group] \
> >>>                          [-DartifactId=your-artifact] \
> >>>                          [-Dversion=1.0] \
> >>>                          [-Dpackaging=jar] \
> >>>                          [-Dclassifier=sources] \
> >>>                          [-DgeneratePom=true] \
> >>>                          [-DcreateChecksum=true]
> >>>
> >>> So I could build a bash shell script that executes the above $mvn
> >>> install command for each jar that I want to install into the local
> repo.
> >>>
> >>> What I want to do is to put all the options above into a pom.xml such
> >>> that the user would only have to run a single maven profile and type
> >>> only:
> >>>    $mvn -P init
> >>>
> >>> and have this profile run the  install plugin run on each of about 20
> >>> dot jar files in lib/.
> >>>
> >>> I have seen this done before on a project but did not write the code
> nor
> >>> do I have a copy of the code with me.  I know it is possible but can't
> >>> find any documentation on how to put options to $mvn install inside the
> >>> pom.xml file (instead of the command line).
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
> >>> -pom.xml--tp24739597p24739597.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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24744063.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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24745709.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
>
>


-- 
Alexander

Re: How to use mvn install but have all options in the pom.xml?

Posted by jvsrvcs <jv...@gmail.com>.
Another things is that we plan to open source the product and post the code
on a website.
People that download will need to build the product.  We are not going to
put our repo manager out there for the world to use.

this requirement makes configuring a pom like this a necessity.  Ideally it
would be nice to have some of these jars on a maven repo but with some of
them, it's simply not going to happen.

thanks



Tim O'Brien wrote:
> 
> On Thu, Jul 30, 2009 at 1:23 PM, jvsrvcs<jv...@gmail.com> wrote:
>>
>> Thanks, the reason we are doing this is because:
>>
>> 1.  We have a lot of new programmers coming on board (10) that need to
>> quickly setup their local repo
> 
> Use a repository manager.   Distribute a settings.xml file.
> 
>> 2.  Many of these programmers/consultants are bash handicapped and don't
>> have cygwin installed
>> 3.  Doing it locally first is better than getting from a repo (and we can
>> use this init to provision the repo
>> once and will have it should we need to do it again).
>>
>> I appreciate the help and will give it a spin.
>>
>> thanks
>>
>> jv
>>
>> justinedelson wrote:
>>>
>>> It's no different than any other plugin. Something like this should
>>> work:
>>>
>>>             <plugin>
>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>                 <artifactId>maven-install-plugin</artifactId>
>>>                 <executions>
>>>                     <execution>
>>>                         <id>install-1</id>
>>>                         <phase>generate-sources</phase>
>>>                         <goals>
>>>                             <goal>install-file</goal>
>>>                         </goals>
>>>                               <configuration>
>>>                                       <artifactId>blah</artifactId>
>>>                                       <groupId>blah</groupId>
>>>                                       <version>v</version>
>>>                                       <file>lib/somefile.jar</file>
>>>                               </configuration>
>>>                         </execution>
>>>                     ...repeat...
>>>                       </executions>
>>>               </plugin>
>>>
>>> I don't think this is particularly common because a) it's very verbose
>>> compared with doing it on the command line and b) install-file only
>>> needs to be run once, so including it in the build isn't necessary.
>>>
>>> Justin
>>>
>>>
>>> -----Original Message-----
>>> From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>>> Sent: Thursday, July 30, 2009 10:51 AM
>>> To: users@maven.apache.org
>>> Subject: How to use mvn install but have all options in the pom.xml?
>>>
>>>
>>> The docs on the mvn install plugin state:
>>>
>>> mvn install:install-file -Dfile=your-artifact-1.0.jar \
>>>                          [-DpomFile=your-pom.xml] \
>>>                          [-Dsources=src.jar] \
>>>                          [-Djavadoc=apidocs.jar] \
>>>                          [-DgroupId=org.some.group] \
>>>                          [-DartifactId=your-artifact] \
>>>                          [-Dversion=1.0] \
>>>                          [-Dpackaging=jar] \
>>>                          [-Dclassifier=sources] \
>>>                          [-DgeneratePom=true] \
>>>                          [-DcreateChecksum=true]
>>>
>>> So I could build a bash shell script that executes the above $mvn
>>> install command for each jar that I want to install into the local repo.
>>>
>>> What I want to do is to put all the options above into a pom.xml such
>>> that the user would only have to run a single maven profile and type
>>> only:
>>>    $mvn -P init
>>>
>>> and have this profile run the  install plugin run on each of about 20
>>> dot jar files in lib/.
>>>
>>> I have seen this done before on a project but did not write the code nor
>>> do I have a copy of the code with me.  I know it is possible but can't
>>> find any documentation on how to put options to $mvn install inside the
>>> pom.xml file (instead of the command line).
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>>> -pom.xml--tp24739597p24739597.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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24744063.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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24745709.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 use mvn install but have all options in the pom.xml?

Posted by Tim O'Brien <to...@discursive.com>.
On Thu, Jul 30, 2009 at 1:23 PM, jvsrvcs<jv...@gmail.com> wrote:
>
> Thanks, the reason we are doing this is because:
>
> 1.  We have a lot of new programmers coming on board (10) that need to
> quickly setup their local repo

Use a repository manager.   Distribute a settings.xml file.

> 2.  Many of these programmers/consultants are bash handicapped and don't
> have cygwin installed
> 3.  Doing it locally first is better than getting from a repo (and we can
> use this init to provision the repo
> once and will have it should we need to do it again).
>
> I appreciate the help and will give it a spin.
>
> thanks
>
> jv
>
> justinedelson wrote:
>>
>> It's no different than any other plugin. Something like this should
>> work:
>>
>>             <plugin>
>>                 <groupId>org.apache.maven.plugins</groupId>
>>                 <artifactId>maven-install-plugin</artifactId>
>>                 <executions>
>>                     <execution>
>>                         <id>install-1</id>
>>                         <phase>generate-sources</phase>
>>                         <goals>
>>                             <goal>install-file</goal>
>>                         </goals>
>>                               <configuration>
>>                                       <artifactId>blah</artifactId>
>>                                       <groupId>blah</groupId>
>>                                       <version>v</version>
>>                                       <file>lib/somefile.jar</file>
>>                               </configuration>
>>                         </execution>
>>                     ...repeat...
>>                       </executions>
>>               </plugin>
>>
>> I don't think this is particularly common because a) it's very verbose
>> compared with doing it on the command line and b) install-file only
>> needs to be run once, so including it in the build isn't necessary.
>>
>> Justin
>>
>>
>> -----Original Message-----
>> From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>> Sent: Thursday, July 30, 2009 10:51 AM
>> To: users@maven.apache.org
>> Subject: How to use mvn install but have all options in the pom.xml?
>>
>>
>> The docs on the mvn install plugin state:
>>
>> mvn install:install-file -Dfile=your-artifact-1.0.jar \
>>                          [-DpomFile=your-pom.xml] \
>>                          [-Dsources=src.jar] \
>>                          [-Djavadoc=apidocs.jar] \
>>                          [-DgroupId=org.some.group] \
>>                          [-DartifactId=your-artifact] \
>>                          [-Dversion=1.0] \
>>                          [-Dpackaging=jar] \
>>                          [-Dclassifier=sources] \
>>                          [-DgeneratePom=true] \
>>                          [-DcreateChecksum=true]
>>
>> So I could build a bash shell script that executes the above $mvn
>> install command for each jar that I want to install into the local repo.
>>
>> What I want to do is to put all the options above into a pom.xml such
>> that the user would only have to run a single maven profile and type
>> only:
>>    $mvn -P init
>>
>> and have this profile run the  install plugin run on each of about 20
>> dot jar files in lib/.
>>
>> I have seen this done before on a project but did not write the code nor
>> do I have a copy of the code with me.  I know it is possible but can't
>> find any documentation on how to put options to $mvn install inside the
>> pom.xml file (instead of the command line).
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>> -pom.xml--tp24739597p24739597.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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24744063.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 use mvn install but have all options in the pom.xml?

Posted by jvsrvcs <jv...@gmail.com>.
Thanks, the reason we are doing this is because:

1.  We have a lot of new programmers coming on board (10) that need to
quickly setup their local repo
2.  Many of these programmers/consultants are bash handicapped and don't
have cygwin installed
3.  Doing it locally first is better than getting from a repo (and we can
use this init to provision the repo
once and will have it should we need to do it again).

I appreciate the help and will give it a spin.

thanks

jv

justinedelson wrote:
> 
> It's no different than any other plugin. Something like this should
> work:
> 
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-install-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>install-1</id>
>                         <phase>generate-sources</phase>
>                         <goals>
>                             <goal>install-file</goal>
>                         </goals> 
> 				<configuration>
> 					<artifactId>blah</artifactId>
> 					<groupId>blah</groupId>
> 					<version>v</version>
> 					<file>lib/somefile.jar</file>
> 				</configuration>
> 			  </execution>
>                     ...repeat...
> 			</executions>
> 		</plugin>
> 
> I don't think this is particularly common because a) it's very verbose
> compared with doing it on the command line and b) install-file only
> needs to be run once, so including it in the build isn't necessary.
> 
> Justin
> 
> 
> -----Original Message-----
> From: jvsrvcs [mailto:jvsrvcs@gmail.com] 
> Sent: Thursday, July 30, 2009 10:51 AM
> To: users@maven.apache.org
> Subject: How to use mvn install but have all options in the pom.xml?
> 
> 
> The docs on the mvn install plugin state:
> 
> mvn install:install-file -Dfile=your-artifact-1.0.jar \
>                          [-DpomFile=your-pom.xml] \
>                          [-Dsources=src.jar] \
>                          [-Djavadoc=apidocs.jar] \
>                          [-DgroupId=org.some.group] \
>                          [-DartifactId=your-artifact] \
>                          [-Dversion=1.0] \
>                          [-Dpackaging=jar] \
>                          [-Dclassifier=sources] \
>                          [-DgeneratePom=true] \
>                          [-DcreateChecksum=true]
> 
> So I could build a bash shell script that executes the above $mvn
> install command for each jar that I want to install into the local repo.
> 
> What I want to do is to put all the options above into a pom.xml such
> that the user would only have to run a single maven profile and type
> only:
>    $mvn -P init
> 
> and have this profile run the  install plugin run on each of about 20
> dot jar files in lib/.
> 
> I have seen this done before on a project but did not write the code nor
> do I have a copy of the code with me.  I know it is possible but can't
> find any documentation on how to put options to $mvn install inside the
> pom.xml file (instead of the command line).
> --
> View this message in context:
> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
> -pom.xml--tp24739597p24739597.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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24744063.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 use mvn install but have all options in the pom.xml?

Posted by jvsrvcs <jv...@gmail.com>.
Any project should have the ability to:
1.  check out the code
2.  Build it without a repository manager

Repository managers are a necessity but they are being used for things they
were not intended for.
We have the requirement to build from the ground up without the need to be
inside the network and access to the repository manager.

I would think every project would want to build all artifacts without
haveing a repository manager in the loop.  If a repository manager is
absolutely needed to build a project, then this is one inefficiency (as well
as many others because this is a tell-tale sign of other things as well).


justinedelson wrote:
> 
> I should also say that I personally think using install-file is a bad
> idea when there are good repository managers available.
> 
> Justin
> 
> -----Original Message-----
> From: Edelson, Justin 
> Sent: Thursday, July 30, 2009 1:13 PM
> To: Maven Users List
> Subject: RE: How to use mvn install but have all options in the pom.xml?
> 
> It does need to be bound to a phase if you want to do more than one
> install. Also, the OP said he wanted to use a profile, which implied (to
> me at least) that this would be part of the lifecycle. generate-sources
> may or may not be the right phase, that's up to the OP.
>  
> Justin
> 
> ________________________________
> 
> From: Alexander [mailto:the.malkolm@gmail.com]
> Sent: Thursday, July 30, 2009 11:10 AM
> To: Maven Users List
> Subject: Re: How to use mvn install but have all options in the pom.xml?
> 
> 
> There is no need to bind it to any phase, right?  I think it is a pretty
> Maven-style way of solving problem  Needa try..
> 
> 
> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
> 
> 
> 	It's no different than any other plugin. Something like this
> should
> 	work:
> 	
> 	           <plugin>
> 	               <groupId>org.apache.maven.plugins</groupId>
> 	               <artifactId>maven-install-plugin</artifactId>
> 	               <executions>
> 	                   <execution>
> 	                       <id>install-1</id>
> 	                       <phase>generate-sources</phase>
> 	                       <goals>
> 	                           <goal>install-file</goal>
> 	                       </goals>
> 	                               <configuration>
> 	
> <artifactId>blah</artifactId>
> 	                                       <groupId>blah</groupId>
> 	                                       <version>v</version>
> 	
> <file>lib/somefile.jar</file>
> 	                               </configuration>
> 	                         </execution>
> 	                   ...repeat...
> 	                       </executions>
> 	               </plugin>
> 	
> 	I don't think this is particularly common because a) it's very
> verbose
> 	compared with doing it on the command line and b) install-file
> only
> 	needs to be run once, so including it in the build isn't
> necessary.
> 	
> 	Justin
> 	
> 
> 
> 	-----Original Message-----
> 	From: jvsrvcs [mailto:jvsrvcs@gmail.com]
> 	Sent: Thursday, July 30, 2009 10:51 AM
> 	To: users@maven.apache.org
> 	Subject: How to use mvn install but have all options in the
> pom.xml?
> 	
> 	
> 	The docs on the mvn install plugin state:
> 	
> 	mvn install:install-file -Dfile=your-artifact-1.0.jar \
> 	                        [-DpomFile=your-pom.xml] \
> 	                        [-Dsources=src.jar] \
> 	                        [-Djavadoc=apidocs.jar] \
> 	                        [-DgroupId=org.some.group] \
> 	                        [-DartifactId=your-artifact] \
> 	                        [-Dversion=1.0] \
> 	                        [-Dpackaging=jar] \
> 	                        [-Dclassifier=sources] \
> 	                        [-DgeneratePom=true] \
> 	                        [-DcreateChecksum=true]
> 	
> 	So I could build a bash shell script that executes the above
> $mvn
> 	install command for each jar that I want to install into the
> local repo.
> 	
> 	What I want to do is to put all the options above into a pom.xml
> such
> 	that the user would only have to run a single maven profile and
> type
> 	only:
> 	  $mvn -P init
> 	
> 	and have this profile run the  install plugin run on each of
> about 20
> 	dot jar files in lib/.
> 	
> 	I have seen this done before on a project but did not write the
> code nor
> 	do I have a copy of the code with me.  I know it is possible but
> can't
> 	find any documentation on how to put options to $mvn install
> inside the
> 	pom.xml file (instead of the command line).
> 	--
> 	View this message in context:
> 	
> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
> 	-pom.xml--tp24739597p24739597.html
> <http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
> e-pom.xml--tp24739597p24739597.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
> 	
> 	
> 
> 
> 
> ---------------------------------------------------------------------
> 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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24745615.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 use mvn install but have all options in the pom.xml?

Posted by Tim O'Brien <to...@discursive.com>.
On Thu, Jul 30, 2009 at 2:19 PM, jvsrvcs<jv...@gmail.com> wrote:
>
> We do have a maven repository manager in place but it's only accessible
> inside the network when we
> are on location.
>
> We have many consultants, some folks work at home on occasion and we want
> them to be able to build and write code for a day without having access to
> the local network.
>

Right, so setup a repo manager, and provide access to remote
consultants, telecommuters.   How do these people get access to source
control?   Probably through a VPN or maybe you have some server setup
that requires authentication.   Do whatever you want to do, but if you
have to have script that populates your local repo, you need to use a
repository manager.   I

If you use Maven, you should be using a repository manager.  If you
are not using a repository manager, you have to resort to shenanigans
to distribute binaries.

>
>
>
>
> Tim O'Brien wrote:
>>
>> You can define multiple executions.
>>
>> My advice is the same as Justin's, don't do this.  Use a repository
>> manager.    The fact that you have to configure multiple calls to
>> install-file means that you don't have a good way to distribute internal
>> or
>> third-party artifacts.
>>
>>
>>
>> On Thu, Jul 30, 2009 at 12:30 PM, Alexander <th...@gmail.com> wrote:
>>
>>> But I cant find the way how install several files. It seems like
>>> maven-install could be configured only with one file to install. Actually
>>> It
>>> wont eat configuration in execution node as you mentioned. Works only
>>> that
>>> way
>>> <plugin>
>>>     <groupId>org.apache.maven.plugins</groupId>
>>>     <artifactId>maven-install-plugin</artifactId>
>>>     <version>2.3</version>
>>>     <configuration>
>>>         <groupId>org.heaven</groupId>
>>>         <artifactId>bless</artifactId>
>>>         <version>2.0.0</version>
>>>         <packaging>jar</packaging>
>>>         <file>./bless</file>
>>>     </configuration>
>>>     <executions>
>>>         <execution>
>>>             <id>install-bless</id>
>>>             <phase>install</phase>
>>>             <goals>
>>>                 <goal>install-file</goal>
>>>             </goals>
>>>         </execution>
>>>     </executions>
>>> </plugin>
>>>
>>> And yeah I agree with you. Its better write script with batch of such
>>> install:install-file goals for every dependency rather that try to place
>>> such information to pom.xml [?] Anyway it is interesting if maven could
>>> do
>>> this.
>>>
>>> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>>>
>>>> I should also say that I personally think using install-file is a bad
>>>> idea when there are good repository managers available.
>>>>
>>>> Justin
>>>>
>>>> -----Original Message-----
>>>> From: Edelson, Justin
>>>> Sent: Thursday, July 30, 2009 1:13 PM
>>>> To: Maven Users List
>>>> Subject: RE: How to use mvn install but have all options in the pom.xml?
>>>>
>>>> It does need to be bound to a phase if you want to do more than one
>>>> install. Also, the OP said he wanted to use a profile, which implied (to
>>>> me at least) that this would be part of the lifecycle. generate-sources
>>>> may or may not be the right phase, that's up to the OP.
>>>>
>>>> Justin
>>>>
>>>> ________________________________
>>>>
>>>> From: Alexander [mailto:the.malkolm@gmail.com]
>>>> Sent: Thursday, July 30, 2009 11:10 AM
>>>> To: Maven Users List
>>>> Subject: Re: How to use mvn install but have all options in the pom.xml?
>>>>
>>>>
>>>> There is no need to bind it to any phase, right?  I think it is a pretty
>>>> Maven-style way of solving problem  Needa try..
>>>>
>>>>
>>>> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>>>>
>>>>
>>>>        It's no different than any other plugin. Something like this
>>>> should
>>>>        work:
>>>>
>>>>                   <plugin>
>>>>                       <groupId>org.apache.maven.plugins</groupId>
>>>>                       <artifactId>maven-install-plugin</artifactId>
>>>>                       <executions>
>>>>                           <execution>
>>>>                               <id>install-1</id>
>>>>                               <phase>generate-sources</phase>
>>>>                               <goals>
>>>>                                   <goal>install-file</goal>
>>>>                               </goals>
>>>>                                       <configuration>
>>>>
>>>> <artifactId>blah</artifactId>
>>>>                                               <groupId>blah</groupId>
>>>>                                               <version>v</version>
>>>>
>>>> <file>lib/somefile.jar</file>
>>>>                                       </configuration>
>>>>                                 </execution>
>>>>                           ...repeat...
>>>>                               </executions>
>>>>                       </plugin>
>>>>
>>>>        I don't think this is particularly common because a) it's very
>>>> verbose
>>>>        compared with doing it on the command line and b) install-file
>>>> only
>>>>        needs to be run once, so including it in the build isn't
>>>> necessary.
>>>>
>>>>        Justin
>>>>
>>>>
>>>>
>>>>        -----Original Message-----
>>>>        From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>>>>        Sent: Thursday, July 30, 2009 10:51 AM
>>>>        To: users@maven.apache.org
>>>>        Subject: How to use mvn install but have all options in the
>>>> pom.xml?
>>>>
>>>>
>>>>        The docs on the mvn install plugin state:
>>>>
>>>>        mvn install:install-file -Dfile=your-artifact-1.0.jar \
>>>>                                [-DpomFile=your-pom.xml] \
>>>>                                [-Dsources=src.jar] \
>>>>                                [-Djavadoc=apidocs.jar] \
>>>>                                [-DgroupId=org.some.group] \
>>>>                                [-DartifactId=your-artifact] \
>>>>                                [-Dversion=1.0] \
>>>>                                [-Dpackaging=jar] \
>>>>                                [-Dclassifier=sources] \
>>>>                                [-DgeneratePom=true] \
>>>>                                [-DcreateChecksum=true]
>>>>
>>>>        So I could build a bash shell script that executes the above
>>>> $mvn
>>>>        install command for each jar that I want to install into the
>>>> local repo.
>>>>
>>>>        What I want to do is to put all the options above into a pom.xml
>>>> such
>>>>        that the user would only have to run a single maven profile and
>>>> type
>>>>        only:
>>>>          $mvn -P init
>>>>
>>>>        and have this profile run the  install plugin run on each of
>>>> about 20
>>>>        dot jar files in lib/.
>>>>
>>>>        I have seen this done before on a project but did not write the
>>>> code nor
>>>>        do I have a copy of the code with me.  I know it is possible but
>>>> can't
>>>>        find any documentation on how to put options to $mvn install
>>>> inside the
>>>>        pom.xml file (instead of the command line).
>>>>        --
>>>>        View this message in context:
>>>>
>>>> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>>>>        -pom.xml--tp24739597p24739597.html
>>>> <http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
>>>> e-pom.xml--tp24739597p24739597.html<http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th%0Ae-pom.xml--tp24739597p24739597.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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24745663.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 use mvn install but have all options in the pom.xml?

Posted by Dominic Mitchell <do...@semantico.com>.
On 30 Jul 2009, at 20:19, jvsrvcs wrote:
> We do have a maven repository manager in place but it's only  
> accessible
> inside the network when we
> are on location.

It's trivial to get nexus running on your workstation.  I keep one  
running on my laptop for when I'm not plugged in to our company  
network.  It works like a champ.

-Dom

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


Re: How to use mvn install but have all options in the pom.xml?

Posted by jvsrvcs <jv...@gmail.com>.
We do have a maven repository manager in place but it's only accessible
inside the network when we
are on location.

We have many consultants, some folks work at home on occasion and we want
them to be able to build and write code for a day without having access to
the local network.





Tim O'Brien wrote:
> 
> You can define multiple executions.
> 
> My advice is the same as Justin's, don't do this.  Use a repository
> manager.    The fact that you have to configure multiple calls to
> install-file means that you don't have a good way to distribute internal
> or
> third-party artifacts.
> 
> 
> 
> On Thu, Jul 30, 2009 at 12:30 PM, Alexander <th...@gmail.com> wrote:
> 
>> But I cant find the way how install several files. It seems like
>> maven-install could be configured only with one file to install. Actually
>> It
>> wont eat configuration in execution node as you mentioned. Works only
>> that
>> way
>> <plugin>
>>     <groupId>org.apache.maven.plugins</groupId>
>>     <artifactId>maven-install-plugin</artifactId>
>>     <version>2.3</version>
>>     <configuration>
>>         <groupId>org.heaven</groupId>
>>         <artifactId>bless</artifactId>
>>         <version>2.0.0</version>
>>         <packaging>jar</packaging>
>>         <file>./bless</file>
>>     </configuration>
>>     <executions>
>>         <execution>
>>             <id>install-bless</id>
>>             <phase>install</phase>
>>             <goals>
>>                 <goal>install-file</goal>
>>             </goals>
>>         </execution>
>>     </executions>
>> </plugin>
>>
>> And yeah I agree with you. Its better write script with batch of such
>> install:install-file goals for every dependency rather that try to place
>> such information to pom.xml [?] Anyway it is interesting if maven could
>> do
>> this.
>>
>> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>>
>>> I should also say that I personally think using install-file is a bad
>>> idea when there are good repository managers available.
>>>
>>> Justin
>>>
>>> -----Original Message-----
>>> From: Edelson, Justin
>>> Sent: Thursday, July 30, 2009 1:13 PM
>>> To: Maven Users List
>>> Subject: RE: How to use mvn install but have all options in the pom.xml?
>>>
>>> It does need to be bound to a phase if you want to do more than one
>>> install. Also, the OP said he wanted to use a profile, which implied (to
>>> me at least) that this would be part of the lifecycle. generate-sources
>>> may or may not be the right phase, that's up to the OP.
>>>
>>> Justin
>>>
>>> ________________________________
>>>
>>> From: Alexander [mailto:the.malkolm@gmail.com]
>>> Sent: Thursday, July 30, 2009 11:10 AM
>>> To: Maven Users List
>>> Subject: Re: How to use mvn install but have all options in the pom.xml?
>>>
>>>
>>> There is no need to bind it to any phase, right?  I think it is a pretty
>>> Maven-style way of solving problem  Needa try..
>>>
>>>
>>> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>>>
>>>
>>>        It's no different than any other plugin. Something like this
>>> should
>>>        work:
>>>
>>>                   <plugin>
>>>                       <groupId>org.apache.maven.plugins</groupId>
>>>                       <artifactId>maven-install-plugin</artifactId>
>>>                       <executions>
>>>                           <execution>
>>>                               <id>install-1</id>
>>>                               <phase>generate-sources</phase>
>>>                               <goals>
>>>                                   <goal>install-file</goal>
>>>                               </goals>
>>>                                       <configuration>
>>>
>>> <artifactId>blah</artifactId>
>>>                                               <groupId>blah</groupId>
>>>                                               <version>v</version>
>>>
>>> <file>lib/somefile.jar</file>
>>>                                       </configuration>
>>>                                 </execution>
>>>                           ...repeat...
>>>                               </executions>
>>>                       </plugin>
>>>
>>>        I don't think this is particularly common because a) it's very
>>> verbose
>>>        compared with doing it on the command line and b) install-file
>>> only
>>>        needs to be run once, so including it in the build isn't
>>> necessary.
>>>
>>>        Justin
>>>
>>>
>>>
>>>        -----Original Message-----
>>>        From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>>>        Sent: Thursday, July 30, 2009 10:51 AM
>>>        To: users@maven.apache.org
>>>        Subject: How to use mvn install but have all options in the
>>> pom.xml?
>>>
>>>
>>>        The docs on the mvn install plugin state:
>>>
>>>        mvn install:install-file -Dfile=your-artifact-1.0.jar \
>>>                                [-DpomFile=your-pom.xml] \
>>>                                [-Dsources=src.jar] \
>>>                                [-Djavadoc=apidocs.jar] \
>>>                                [-DgroupId=org.some.group] \
>>>                                [-DartifactId=your-artifact] \
>>>                                [-Dversion=1.0] \
>>>                                [-Dpackaging=jar] \
>>>                                [-Dclassifier=sources] \
>>>                                [-DgeneratePom=true] \
>>>                                [-DcreateChecksum=true]
>>>
>>>        So I could build a bash shell script that executes the above
>>> $mvn
>>>        install command for each jar that I want to install into the
>>> local repo.
>>>
>>>        What I want to do is to put all the options above into a pom.xml
>>> such
>>>        that the user would only have to run a single maven profile and
>>> type
>>>        only:
>>>          $mvn -P init
>>>
>>>        and have this profile run the  install plugin run on each of
>>> about 20
>>>        dot jar files in lib/.
>>>
>>>        I have seen this done before on a project but did not write the
>>> code nor
>>>        do I have a copy of the code with me.  I know it is possible but
>>> can't
>>>        find any documentation on how to put options to $mvn install
>>> inside the
>>>        pom.xml file (instead of the command line).
>>>        --
>>>        View this message in context:
>>>
>>> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>>>        -pom.xml--tp24739597p24739597.html
>>> <http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
>>> e-pom.xml--tp24739597p24739597.html<http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th%0Ae-pom.xml--tp24739597p24739597.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
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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-use-mvn-install-but-have-all-options-in-the-pom.xml--tp24739597p24745663.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 use mvn install but have all options in the pom.xml?

Posted by Tim O'Brien <to...@discursive.com>.
You can define multiple executions.

My advice is the same as Justin's, don't do this.  Use a repository
manager.    The fact that you have to configure multiple calls to
install-file means that you don't have a good way to distribute internal or
third-party artifacts.



On Thu, Jul 30, 2009 at 12:30 PM, Alexander <th...@gmail.com> wrote:

> But I cant find the way how install several files. It seems like
> maven-install could be configured only with one file to install. Actually It
> wont eat configuration in execution node as you mentioned. Works only that
> way
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-install-plugin</artifactId>
>     <version>2.3</version>
>     <configuration>
>         <groupId>org.heaven</groupId>
>         <artifactId>bless</artifactId>
>         <version>2.0.0</version>
>         <packaging>jar</packaging>
>         <file>./bless</file>
>     </configuration>
>     <executions>
>         <execution>
>             <id>install-bless</id>
>             <phase>install</phase>
>             <goals>
>                 <goal>install-file</goal>
>             </goals>
>         </execution>
>     </executions>
> </plugin>
>
> And yeah I agree with you. Its better write script with batch of such
> install:install-file goals for every dependency rather that try to place
> such information to pom.xml [?] Anyway it is interesting if maven could do
> this.
>
> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>
>> I should also say that I personally think using install-file is a bad
>> idea when there are good repository managers available.
>>
>> Justin
>>
>> -----Original Message-----
>> From: Edelson, Justin
>> Sent: Thursday, July 30, 2009 1:13 PM
>> To: Maven Users List
>> Subject: RE: How to use mvn install but have all options in the pom.xml?
>>
>> It does need to be bound to a phase if you want to do more than one
>> install. Also, the OP said he wanted to use a profile, which implied (to
>> me at least) that this would be part of the lifecycle. generate-sources
>> may or may not be the right phase, that's up to the OP.
>>
>> Justin
>>
>> ________________________________
>>
>> From: Alexander [mailto:the.malkolm@gmail.com]
>> Sent: Thursday, July 30, 2009 11:10 AM
>> To: Maven Users List
>> Subject: Re: How to use mvn install but have all options in the pom.xml?
>>
>>
>> There is no need to bind it to any phase, right?  I think it is a pretty
>> Maven-style way of solving problem  Needa try..
>>
>>
>> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>>
>>
>>        It's no different than any other plugin. Something like this
>> should
>>        work:
>>
>>                   <plugin>
>>                       <groupId>org.apache.maven.plugins</groupId>
>>                       <artifactId>maven-install-plugin</artifactId>
>>                       <executions>
>>                           <execution>
>>                               <id>install-1</id>
>>                               <phase>generate-sources</phase>
>>                               <goals>
>>                                   <goal>install-file</goal>
>>                               </goals>
>>                                       <configuration>
>>
>> <artifactId>blah</artifactId>
>>                                               <groupId>blah</groupId>
>>                                               <version>v</version>
>>
>> <file>lib/somefile.jar</file>
>>                                       </configuration>
>>                                 </execution>
>>                           ...repeat...
>>                               </executions>
>>                       </plugin>
>>
>>        I don't think this is particularly common because a) it's very
>> verbose
>>        compared with doing it on the command line and b) install-file
>> only
>>        needs to be run once, so including it in the build isn't
>> necessary.
>>
>>        Justin
>>
>>
>>
>>        -----Original Message-----
>>        From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>>        Sent: Thursday, July 30, 2009 10:51 AM
>>        To: users@maven.apache.org
>>        Subject: How to use mvn install but have all options in the
>> pom.xml?
>>
>>
>>        The docs on the mvn install plugin state:
>>
>>        mvn install:install-file -Dfile=your-artifact-1.0.jar \
>>                                [-DpomFile=your-pom.xml] \
>>                                [-Dsources=src.jar] \
>>                                [-Djavadoc=apidocs.jar] \
>>                                [-DgroupId=org.some.group] \
>>                                [-DartifactId=your-artifact] \
>>                                [-Dversion=1.0] \
>>                                [-Dpackaging=jar] \
>>                                [-Dclassifier=sources] \
>>                                [-DgeneratePom=true] \
>>                                [-DcreateChecksum=true]
>>
>>        So I could build a bash shell script that executes the above
>> $mvn
>>        install command for each jar that I want to install into the
>> local repo.
>>
>>        What I want to do is to put all the options above into a pom.xml
>> such
>>        that the user would only have to run a single maven profile and
>> type
>>        only:
>>          $mvn -P init
>>
>>        and have this profile run the  install plugin run on each of
>> about 20
>>        dot jar files in lib/.
>>
>>        I have seen this done before on a project but did not write the
>> code nor
>>        do I have a copy of the code with me.  I know it is possible but
>> can't
>>        find any documentation on how to put options to $mvn install
>> inside the
>>        pom.xml file (instead of the command line).
>>        --
>>        View this message in context:
>>
>> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>>        -pom.xml--tp24739597p24739597.html
>> <http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
>> e-pom.xml--tp24739597p24739597.html<http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th%0Ae-pom.xml--tp24739597p24739597.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
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: How to use mvn install but have all options in the pom.xml?

Posted by Kalle Korhonen <ka...@gmail.com>.
You should *not* use install plugin manually, but rather let Maven know that
your project is producing multiple artifacts, use classifiers to identify
each and attach them to the module with build-helper plugin.. see example
at: http://mojo.codehaus.org/build-helper-maven-plugin/usage.html.

Kalle


On Thu, Jul 30, 2009 at 10:30 AM, Alexander <th...@gmail.com> wrote:

> But I cant find the way how install several files. It seems like
> maven-install could be configured only with one file to install. Actually It
> wont eat configuration in execution node as you mentioned. Works only that
> way
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-install-plugin</artifactId>
>     <version>2.3</version>
>     <configuration>
>         <groupId>org.heaven</groupId>
>         <artifactId>bless</artifactId>
>         <version>2.0.0</version>
>         <packaging>jar</packaging>
>         <file>./bless</file>
>     </configuration>
>     <executions>
>         <execution>
>             <id>install-bless</id>
>             <phase>install</phase>
>             <goals>
>                 <goal>install-file</goal>
>             </goals>
>         </execution>
>     </executions>
> </plugin>
>
> And yeah I agree with you. Its better write script with batch of such
> install:install-file goals for every dependency rather that try to place
> such information to pom.xml [?] Anyway it is interesting if maven could do
> this.
>
> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>
>> I should also say that I personally think using install-file is a bad
>> idea when there are good repository managers available.
>>
>> Justin
>>
>> -----Original Message-----
>> From: Edelson, Justin
>> Sent: Thursday, July 30, 2009 1:13 PM
>> To: Maven Users List
>> Subject: RE: How to use mvn install but have all options in the pom.xml?
>>
>> It does need to be bound to a phase if you want to do more than one
>> install. Also, the OP said he wanted to use a profile, which implied (to
>> me at least) that this would be part of the lifecycle. generate-sources
>> may or may not be the right phase, that's up to the OP.
>>
>> Justin
>>
>> ________________________________
>>
>> From: Alexander [mailto:the.malkolm@gmail.com]
>> Sent: Thursday, July 30, 2009 11:10 AM
>> To: Maven Users List
>> Subject: Re: How to use mvn install but have all options in the pom.xml?
>>
>>
>> There is no need to bind it to any phase, right?  I think it is a pretty
>> Maven-style way of solving problem  Needa try..
>>
>>
>> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>>
>>
>>        It's no different than any other plugin. Something like this
>> should
>>        work:
>>
>>                   <plugin>
>>                       <groupId>org.apache.maven.plugins</groupId>
>>                       <artifactId>maven-install-plugin</artifactId>
>>                       <executions>
>>                           <execution>
>>                               <id>install-1</id>
>>                               <phase>generate-sources</phase>
>>                               <goals>
>>                                   <goal>install-file</goal>
>>                               </goals>
>>                                       <configuration>
>>
>> <artifactId>blah</artifactId>
>>                                               <groupId>blah</groupId>
>>                                               <version>v</version>
>>
>> <file>lib/somefile.jar</file>
>>                                       </configuration>
>>                                 </execution>
>>                           ...repeat...
>>                               </executions>
>>                       </plugin>
>>
>>        I don't think this is particularly common because a) it's very
>> verbose
>>        compared with doing it on the command line and b) install-file
>> only
>>        needs to be run once, so including it in the build isn't
>> necessary.
>>
>>        Justin
>>
>>
>>
>>        -----Original Message-----
>>        From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>>        Sent: Thursday, July 30, 2009 10:51 AM
>>        To: users@maven.apache.org
>>        Subject: How to use mvn install but have all options in the
>> pom.xml?
>>
>>
>>        The docs on the mvn install plugin state:
>>
>>        mvn install:install-file -Dfile=your-artifact-1.0.jar \
>>                                [-DpomFile=your-pom.xml] \
>>                                [-Dsources=src.jar] \
>>                                [-Djavadoc=apidocs.jar] \
>>                                [-DgroupId=org.some.group] \
>>                                [-DartifactId=your-artifact] \
>>                                [-Dversion=1.0] \
>>                                [-Dpackaging=jar] \
>>                                [-Dclassifier=sources] \
>>                                [-DgeneratePom=true] \
>>                                [-DcreateChecksum=true]
>>
>>        So I could build a bash shell script that executes the above
>> $mvn
>>        install command for each jar that I want to install into the
>> local repo.
>>
>>        What I want to do is to put all the options above into a pom.xml
>> such
>>        that the user would only have to run a single maven profile and
>> type
>>        only:
>>          $mvn -P init
>>
>>        and have this profile run the  install plugin run on each of
>> about 20
>>        dot jar files in lib/.
>>
>>        I have seen this done before on a project but did not write the
>> code nor
>>        do I have a copy of the code with me.  I know it is possible but
>> can't
>>        find any documentation on how to put options to $mvn install
>> inside the
>>        pom.xml file (instead of the command line).
>>        --
>>        View this message in context:
>>
>> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>>        -pom.xml--tp24739597p24739597.html
>> <http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
>> e-pom.xml--tp24739597p24739597.html<http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th%0Ae-pom.xml--tp24739597p24739597.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
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: How to use mvn install but have all options in the pom.xml?

Posted by Alexander <th...@gmail.com>.
But I cant find the way how install several files. It seems like
maven-install could be configured only with one file to install. Actually It
wont eat configuration in execution node as you mentioned. Works only that
way
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <groupId>org.heaven</groupId>
        <artifactId>bless</artifactId>
        <version>2.0.0</version>
        <packaging>jar</packaging>
        <file>./bless</file>
    </configuration>
    <executions>
        <execution>
            <id>install-bless</id>
            <phase>install</phase>
            <goals>
                <goal>install-file</goal>
            </goals>
        </execution>
    </executions>
</plugin>

And yeah I agree with you. Its better write script with batch of such
install:install-file goals for every dependency rather that try to place
such information to pom.xml [?] Anyway it is interesting if maven could do
this.

2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>

> I should also say that I personally think using install-file is a bad
> idea when there are good repository managers available.
>
> Justin
>
> -----Original Message-----
> From: Edelson, Justin
> Sent: Thursday, July 30, 2009 1:13 PM
> To: Maven Users List
> Subject: RE: How to use mvn install but have all options in the pom.xml?
>
> It does need to be bound to a phase if you want to do more than one
> install. Also, the OP said he wanted to use a profile, which implied (to
> me at least) that this would be part of the lifecycle. generate-sources
> may or may not be the right phase, that's up to the OP.
>
> Justin
>
> ________________________________
>
> From: Alexander [mailto:the.malkolm@gmail.com]
> Sent: Thursday, July 30, 2009 11:10 AM
> To: Maven Users List
> Subject: Re: How to use mvn install but have all options in the pom.xml?
>
>
> There is no need to bind it to any phase, right?  I think it is a pretty
> Maven-style way of solving problem  Needa try..
>
>
> 2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>
>
>
>        It's no different than any other plugin. Something like this
> should
>        work:
>
>                   <plugin>
>                       <groupId>org.apache.maven.plugins</groupId>
>                       <artifactId>maven-install-plugin</artifactId>
>                       <executions>
>                           <execution>
>                               <id>install-1</id>
>                               <phase>generate-sources</phase>
>                               <goals>
>                                   <goal>install-file</goal>
>                               </goals>
>                                       <configuration>
>
> <artifactId>blah</artifactId>
>                                               <groupId>blah</groupId>
>                                               <version>v</version>
>
> <file>lib/somefile.jar</file>
>                                       </configuration>
>                                 </execution>
>                           ...repeat...
>                               </executions>
>                       </plugin>
>
>        I don't think this is particularly common because a) it's very
> verbose
>        compared with doing it on the command line and b) install-file
> only
>        needs to be run once, so including it in the build isn't
> necessary.
>
>        Justin
>
>
>
>        -----Original Message-----
>        From: jvsrvcs [mailto:jvsrvcs@gmail.com]
>        Sent: Thursday, July 30, 2009 10:51 AM
>        To: users@maven.apache.org
>        Subject: How to use mvn install but have all options in the
> pom.xml?
>
>
>        The docs on the mvn install plugin state:
>
>        mvn install:install-file -Dfile=your-artifact-1.0.jar \
>                                [-DpomFile=your-pom.xml] \
>                                [-Dsources=src.jar] \
>                                [-Djavadoc=apidocs.jar] \
>                                [-DgroupId=org.some.group] \
>                                [-DartifactId=your-artifact] \
>                                [-Dversion=1.0] \
>                                [-Dpackaging=jar] \
>                                [-Dclassifier=sources] \
>                                [-DgeneratePom=true] \
>                                [-DcreateChecksum=true]
>
>        So I could build a bash shell script that executes the above
> $mvn
>        install command for each jar that I want to install into the
> local repo.
>
>        What I want to do is to put all the options above into a pom.xml
> such
>        that the user would only have to run a single maven profile and
> type
>        only:
>          $mvn -P init
>
>        and have this profile run the  install plugin run on each of
> about 20
>        dot jar files in lib/.
>
>        I have seen this done before on a project but did not write the
> code nor
>        do I have a copy of the code with me.  I know it is possible but
> can't
>        find any documentation on how to put options to $mvn install
> inside the
>        pom.xml file (instead of the command line).
>        --
>        View this message in context:
>
> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
>        -pom.xml--tp24739597p24739597.html
> <http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
> e-pom.xml--tp24739597p24739597.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
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: How to use mvn install but have all options in the pom.xml?

Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
I should also say that I personally think using install-file is a bad
idea when there are good repository managers available.

Justin

-----Original Message-----
From: Edelson, Justin 
Sent: Thursday, July 30, 2009 1:13 PM
To: Maven Users List
Subject: RE: How to use mvn install but have all options in the pom.xml?

It does need to be bound to a phase if you want to do more than one
install. Also, the OP said he wanted to use a profile, which implied (to
me at least) that this would be part of the lifecycle. generate-sources
may or may not be the right phase, that's up to the OP.
 
Justin

________________________________

From: Alexander [mailto:the.malkolm@gmail.com]
Sent: Thursday, July 30, 2009 11:10 AM
To: Maven Users List
Subject: Re: How to use mvn install but have all options in the pom.xml?


There is no need to bind it to any phase, right?  I think it is a pretty
Maven-style way of solving problem  Needa try..


2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>


	It's no different than any other plugin. Something like this
should
	work:
	
	           <plugin>
	               <groupId>org.apache.maven.plugins</groupId>
	               <artifactId>maven-install-plugin</artifactId>
	               <executions>
	                   <execution>
	                       <id>install-1</id>
	                       <phase>generate-sources</phase>
	                       <goals>
	                           <goal>install-file</goal>
	                       </goals>
	                               <configuration>
	
<artifactId>blah</artifactId>
	                                       <groupId>blah</groupId>
	                                       <version>v</version>
	
<file>lib/somefile.jar</file>
	                               </configuration>
	                         </execution>
	                   ...repeat...
	                       </executions>
	               </plugin>
	
	I don't think this is particularly common because a) it's very
verbose
	compared with doing it on the command line and b) install-file
only
	needs to be run once, so including it in the build isn't
necessary.
	
	Justin
	


	-----Original Message-----
	From: jvsrvcs [mailto:jvsrvcs@gmail.com]
	Sent: Thursday, July 30, 2009 10:51 AM
	To: users@maven.apache.org
	Subject: How to use mvn install but have all options in the
pom.xml?
	
	
	The docs on the mvn install plugin state:
	
	mvn install:install-file -Dfile=your-artifact-1.0.jar \
	                        [-DpomFile=your-pom.xml] \
	                        [-Dsources=src.jar] \
	                        [-Djavadoc=apidocs.jar] \
	                        [-DgroupId=org.some.group] \
	                        [-DartifactId=your-artifact] \
	                        [-Dversion=1.0] \
	                        [-Dpackaging=jar] \
	                        [-Dclassifier=sources] \
	                        [-DgeneratePom=true] \
	                        [-DcreateChecksum=true]
	
	So I could build a bash shell script that executes the above
$mvn
	install command for each jar that I want to install into the
local repo.
	
	What I want to do is to put all the options above into a pom.xml
such
	that the user would only have to run a single maven profile and
type
	only:
	  $mvn -P init
	
	and have this profile run the  install plugin run on each of
about 20
	dot jar files in lib/.
	
	I have seen this done before on a project but did not write the
code nor
	do I have a copy of the code with me.  I know it is possible but
can't
	find any documentation on how to put options to $mvn install
inside the
	pom.xml file (instead of the command line).
	--
	View this message in context:
	
http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
	-pom.xml--tp24739597p24739597.html
<http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
e-pom.xml--tp24739597p24739597.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
	
	



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


RE: How to use mvn install but have all options in the pom.xml?

Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
It does need to be bound to a phase if you want to do more than one
install. Also, the OP said he wanted to use a profile, which implied (to
me at least) that this would be part of the lifecycle. generate-sources
may or may not be the right phase, that's up to the OP.
 
Justin

________________________________

From: Alexander [mailto:the.malkolm@gmail.com] 
Sent: Thursday, July 30, 2009 11:10 AM
To: Maven Users List
Subject: Re: How to use mvn install but have all options in the pom.xml?


There is no need to bind it to any phase, right?  I think it is a pretty
Maven-style way of solving problem  Needa try..


2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>


	It's no different than any other plugin. Something like this
should
	work:
	
	           <plugin>
	               <groupId>org.apache.maven.plugins</groupId>
	               <artifactId>maven-install-plugin</artifactId>
	               <executions>
	                   <execution>
	                       <id>install-1</id>
	                       <phase>generate-sources</phase>
	                       <goals>
	                           <goal>install-file</goal>
	                       </goals>
	                               <configuration>
	
<artifactId>blah</artifactId>
	                                       <groupId>blah</groupId>
	                                       <version>v</version>
	
<file>lib/somefile.jar</file>
	                               </configuration>
	                         </execution>
	                   ...repeat...
	                       </executions>
	               </plugin>
	
	I don't think this is particularly common because a) it's very
verbose
	compared with doing it on the command line and b) install-file
only
	needs to be run once, so including it in the build isn't
necessary.
	
	Justin
	


	-----Original Message-----
	From: jvsrvcs [mailto:jvsrvcs@gmail.com]
	Sent: Thursday, July 30, 2009 10:51 AM
	To: users@maven.apache.org
	Subject: How to use mvn install but have all options in the
pom.xml?
	
	
	The docs on the mvn install plugin state:
	
	mvn install:install-file -Dfile=your-artifact-1.0.jar \
	                        [-DpomFile=your-pom.xml] \
	                        [-Dsources=src.jar] \
	                        [-Djavadoc=apidocs.jar] \
	                        [-DgroupId=org.some.group] \
	                        [-DartifactId=your-artifact] \
	                        [-Dversion=1.0] \
	                        [-Dpackaging=jar] \
	                        [-Dclassifier=sources] \
	                        [-DgeneratePom=true] \
	                        [-DcreateChecksum=true]
	
	So I could build a bash shell script that executes the above
$mvn
	install command for each jar that I want to install into the
local repo.
	
	What I want to do is to put all the options above into a pom.xml
such
	that the user would only have to run a single maven profile and
type
	only:
	  $mvn -P init
	
	and have this profile run the  install plugin run on each of
about 20
	dot jar files in lib/.
	
	I have seen this done before on a project but did not write the
code nor
	do I have a copy of the code with me.  I know it is possible but
can't
	find any documentation on how to put options to $mvn install
inside the
	pom.xml file (instead of the command line).
	--
	View this message in context:
	
http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
	-pom.xml--tp24739597p24739597.html
<http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-th
e-pom.xml--tp24739597p24739597.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 use mvn install but have all options in the pom.xml?

Posted by Alexander <th...@gmail.com>.
There is no need to bind it to any phase, right? [?] I think it is a pretty
Maven-style way of solving problem [?] Needa try..

2009/7/30 Edelson, Justin <Ju...@mtvstaff.com>

> It's no different than any other plugin. Something like this should
> work:
>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-install-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <id>install-1</id>
>                        <phase>generate-sources</phase>
>                        <goals>
>                            <goal>install-file</goal>
>                        </goals>
>                                <configuration>
>                                        <artifactId>blah</artifactId>
>                                        <groupId>blah</groupId>
>                                        <version>v</version>
>                                        <file>lib/somefile.jar</file>
>                                </configuration>
>                          </execution>
>                    ...repeat...
>                        </executions>
>                </plugin>
>
> I don't think this is particularly common because a) it's very verbose
> compared with doing it on the command line and b) install-file only
> needs to be run once, so including it in the build isn't necessary.
>
> Justin
>
>
> -----Original Message-----
> From: jvsrvcs [mailto:jvsrvcs@gmail.com]
> Sent: Thursday, July 30, 2009 10:51 AM
> To: users@maven.apache.org
> Subject: How to use mvn install but have all options in the pom.xml?
>
>
> The docs on the mvn install plugin state:
>
> mvn install:install-file -Dfile=your-artifact-1.0.jar \
>                         [-DpomFile=your-pom.xml] \
>                         [-Dsources=src.jar] \
>                         [-Djavadoc=apidocs.jar] \
>                         [-DgroupId=org.some.group] \
>                         [-DartifactId=your-artifact] \
>                         [-Dversion=1.0] \
>                         [-Dpackaging=jar] \
>                         [-Dclassifier=sources] \
>                         [-DgeneratePom=true] \
>                         [-DcreateChecksum=true]
>
> So I could build a bash shell script that executes the above $mvn
> install command for each jar that I want to install into the local repo.
>
> What I want to do is to put all the options above into a pom.xml such
> that the user would only have to run a single maven profile and type
> only:
>   $mvn -P init
>
> and have this profile run the  install plugin run on each of about 20
> dot jar files in lib/.
>
> I have seen this done before on a project but did not write the code nor
> do I have a copy of the code with me.  I know it is possible but can't
> find any documentation on how to put options to $mvn install inside the
> pom.xml file (instead of the command line).
> --
> View this message in context:
> http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
> -pom.xml--tp24739597p24739597.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 use mvn install but have all options in the pom.xml?

Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
It's no different than any other plugin. Something like this should
work:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install-1</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals> 
				<configuration>
					<artifactId>blah</artifactId>
					<groupId>blah</groupId>
					<version>v</version>
					<file>lib/somefile.jar</file>
				</configuration>
			  </execution>
                    ...repeat...
			</executions>
		</plugin>

I don't think this is particularly common because a) it's very verbose
compared with doing it on the command line and b) install-file only
needs to be run once, so including it in the build isn't necessary.

Justin


-----Original Message-----
From: jvsrvcs [mailto:jvsrvcs@gmail.com] 
Sent: Thursday, July 30, 2009 10:51 AM
To: users@maven.apache.org
Subject: How to use mvn install but have all options in the pom.xml?


The docs on the mvn install plugin state:

mvn install:install-file -Dfile=your-artifact-1.0.jar \
                         [-DpomFile=your-pom.xml] \
                         [-Dsources=src.jar] \
                         [-Djavadoc=apidocs.jar] \
                         [-DgroupId=org.some.group] \
                         [-DartifactId=your-artifact] \
                         [-Dversion=1.0] \
                         [-Dpackaging=jar] \
                         [-Dclassifier=sources] \
                         [-DgeneratePom=true] \
                         [-DcreateChecksum=true]

So I could build a bash shell script that executes the above $mvn
install command for each jar that I want to install into the local repo.

What I want to do is to put all the options above into a pom.xml such
that the user would only have to run a single maven profile and type
only:
   $mvn -P init

and have this profile run the  install plugin run on each of about 20
dot jar files in lib/.

I have seen this done before on a project but did not write the code nor
do I have a copy of the code with me.  I know it is possible but can't
find any documentation on how to put options to $mvn install inside the
pom.xml file (instead of the command line).
--
View this message in context:
http://www.nabble.com/How-to-use-mvn-install-but-have-all-options-in-the
-pom.xml--tp24739597p24739597.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