Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 718
ximage Avatar asked Jun 30 '10 08:06

ximage


People also ask

What command is used to install maven which is necessary for the build process?

The short answer jar or a . war file. mvn clean install is the command to do just that. You are calling the mvn executable, which means you need Maven installed on your machine.

Does mvn clean install build?

clean is its own build lifecycle phase (which can be thought of as an action or task) in Maven. mvn clean install tells Maven to do the clean phase in each module before running the install phase for each module.

What is the difference between maven build and maven install?

First of all, build is not a phase in the standard Maven lifecycles, whereas install is one. mvn install will invoke all the phases up to the phase install , which generally consists of compiling the source code, packaging the project and installing it in the local repository.


1 Answers

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

like image 164
Cemo Avatar answered Oct 24 '22 13:10

Cemo