maven-install-plugin: Why it does not install the artifacts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

maven-install-plugin: Why it does not install the artifacts

zosrothko
Hi

I have a pom project that is is using the maven-instal-plugin to install
3 artifacts in my local repository. But when running mvn install, none
are installed. What's wrong with this pom.xml


[INFO] Scanning for projects...

[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building maven 1.0.0
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ maven ---
[INFO] Installing C:\Users\fandre\Documents\MXW\MI-4.3\maven\pom.xml to
C:\Users\fandre\.m2\repository\fr\swisslife\archiev3\maven\1.0.0\maven-1.0.0.pom
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 0.577 s
[INFO] Finished at: 2018-03-12T10:10:17+01:00
[INFO] Final Memory: 6M/150M
[INFO]
------------------------------------------------------------------------



<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>fr.swisslife.archiev3</groupId>
     <artifactId>maven</artifactId>
     <version>1.0.0</version>

     <build>
         <plugins>
             <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
                 <version>2.5.2</version>
                 <executions>
                     <execution>
                         <id>archieutils</id>
                         <goals>
                             <goal>install</goal>
                         </goals>
                         <configuration>
<groupId>fr.swisslife.archiev3</groupId>
<artifactId>archieutils</artifactId>
<version>0.0.1-SNAPSHOT</version>
<file>archieutils-0.0.1-SNAPSHOT.jar</file>
                             <packaging>jar</packaging>
<generatePom>true</generatePom>
                         </configuration>
                     </execution>
                     <execution>
                         <id>archiedm</id>
                         <goals>
                             <goal>install</goal>
                         </goals>
                         <configuration>
<groupId>fr.swisslife.archiev3</groupId>
<artifactId>archiedm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<file>archiedm-0.0.1-SNAPSHOT.jar</file>
                             <packaging>jar</packaging>
<generatePom>true</generatePom>
                         </configuration>
                     </execution>
                     <execution>
                         <id>archieft</id>
                         <goals>
                             <goal>install</goal>
                         </goals>
                         <configuration>
<groupId>fr.swisslife.archiev3</groupId>
<artifactId>archieft</artifactId>
<version>0.0.1-SNAPSHOT</version>
<file>archieft-0.0.1-SNAPSHOT.jar</file>
                             <packaging>jar</packaging>
<generatePom>true</generatePom>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
     </build>
     <packaging>pom</packaging>
</project>


Reply | Threaded
Open this post in threaded view
|

Re: maven-install-plugin: Why it does not install the artifacts

Anders Hammar
There is a fundamental issue here. You're trying to do this the wrong way.

* The install goal is not for installing arbitrary files in the repo. For
that you should use install-file. But the install-file goal is not intended
to be bound to the build lifecycle, but for executing from the command line
("mvn install:install-file ...")
* If you want to have a Maven project which installs three artifacts during
the build lifecycle you should register the artifacts during the build. In
your case where you seem to have some pre-build artifacts you could do this
with maven-buildhelper-plugin [1]. Then they will be installed when you
execute "mvn install".

But probably the most simple way to do this is to add the artifacts to your
company's repo manager just once and then you're done with it. Nexus, for
example, provides a GUI interface to do this.

[1]
http://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html

/Anders

On Mon, Mar 12, 2018 at 2:51 PM, Zos Rothko <[hidden email]> wrote:

> Hi
>
> I have a pom project that is is using the maven-instal-plugin to install 3
> artifacts in my local repository. But when running mvn install, none are
> installed. What's wrong with this pom.xml
>
>
> [INFO] Scanning for projects...
>
> [INFO]
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Building maven 1.0.0
> [INFO] ------------------------------------------------------------
> ------------
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ maven
> ---
> [INFO] Installing C:\Users\fandre\Documents\MXW\MI-4.3\maven\pom.xml to
> C:\Users\fandre\.m2\repository\fr\swisslife\archiev3\maven\
> 1.0.0\maven-1.0.0.pom
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Total time: 0.577 s
> [INFO] Finished at: 2018-03-12T10:10:17+01:00
> [INFO] Final Memory: 6M/150M
> [INFO] ------------------------------------------------------------
> ------------
>
>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>fr.swisslife.archiev3</groupId>
>     <artifactId>maven</artifactId>
>     <version>1.0.0</version>
>
>     <build>
>         <plugins>
>             <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-install-plugin</artifactId>
>                 <version>2.5.2</version>
>                 <executions>
>                     <execution>
>                         <id>archieutils</id>
>                         <goals>
>                             <goal>install</goal>
>                         </goals>
>                         <configuration>
> <groupId>fr.swisslife.archiev3</groupId>
> <artifactId>archieutils</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <file>archieutils-0.0.1-SNAPSHOT.jar</file>
>                             <packaging>jar</packaging>
> <generatePom>true</generatePom>
>                         </configuration>
>                     </execution>
>                     <execution>
>                         <id>archiedm</id>
>                         <goals>
>                             <goal>install</goal>
>                         </goals>
>                         <configuration>
> <groupId>fr.swisslife.archiev3</groupId>
> <artifactId>archiedm</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <file>archiedm-0.0.1-SNAPSHOT.jar</file>
>                             <packaging>jar</packaging>
> <generatePom>true</generatePom>
>                         </configuration>
>                     </execution>
>                     <execution>
>                         <id>archieft</id>
>                         <goals>
>                             <goal>install</goal>
>                         </goals>
>                         <configuration>
> <groupId>fr.swisslife.archiev3</groupId>
> <artifactId>archieft</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <file>archieft-0.0.1-SNAPSHOT.jar</file>
>                             <packaging>jar</packaging>
> <generatePom>true</generatePom>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>     <packaging>pom</packaging>
> </project>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: maven-install-plugin: Why it does not install the artifacts

Karl Heinz Marbaise-3
In reply to this post by zosrothko
Hi,

On 12/03/18 14:51, Zos Rothko wrote:

> Hi
>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>      <modelVersion>4.0.0</modelVersion>
>      <groupId>fr.swisslife.archiev3</groupId>
>      <artifactId>maven</artifactId>
>      <version>1.0.0</version>
>
>      <build>
>
>
>

If I take a look at your pom file...just remove the whole configuration
for maven-install-plugin...
and just try to do:

mvn clean install


If you are artifacts installed fine if not ...there is something else
wrong..

Please at best a link to a project github/bitbucket etc...

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: maven-install-plugin: Why it does not install the artifacts

rfscholte
I think you've missed one of the last lines:
<packaging>pom</packaging>

That also explains why no other plugin is called before the  
maven-install-plugin

Robert

On Mon, 12 Mar 2018 17:35:16 +0100, Karl Heinz Marbaise  
<[hidden email]> wrote:

> Hi,
>
> On 12/03/18 14:51, Zos Rothko wrote:
>> Hi
>>   <project xmlns="http://maven.apache.org/POM/4.0.0"  
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>      <modelVersion>4.0.0</modelVersion>
>>      <groupId>fr.swisslife.archiev3</groupId>
>>      <artifactId>maven</artifactId>
>>      <version>1.0.0</version>
>>       <build>
>>
>
> If I take a look at your pom file...just remove the whole configuration  
> for maven-install-plugin...
> and just try to do:
>
> mvn clean install
>
>
> If you are artifacts installed fine if not ...there is something else  
> wrong..
>
> Please at best a link to a project github/bitbucket etc...
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: maven-install-plugin: Why it does not install the artifacts

zosrothko
In reply to this post by Karl Heinz Marbaise-3
Hi


Le 12/03/2018 à 17:35, Karl Heinz Marbaise a écrit :

> Hi,
>
> On 12/03/18 14:51, Zos Rothko wrote:
>> Hi
>>
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>      <modelVersion>4.0.0</modelVersion>
>>      <groupId>fr.swisslife.archiev3</groupId>
>>      <artifactId>maven</artifactId>
>>      <version>1.0.0</version>
>>
>>      <build>
>>
>>
>>
>
> If I take a look at your pom file...just remove the whole
> configuration for maven-install-plugin...
> and just try to do:
I do not understand your advise: How a "mvn clean install" command can
install the file/artifact if the configurations specifying those
file/artifacts are removed???

>
> mvn clean install
>
>
> If you are artifacts installed fine if not ...there is something else
> wrong..
>
> Please at best a link to a project github/bitbucket etc...
>
> Kind regards
> Karl Heinz Marbaise


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

AW: maven-install-plugin: Why it does not install the artifacts

Bernd Eckenfels
Hello,

if you start with a empty POM of type JAR the Default LifeCycle bindings (which include intall plugin) apply.
See here: http://maven.apache.org/ref/3.2.2/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging

--
http://bernd.eckenfels.net

Von: Zos Rothko
Gesendet: Dienstag, 13. März 2018 06:58
An: [hidden email]; Maven Users List
Betreff: Re: maven-install-plugin: Why it does not install the artifacts

Hi


Le 12/03/2018 à 17:35, Karl Heinz Marbaise a écrit :

> Hi,
>
> On 12/03/18 14:51, Zos Rothko wrote:
>> Hi
>>
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>      <modelVersion>4.0.0</modelVersion>
>>      <groupId>fr.swisslife.archiev3</groupId>
>>      <artifactId>maven</artifactId>
>>      <version>1.0.0</version>
>>
>>      <build>
>>
>>
>>
>
> If I take a look at your pom file...just remove the whole
> configuration for maven-install-plugin...
> and just try to do:
I do not understand your advise: How a "mvn clean install" command can
install the file/artifact if the configurations specifying those
file/artifacts are removed???

>
> mvn clean install
>
>
> If you are artifacts installed fine if not ...there is something else
> wrong..
>
> Please at best a link to a project github/bitbucket etc...
>
> Kind regards
> Karl Heinz Marbaise


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: maven-install-plugin: Why it does not install the artifacts

Anders Hammar
My understanding is that Zos has three pre-built artifacts that should be
installed in the local repo. Please see my earlier response for ponters on
how to handle this. I strongly advice you to have a repo manager and deploy
the artifacts there instead of having ot manually managing your local repo.

/Anders

On Tue, Mar 13, 2018 at 7:06 AM, Bernd Eckenfels <[hidden email]>
wrote:

> Hello,
>
> if you start with a empty POM of type JAR the Default LifeCycle bindings
> (which include intall plugin) apply.
> See here: http://maven.apache.org/ref/3.2.2/maven-core/default-
> bindings.html#Plugin_bindings_for_jar_packaging
>
> --
> http://bernd.eckenfels.net
>
> Von: Zos Rothko
> Gesendet: Dienstag, 13. März 2018 06:58
> An: [hidden email]; Maven Users List
> Betreff: Re: maven-install-plugin: Why it does not install the artifacts
>
> Hi
>
>
> Le 12/03/2018 à 17:35, Karl Heinz Marbaise a écrit :
> > Hi,
> >
> > On 12/03/18 14:51, Zos Rothko wrote:
> >> Hi
> >>
> >>
> >> <project xmlns="http://maven.apache.org/POM/4.0.0"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> >> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> >>      <modelVersion>4.0.0</modelVersion>
> >>      <groupId>fr.swisslife.archiev3</groupId>
> >>      <artifactId>maven</artifactId>
> >>      <version>1.0.0</version>
> >>
> >>      <build>
> >>
> >>
> >>
> >
> > If I take a look at your pom file...just remove the whole
> > configuration for maven-install-plugin...
> > and just try to do:
> I do not understand your advise: How a "mvn clean install" command can
> install the file/artifact if the configurations specifying those
> file/artifacts are removed???
> >
> > mvn clean install
> >
> >
> > If you are artifacts installed fine if not ...there is something else
> > wrong..
> >
> > Please at best a link to a project github/bitbucket etc...
> >
> > Kind regards
> > Karl Heinz Marbaise
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>