Skip to content

Instantly share code, notes, and snippets.

@yegeniy
Last active April 27, 2017 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yegeniy/361fe75af8802a303de10c69ac78ede1 to your computer and use it in GitHub Desktop.
Save yegeniy/361fe75af8802a303de10c69ac78ede1 to your computer and use it in GitHub Desktop.
Maven Sandbox. Note that `MainClass.java` should be put under `src/main/java`
<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>net.mlbam.bdt</groupId>
<artifactId>java-sandbox</artifactId>
<version>0.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Java Sandbox</name>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<!-- Add Dependencies you need here -->
</dependencies>
<build>
<plugins>
<!-- Note the maven.compiler.source|target properties above -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
</plugin>
</plugins>
</build>
</project>
mvn clean compile exec:java -Dexec.mainClass="MainClass"
import java.util.*;
public class MainClass {
public static void main(String[] args) {
System.out.println(Arrays.deepToString(args));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment