Skip to content

Instantly share code, notes, and snippets.

@lynas
Last active November 10, 2016 07:19
Show Gist options
  • Save lynas/3cfa5766d87007d9da88d87770b5f03b to your computer and use it in GitHub Desktop.
Save lynas/3cfa5766d87007d9da88d87770b5f03b to your computer and use it in GitHub Desktop.

##parent pom

<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.lynas</groupId>
    <artifactId>parent</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
    <name>parent</name>
    <build>
        <sourceDirectory>../src</sourceDirectory>
        <resources>
            <resource>
                <directory>../src</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Child

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.lynas</groupId>
        <artifactId>parent</artifactId>
        <version>1.0</version>	
	</parent>
</project>         

Code call with properties

mvn -Dpom.build.version=sazzad install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment