Skip to content

Maven Project Setup

Adrian Papari edited this page Nov 24, 2013 · 15 revisions

pom.xml

0.2.0 and later

    <properties>
        <agrotera.version>0.3.0</agrotera.version>
        <lombok.pg.version>0.11.3</lombok.pg.version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>com.github.peichhorn</groupId>
            <artifactId>lombok-pg</artifactId>
            <version>${lombok.pg.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.onedaybeard.agrotera</groupId>
            <artifactId>agrotera-lombok</artifactId>
            <version>${agrotera.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Only required when using @Profile; contains ArtemisProfiler interface -->
        <dependency>
            <groupId>net.onedaybeard.agrotera</groupId>
            <artifactId>agrotera-api</artifactId>
            <version>${agrotera.version}</version>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>net.onedaybeard.agrotera</groupId>
                <artifactId>agrotera-maven-plugin</artifactId>
                <version>${agrotera.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>agrotera</goal>
                            <!-- Generates system-component matrix.html under target -->
                            <goal>matrix</goal>
                            <!-- Optionally remove all agrotera-related annotations from -->
                            <!-- compiled classes -->
                            <goal>annotation-cleaner</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Before 0.2.0

    <properties>
        <agrotera.version>0.1.1</agrotera.version>
        <lombok.pg.version>0.11.3</lombok.pg.version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>com.github.peichhorn</groupId>
            <artifactId>lombok-pg</artifactId>
            <version>${lombok.pg.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.onedaybeard.agrotera</groupId>
            <artifactId>agrotera-lombok</artifactId>
            <version>${agrotera.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Only required when using @Profile; contains ArtemisProfiler interface -->
        <dependency>
            <groupId>net.onedaybeard.agrotera</groupId>
            <artifactId>agrotera-api</artifactId>
            <version>${agrotera.version}</version>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>net.onedaybeard.agrotera</groupId>
                <artifactId>agrotera-maven-plugin</artifactId>
                <version>${agrotera.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>agrotera</goal>
                            <!-- Generates system-component matrix.html under target -->
                            <goal>matrix</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <!-- Enables agrotera-maven-plugin to run from within Eclipse -->
        <!-- Feel free to omit if not using Eclipse -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>net.onedaybeard.agrotera</groupId>
                                        <artifactId>agrotera-maven-plugin</artifactId>
                                        <versionRange>[${agrotera.version},)</versionRange>
                                        <goals>
                                            <goal>agrotera</goal>
                                            <!-- Generates system-component matrix.html under target -->
                                            <goal>matrix</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>
                                            <runOnIncremental>true</runOnIncremental>
                                            <runOnConfiguration>true<runOnConfiguration/>
                                        </execute>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

    </build>