maven-2installationphase

How to skip install phase in Maven build if I already have this version installed in repo


I have a project that consist of 3 different libraries. When I run install script it takes all libraries from repo and run mvn clean install on them. But this version of library already installed in repo. Is there a way to skip install phase if version in pom.xml equal version in my local repo.

I know that I can use local repo and just set dependencies. But my boss want that our project can build only with public repos and without any our repos.


Solution

  • You can bypass like this

    -Dmaven.install.skip=true
    

    <profiles>
       <profile>
         <id>skipInstall</id>
         <activation>
           <property>
             <name>maven.install.skip</name>
             <value>true</value>
           </property>
         </activation>
         <build>
           <pluginManagement>
             <plugins>
               <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-install-plugin</artifactId>
                 <executions>
                   <execution>
                     <id>default-install</id>
                     <phase>none</phase>
                   </execution>
                 </executions>
               </plugin>
             </plugins>
           </pluginManagement>
         </build>
       </profile>
    

    Last week Olivier Lamy patched this jira.

    MINSTALL-73