Is it possible that I use a mvn deploy for a single parent pom? This pom.xml file will be the parent pom of all my projects. Is it possible for me to deploy just this pom.xml file and no other artifact?
If i use this as my company wide pom, do i have to include the module tag.
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>onestopspot</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>OneStopSpot - Parent</name>
<description>Android application for OneStopspot</description>
<distributionManagement>
<repository>
<id>confiz-repo</id>
<url>http://10.10.10.230:8081/nexus/content/repositories/snapshots/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</distributionManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<sdk>
<platform>10</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>api_library</module>
<module>instrumentation</module>
</modules>
</project>
Yes, in fact this is a standard practice to reduce the amount of boilerplate in project POMs.
For more information on parent POMs: https://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-project-relationships.html#pom-relationships-sect-project-inheritance
And for using POM-only projects to keep boilerplate out of project POMs: https://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-best-practice.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With