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

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

How to copy a resource or another in Maven depending on the target environment?

Use Maven profiles (http://maven.apache.org/guides/introduction/introduction-to-profiles.html) Create a “dev” and “prod” profile, selecting an alternate set of resources for each profile. Make Dev active by default. <profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <resources> <resource> <directory>src/main/resources/dev</directory> </resource> </resources> </build> </profile> <profile> <id>prod</id> <build> <resources> <resource> <directory>src/main/resources/prod</directory> </resource> </resources> </build> </profile> </profiles> Build using the desired profile via: … Read more

Maven automatic SNAPSHOT update

Another option (which I use) is to include the following in your pom.xml. updatePolicy tag will force maven to always use latest snapshot from this repo. <repositories> <repository> <id>you-snapshots</id> <url>http://host/nexus/repos/snapshots</url> <snapshots> <updatePolicy>always</updatePolicy> </snapshots> <releases> <updatePolicy>always</updatePolicy> </releases> </repository> </repositories> p.s. I always configure all repos in pom.xml because we use several CI servers and it will … Read more

Maven install and deploy

Yes all you have to do is look at the execution life cycle. validate – validate the project is correct and all necessary information is available compile – compile the source code of the project test – test the compiled source code using a suitable unit testing framework. These tests should not require the code … Read more

Inheriting Maven profiles

Profiles defined in a parent POM are inherited in a child POM extending the parent, there is nothing to do. And just in case, the Maven Help Plugin has very useful goals allowing to deal with profiles: help:active-profiles : lists the profiles which are currently active for the build. help:all-profiles : lists the available profiles … Read more

How can I speed up my maven2 build?

There are some possibilities to optimize some of the build tasks. For example the ‘clean’ task can be optimized from minutes to just milliseconds using simple trick – rename ‘target’ folder instead of delete. To get details how to do it refer to Speed up Maven build.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)