Skip to content

Commit fd4f9db

Browse files
java: add maven project
1 parent 8c9aee0 commit fd4f9db

File tree

6 files changed

+121
-1
lines changed

6 files changed

+121
-1
lines changed

template/java/.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# https://github.com/github/gitignore/blob/main/Java.gitignore
2+
3+
# Compiled class file
4+
*.class
5+
6+
# Log file
7+
*.log
8+
9+
# BlueJ files
10+
*.ctxt
11+
12+
# Mobile Tools for Java (J2ME)
13+
.mtj.tmp/
14+
15+
# Package Files #
16+
*.jar
17+
*.war
18+
*.nar
19+
*.ear
20+
*.zip
21+
*.tar.gz
22+
*.rar
23+
24+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
25+
hs_err_pid*
26+
replay_pid*
27+
28+
# https://github.com/github/gitignore/blob/main/Java.gitignore
29+
30+
target/
31+
pom.xml.tag
32+
pom.xml.releaseBackup
33+
pom.xml.versionsBackup
34+
pom.xml.next
35+
release.properties
36+
dependency-reduced-pom.xml
37+
buildNumber.properties
38+
.mvn/timing.properties
39+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
40+
.mvn/wrapper/maven-wrapper.jar
41+
42+
# Eclipse m2e generated files
43+
# Eclipse Core
44+
.project
45+
# JDT-specific (Eclipse Java Development Tools)
46+
.classpath

template/java/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test:
2+
@mvn test
3+
run:
4+
@mvn -q exec:java

template/java/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
55

6-
outputs = { self, nixpkgs }:
6+
outputs = { nixpkgs, ... }:
77
let
88
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
99
in

template/java/pom.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>dev.minizilla</groupId>
5+
<artifactId>javaproject</artifactId>
6+
<packaging>jar</packaging>
7+
<version>1.0-SNAPSHOT</version>
8+
<name>javaproject</name>
9+
<url>https://minizilla.dev</url>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
</properties>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>junit</groupId>
18+
<artifactId>junit</artifactId>
19+
<version>3.8.1</version>
20+
<scope>test</scope>
21+
</dependency>
22+
</dependencies>
23+
24+
<build>
25+
<plugins>
26+
<plugin>
27+
<groupId>org.codehaus.mojo</groupId>
28+
<artifactId>exec-maven-plugin</artifactId>
29+
<version>3.5.0</version>
30+
<configuration>
31+
<mainClass>dev.minizilla.javaproject.App</mainClass>
32+
</configuration>
33+
<executions>
34+
<execution>
35+
<goals>
36+
<goal>java</goal>
37+
</goals>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
44+
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package dev.minizilla.javaproject;
2+
3+
public class App {
4+
public static void main(String[] args) {
5+
System.out.println("Hello World!");
6+
}
7+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package dev.minizilla.javaproject;
2+
3+
import junit.framework.Test;
4+
import junit.framework.TestCase;
5+
import junit.framework.TestSuite;
6+
7+
public class AppTest extends TestCase {
8+
public AppTest(String testName) {
9+
super(testName);
10+
}
11+
12+
public static Test suite() {
13+
return new TestSuite(AppTest.class);
14+
}
15+
16+
public void testApp() {
17+
assertTrue(true);
18+
}
19+
}

0 commit comments

Comments
 (0)