Skip to content

Commit 1b062d3

Browse files
committed
update for Maven
1 parent 6a41c81 commit 1b062d3

File tree

6 files changed

+140
-11
lines changed

6 files changed

+140
-11
lines changed

egg__11b_sc_utility/README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@ Summary:
44

55
* this egg illustrates a small utility class as a convenience wrapper to a custom `StructuredTaskScope`
66

7-
To Build:
8-
---------
7+
Build Notes:
8+
------------
99

10-
* tested with [this JDK](../JDK.version.md)
10+
* tested with [this jdk](../JDK.version.md)
11+
* tested with [this version](../Maven.version.md) of Maven
1112
* Gradle does not yet support JDK 19 preview (as of NOV 2022). Check [here](https://docs.gradle.org/current/userguide/compatibility.html)
12-
* unknown if Maven can be used ¯\_(ツ)_
13-
* parsing the JSON requires [Groovy](https://sdkman.io/sdks#groovy)
13+
14+
To Build (using Maven):
15+
---------------------
16+
17+
* `./mvn-go.sh` will clean, compile, exec
18+
19+
To Build (using Bash):
20+
----------------------
1421

1522
useful commands:
1623

1724
* `sdk env`
1825
- SDKMan! will set JDK to value in `.sdkmanrc`
1926
* `./clean.sh`
2027
* `./compile.sh`
28+
* `./run.sh`
29+
* note `./go.sh` is useful for clean-compile-run cycle
2130

22-
To Run:
23-
---------
24-
* in terminal 1: `./run.sh`
25-
- this runs `Runner.java`
26-
* in terminal 2: `./list-thread-info.sh`
27-
- this calls `jcmd` and parses the output with `DumpParser.groovy`

egg__11b_sc_utility/mvn-clean.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
mvn clean
6+
7+
echo "clean ok"

egg__11b_sc_utility/mvn-compile.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
mvn compile
6+
7+
echo "compile ok"

egg__11b_sc_utility/mvn-go.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
./mvn-clean.sh
6+
./mvn-compile.sh
7+
rm -f pid.txt
8+
./mvn-run.sh

egg__11b_sc_utility/mvn-run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
mvn exec:exec
6+
7+
echo "run complete"

egg__11b_sc_utility/pom.xml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>net.codetojoy</groupId>
8+
<artifactId>egg__11_sc_utility</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<name>egg__11_sc_utility</name>
12+
<url>https://github.com/codetojoy/easter_eggs_for_java_loom</url>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<maven.compiler.source>19</maven.compiler.source>
17+
<maven.compiler.target>19</maven.compiler.target>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>junit</groupId>
23+
<artifactId>junit</artifactId>
24+
<version>4.11</version>
25+
<scope>test</scope>
26+
</dependency>
27+
</dependencies>
28+
29+
<build>
30+
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
31+
<plugins>
32+
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
33+
<plugin>
34+
<artifactId>maven-clean-plugin</artifactId>
35+
<version>3.1.0</version>
36+
</plugin>
37+
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
38+
<plugin>
39+
<artifactId>maven-resources-plugin</artifactId>
40+
<version>3.0.2</version>
41+
</plugin>
42+
<plugin>
43+
<artifactId>maven-compiler-plugin</artifactId>
44+
<version>3.10.1</version>
45+
<configuration>
46+
<compilerArgs>
47+
<arg>--enable-preview</arg>
48+
<arg>--add-modules=jdk.incubator.concurrent</arg>
49+
</compilerArgs>
50+
</configuration>
51+
</plugin>
52+
<plugin>
53+
<artifactId>maven-surefire-plugin</artifactId>
54+
<version>2.22.1</version>
55+
</plugin>
56+
<plugin>
57+
<artifactId>maven-jar-plugin</artifactId>
58+
<version>3.0.2</version>
59+
</plugin>
60+
<plugin>
61+
<artifactId>maven-install-plugin</artifactId>
62+
<version>2.5.2</version>
63+
</plugin>
64+
<plugin>
65+
<artifactId>maven-deploy-plugin</artifactId>
66+
<version>2.8.2</version>
67+
</plugin>
68+
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
69+
<plugin>
70+
<artifactId>maven-site-plugin</artifactId>
71+
<version>3.7.1</version>
72+
</plugin>
73+
<plugin>
74+
<artifactId>maven-project-info-reports-plugin</artifactId>
75+
<version>3.0.0</version>
76+
</plugin>
77+
78+
<plugin>
79+
<groupId>org.codehaus.mojo</groupId>
80+
<artifactId>exec-maven-plugin</artifactId>
81+
<version>3.1.0</version>
82+
<configuration>
83+
<executable>${java.home}/bin/java</executable>
84+
<arguments>
85+
<argument>--add-modules=jdk.incubator.concurrent</argument>
86+
<argument>--enable-preview</argument>
87+
<argument>--class-path</argument>
88+
<classpath/>
89+
<argument>net.codetojoy.Runner</argument>
90+
</arguments>
91+
</configuration>
92+
</plugin>
93+
94+
</plugins>
95+
</pluginManagement>
96+
</build>
97+
</project>

0 commit comments

Comments
 (0)