jorgebastida / gordon

λ Gordon is a tool to create, wire and deploy AWS Lambdas using CloudFormation
Other
2.04k stars 137 forks source link

Add a --mvn flag that builds with mvn package #98

Closed kmonkeyjam closed 8 years ago

kmonkeyjam commented 8 years ago

This assumes you have maven with an outputDir set for packaging that looks like gradle that takes an outputDir directory that is the temp directory generated by gordon. Not sure where to put this documentation:

<build>
    <outputDirectory>${outputDir}</outputDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>8</source>
          <target>8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${outputDir}/lib</outputDirectory>
              <includeScope>runtime</includeScope>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
kmonkeyjam commented 8 years ago

Adam is going to make some modifications to this and re-submit a better pull request.