Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
b91714e
feat(maven): add batch executor for multi-task Maven execution
FrozenPandaz Oct 16, 2025
955eb78
feat(maven): add project selector to batch runner invocation
FrozenPandaz Oct 24, 2025
d8f69a4
feat(maven): parse TaskGraph JSON into typed Kotlin data classes
FrozenPandaz Oct 24, 2025
bc1f6e6
feat(maven): improve invoker configuration with pom file and repo set…
FrozenPandaz Oct 24, 2025
ee4801e
feat(maven): configure invoker to use workspace mvnw and add test inf…
FrozenPandaz Oct 28, 2025
1dbbada
feat(maven): add graceful SIGINT shutdown handling to batch runner
FrozenPandaz Oct 31, 2025
8a832f6
feat(maven): implement dynamic task graph execution with failure hand…
FrozenPandaz Oct 31, 2025
3f71015
chore(maven): switch batch runner from invoker to embedder API
FrozenPandaz Oct 31, 2025
1dbed5c
fix(maven): set maven.multiModuleProjectDirectory property for MavenC…
FrozenPandaz Oct 31, 2025
5276594
feat(maven): upgrade to Maven 4.x EmbeddedMavenExecutor API
FrozenPandaz Oct 31, 2025
cd0136d
chore(maven): rewrite EmbeddedMavenExecutor tests to demonstrate cont…
FrozenPandaz Oct 31, 2025
fea01c2
chore(maven): simplify tests to use Nx workspace root and intelligent…
FrozenPandaz Oct 31, 2025
df07fd2
fix(maven): restore test compilation after linter modifications
FrozenPandaz Oct 31, 2025
7496b50
feat(maven): add 'which mvn' strategy to resolve Maven home
FrozenPandaz Oct 31, 2025
9505209
fix(maven): don't return workspace root when mvnw Maven not yet cached
FrozenPandaz Oct 31, 2025
ab0e479
feat(maven): use options.workspaceRoot instead of hardcoded path
FrozenPandaz Oct 31, 2025
e21072b
feat(maven): resolve Maven home once at batch start
FrozenPandaz Oct 31, 2025
20f0ea9
cleanup(maven): separate goals from arguments in MavenExecution
FrozenPandaz Oct 31, 2025
c6d85ab
cleanup(maven): split buildMavenExecution into two methods
FrozenPandaz Oct 31, 2025
b3b80b4
cleanup(maven): pass mavenBatchTask instead of taskId to build methods
FrozenPandaz Oct 31, 2025
440c67a
feat(maven): log Maven output for each task execution
FrozenPandaz Oct 31, 2025
38ddbdd
feat(maven): create LoggingOutputStream for real-time output streaming
FrozenPandaz Oct 31, 2025
f9e1f9e
fix(maven): prevent OutOfMemoryError in LoggingOutputStream
FrozenPandaz Oct 31, 2025
67674cc
revert(maven): remove LoggingOutputStream, use simple ByteArrayOutput…
FrozenPandaz Oct 31, 2025
c860640
chore(maven): clean up unused quiet flag and lint issues
FrozenPandaz Oct 31, 2025
e6fb99f
feat(maven): add execution time logging to batch runner
FrozenPandaz Oct 31, 2025
5418405
feat(maven): add duration logging to task completion messages
FrozenPandaz Oct 31, 2025
1608c42
feat(maven): add timing for graph recalculation and task analysis
FrozenPandaz Oct 31, 2025
df6eb09
feat(maven): add timing for batch execution of root tasks
FrozenPandaz Oct 31, 2025
8642fdb
feat(maven): add timing for batch execution core work
FrozenPandaz Oct 31, 2025
7d499e5
chore(maven): add benchmark for separate vs combined Maven invocations
FrozenPandaz Oct 31, 2025
1e0ac71
feat(maven): implement Maven 3.9.11 batch executor with container reu…
FrozenPandaz Nov 3, 2025
7da726e
chore(maven): reduce log noise by moving verbose logs to debug level
FrozenPandaz Nov 3, 2025
a48d751
fix(maven): set maven.multiModuleProjectDirectory system property
FrozenPandaz Nov 3, 2025
0c183df
fix(maven): prevent infinite loop by fixing concurrent system propert…
FrozenPandaz Nov 3, 2025
9752778
fix(maven): add timeout and diagnostics for infinite loop debugging
FrozenPandaz Nov 3, 2025
36ca4fd
fix(maven): check results map instead of batchResults for task comple…
FrozenPandaz Nov 3, 2025
94fbe44
fix(maven): add per-task timeout to prevent infinite loop when Maven …
FrozenPandaz Nov 3, 2025
efa1933
fix(maven): add maven-plugin-api dependency to resolve MojoExecutionE…
FrozenPandaz Nov 3, 2025
b7855d4
fix(maven): add Maven Resolver implementation dependencies
FrozenPandaz Nov 3, 2025
e075cfb
fix(maven): add explicit Plexus component bindings for Maven 3.9.11 e…
FrozenPandaz Nov 3, 2025
e9d849b
fix(maven): remove inaccessible container pre-warm logic
FrozenPandaz Nov 3, 2025
ac732d6
feat(maven): switch to Maven 4.x EmbeddedMavenExecutor for batch exec…
FrozenPandaz Nov 3, 2025
0993009
feat(maven): log Maven output at ERROR level when tasks fail
FrozenPandaz Nov 3, 2025
1d6af1b
fix(maven): capture Maven stderr output in addition to stdout
FrozenPandaz Nov 3, 2025
48e9c6c
fix(maven): add exit code logging to diagnose null exit code issue
FrozenPandaz Nov 3, 2025
4bf3c7a
fix(maven): use Callable to properly capture Maven exit code from exe…
FrozenPandaz Nov 3, 2025
e2e4314
chore(maven): add performance benchmark to measure executor overhead
FrozenPandaz Nov 3, 2025
1fd9d8a
feat(maven): log Maven output at INFO level for successful tasks too
FrozenPandaz Nov 3, 2025
6425806
docs(maven): add Phase 2 & 3 optimization strategy and rules
FrozenPandaz Nov 3, 2025
5319d49
chore(maven): remove PerformanceBenchmarkTest and cleanup references
FrozenPandaz Nov 3, 2025
cf19474
chore(repo): stop tracking CLAUDE.local.md
FrozenPandaz Nov 3, 2025
221880b
feat(maven): reduce batch runner overhead by reusing timeout executor
FrozenPandaz Nov 3, 2025
81527bd
feat(maven): implement session-based project caching for batch executor
FrozenPandaz Nov 3, 2025
14f4559
fix(maven): add maven-model dependency for MavenSession initialization
FrozenPandaz Nov 3, 2025
b1fc4d8
chore(maven): implement functional integration test that actually exe…
FrozenPandaz Nov 3, 2025
bba24da
fix(maven): update integration tests to gracefully handle Maven 3.9 c…
FrozenPandaz Nov 3, 2025
afb91e0
feat(maven): add version-agnostic executor with Maven 3.9.x fallback …
FrozenPandaz Nov 3, 2025
6a0e396
fix(maven): use ProcessBasedMavenExecutor as default for reliability …
FrozenPandaz Nov 3, 2025
1718707
feat(maven): implement ProperMavenSessionExecutor using Maven 4.x DI …
FrozenPandaz Nov 3, 2025
f81b970
fix(maven): add maven-resolver-impl to fix SessionBuilder ClassNotFou…
FrozenPandaz Nov 3, 2025
9d1fab9
fix(maven): upgrade maven-resolver to 2.0.9 to include SessionBuilder
FrozenPandaz Nov 3, 2025
40976d7
fix(maven): use correct getInstance(Class) method signature for Injec…
FrozenPandaz Nov 3, 2025
1bb2af3
feat(maven): implement ResidentMavenExecutor using official Maven 4.x…
FrozenPandaz Nov 3, 2025
65dcab6
fix(maven): improve error output in ResidentMavenExecutor for better …
FrozenPandaz Nov 3, 2025
f5cc08a
fix(maven): set maven.home in ParserRequest to fix embedded mode parsing
FrozenPandaz Nov 3, 2025
67f1c17
fix(maven): improve Maven home detection using 'which mvn' and common…
FrozenPandaz Nov 3, 2025
538e4ce
fix(maven): prioritize Maven wrapper over system Maven for home detec…
FrozenPandaz Nov 3, 2025
766a87c
fix(maven): extract Maven version from wrapper config before fallback…
FrozenPandaz Nov 3, 2025
a389365
feat(maven): detect Maven home from ./mvnw --version output
FrozenPandaz Nov 3, 2025
04e363b
fix(maven): verify Maven version from 'which mvn' and skip Maven 3.x
FrozenPandaz Nov 3, 2025
a7c1929
fix(maven): cache Maven home during initialization to avoid repeated …
FrozenPandaz Nov 3, 2025
b10572a
fix(maven): add missing dependencies for ResidentMavenInvoker and fix…
FrozenPandaz Nov 3, 2025
8ddb153
fix(maven): return exit code instead of throwing exception from execu…
FrozenPandaz Nov 3, 2025
39959b5
fix(maven): update dependencies to 4.0.0-rc-4 with Guice 5.1.0
FrozenPandaz Nov 3, 2025
127c3b7
fix(maven): restore stdOut/stdErr in ParserRequest following Maven te…
FrozenPandaz Nov 3, 2025
ea6cd56
fix(maven): use SystemClassLoader for ClassWorld to resolve PlexusCon…
FrozenPandaz Nov 4, 2025
69b2662
fix(maven): set TCCL to SystemClassLoader before invoker.invoke()
FrozenPandaz Nov 4, 2025
86d86be
fix(maven): use batch-runner's classloader for ClassWorld and TCCL
FrozenPandaz Nov 4, 2025
cde0c43
fix(maven): add plexus-container-default 2.1.1 dependency
FrozenPandaz Nov 4, 2025
34931cd
fix(maven): add explicit exclusions for plexus-container-default tran…
FrozenPandaz Nov 4, 2025
4f08b1e
simplify(maven): remove unnecessary exclusions from pom
FrozenPandaz Nov 4, 2025
0bcdbe4
fix(maven): prioritize Maven 4.x detection and improve error handling
FrozenPandaz Nov 4, 2025
9c8344a
fix(maven): prefer Maven 4.0.0 final over rc-4 and improve error mess…
FrozenPandaz Nov 4, 2025
6639809
fix(maven): automatically patch Maven lib with plexus-container-defau…
FrozenPandaz Nov 4, 2025
b0c4714
fix(maven): patch org.eclipse.sisu.plexus JAR to remove old plexus-co…
FrozenPandaz Nov 4, 2025
6b84a5d
fix(maven): minimize shaded dependencies and load Maven lib JARs into…
FrozenPandaz Nov 4, 2025
230ddb8
fix(maven): simplify TCCL handling by setting it once during initiali…
FrozenPandaz Nov 4, 2025
0144516
chore(maven): remove thread pool, execute tasks sequentially
FrozenPandaz Nov 4, 2025
26a6966
chore(maven): add debug logging to JAR loading and initialization
FrozenPandaz Nov 4, 2025
0cfd700
fix(maven): shade plexus-container-default since Maven 4.x doesn't sh…
FrozenPandaz Nov 4, 2025
b1edc0b
fix(maven): shade Guice since Maven 4.x doesn't ship it
FrozenPandaz Nov 4, 2025
9d863a1
fix(maven): add maven-model 4.0.0-rc-4 to shaded dependencies to reso…
FrozenPandaz Nov 4, 2025
4d6f203
feat(maven): re-enable thread pool for parallel batch task execution
FrozenPandaz Nov 4, 2025
51fcd79
chore(maven): add .gitignore for batch-runner module
FrozenPandaz Nov 4, 2025
c6e23bf
feat(maven): add explicit cache hit detection logging to confirm cont…
FrozenPandaz Nov 4, 2025
c5d270e
fix(maven): improve cache hit detection with realistic thresholds
FrozenPandaz Nov 4, 2025
766a409
feat(maven): implement work-stealing task queue scheduler for cross-p…
FrozenPandaz Nov 4, 2025
d72b2ec
chore(maven): add detailed timing instrumentation to identify overhea…
FrozenPandaz Nov 4, 2025
1b951fc
chore(maven): enable debug logging through NX_VERBOSE_LOGGING environ…
FrozenPandaz Nov 4, 2025
568c64f
chore(maven): format TypeScript executor with prettier
FrozenPandaz Nov 4, 2025
8820050
feat(maven): implement session reuse optimization for 50-97% performa…
FrozenPandaz Nov 4, 2025
e0f03e2
fix(maven): ensure batch runner process exits properly on task failures
FrozenPandaz Nov 4, 2025
833ab5c
fix(maven): use Runtime.halt() to ensure process exit
FrozenPandaz Nov 4, 2025
22c821a
fix(maven): use daemon threads to prevent blocking JVM exit
FrozenPandaz Nov 4, 2025
6d39e12
fix(maven): count down latch for skipped tasks
FrozenPandaz Nov 4, 2025
3f3b5ed
fix(maven): add -N flag to prevent loading all projects in reactor
FrozenPandaz Nov 4, 2025
25b8e56
chore(maven): remove dead SessionCachingMavenExecutor code
FrozenPandaz Nov 4, 2025
23ce2f2
feat(maven): implement NxMaven wrapper for session state persistence
FrozenPandaz Nov 5, 2025
dc892cd
fix(maven): access Maven service from proto lookup to avoid NPE
FrozenPandaz Nov 5, 2025
f759632
feat(maven): implement session preservation using NxMaven and reflection
FrozenPandaz Nov 5, 2025
b779554
fix(maven): cache both session and chainedWorkspaceReader in NxMaven
FrozenPandaz Nov 5, 2025
4bfed00
chore(maven): add diagnostic logging to verify NxMaven is being used
FrozenPandaz Nov 5, 2025
beb0899
fix(maven): add null checks for res.lookup and fallback injection
FrozenPandaz Nov 5, 2025
d3797c3
feat(maven): pre-register NxMaven in ProtoLookup at initialization
FrozenPandaz Nov 5, 2025
6104303
feat(maven): use class mapping instead of manual instantiation for Nx…
FrozenPandaz Nov 5, 2025
48d0bee
chore(maven): remove Maven shading, rely on Maven home instead
FrozenPandaz Nov 5, 2025
8a944bd
fix(maven): revert Maven shading back to compile scope
FrozenPandaz Nov 5, 2025
4180f8d
fix(maven): properly instantiate NxMaven with all required dependencies
FrozenPandaz Nov 5, 2025
d8b21e3
feat(maven): add session caching extension to preserve Maven session …
FrozenPandaz Nov 5, 2025
33386be
chore(maven): use extension to register NxMaven instead of manual inj…
FrozenPandaz Nov 5, 2025
9126b96
chore(maven): manually register NxMavenRegistrationExtension before i…
FrozenPandaz Nov 5, 2025
f09c6f8
chore(maven): lazily create NxMavenRegistrationExtension on first con…
FrozenPandaz Nov 5, 2025
71f7f06
chore(maven): register NxMaven in lookup so Maven actually uses it
FrozenPandaz Nov 5, 2025
f0a9ff3
chore(maven): add verification logging for NxMaven registration in Pl…
FrozenPandaz Nov 5, 2025
846efd7
chore(maven): look up actual Maven component from context lookup to v…
FrozenPandaz Nov 5, 2025
8f32ed6
fix(maven): register NxMaven in Plexus container to preserve session …
FrozenPandaz Nov 5, 2025
cec755c
feat(maven): implement session caching to avoid project rescans
FrozenPandaz Nov 5, 2025
348aec3
chore(maven): always use doExecute() with managed session
FrozenPandaz Nov 5, 2025
1e5c1f8
fix(maven): reseed session into scope for each invocation
FrozenPandaz Nov 5, 2025
cb5eb3f
fix(maven): update request goals instead of caching session across di…
FrozenPandaz Nov 5, 2025
66f1c4e
chore(maven): add diagnostic logging to trace NxMaven and createContext
FrozenPandaz Nov 5, 2025
4a20b7b
chore(maven): add detailed nxMaven state logging on context reuse
FrozenPandaz Nov 5, 2025
b417387
fix(maven): defer NxMaven creation until after first successful execu…
FrozenPandaz Nov 5, 2025
109ac09
chore(maven): add detailed diagnostic logging for second invocation
FrozenPandaz Nov 5, 2025
db49451
fix(maven): don't cache context - create fresh context each invocation
FrozenPandaz Nov 5, 2025
2fc8e11
fix(maven): capture session from DefaultMaven instead of creating it
FrozenPandaz Nov 5, 2025
9012ab5
fix(maven): simplify session creation for batch execution
FrozenPandaz Nov 5, 2025
b1d4585
fix(maven): create and cache session on first NxMaven invocation
FrozenPandaz Nov 6, 2025
d17c845
fix(maven): remove dependency-reduced-pom.xml from git tracking
nx-cloud[bot] Nov 6, 2025
5a0d4d2
fix(maven): populate session.projects from built graph for cached ses…
FrozenPandaz Nov 6, 2025
0f51a63
fix(maven): populate project map alongside projects list for cached s…
FrozenPandaz Nov 6, 2025
3ae6238
fix(maven): populate session.allProjects in addition to session.projects
FrozenPandaz Nov 6, 2025
313cd04
fix(maven): use graph.allProjects in addition to graph.sortedProjects…
FrozenPandaz Nov 6, 2025
5ba5d8d
fix(maven): filter session.projects to respect project selection
FrozenPandaz Nov 6, 2025
4be3205
fix(maven): separate graph building into init block
FrozenPandaz Nov 6, 2025
e7d1097
fix(maven): add detailed logging to debug graph build in init
FrozenPandaz Nov 6, 2025
c0c45e7
fix(maven): build graph in init with mock request
FrozenPandaz Nov 6, 2025
8424891
fix(maven): build project graph cache from first real request
FrozenPandaz Nov 6, 2025
1dcea05
fix(maven): refactor to create fresh session per execution with cache…
FrozenPandaz Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ storybook-static
.kotlin

.claude/settings.local.json
CLAUDE.local.md

.cursor/rules/nx-rules.mdc
.cursor/mcp.json
Expand Down
1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tools]
dotnet = "9"
java = "24"
maven = "latest"
node = "24"
rust = "1.90.0"
24 changes: 24 additions & 0 deletions packages/maven/batch-runner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build artifacts
target/
*.class
*.jar
*.war
*.ear
*.zip

# IDE
.idea/
.vscode/
*.iml
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Dependencies
dependency-reduced-pom.xml

# Runtime
*.log
75 changes: 75 additions & 0 deletions packages/maven/batch-runner/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>dev.nx.maven</groupId>
<artifactId>maven-batch-runner</artifactId>
<name>Nx Maven Batch Runner</name>
<version>0.0.9-SNAPSHOT</version>
<description>Batch runner for Nx Maven plugin using Maven Embedder API</description>
<url>https://github.com/nrwl/nx/packages/nx-maven-parent/maven-batch-runner</url>
<developers>
<developer>
<name>Nx Team</name>
<email>[email protected]</email>
<organization>Nrwl</organization>
<organizationUrl>https://nrwl.io</organizationUrl>
</developer>
</developers>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/nrwl/nx.git/packages/nx-maven-parent/maven-batch-runner</connection>
<developerConnection>scm:git:ssh://github.com:nrwl/nx.git/packages/nx-maven-parent/maven-batch-runner</developerConnection>
<url>https://github.com/nrwl/nx/tree/master/packages/nx-maven-parent/maven-batch-runner</url>
</scm>
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>apache-snapshots</id>
<name>Apache Snapshots</name>
<url>https://repository.apache.org/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
<exclusion>
<artifactId>junit-jupiter-params</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
<exclusion>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>1.9.22</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
243 changes: 243 additions & 0 deletions packages/maven/batch-runner/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>dev.nx.maven</groupId>
<artifactId>nx-maven-parent</artifactId>
<version>0.0.9-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>maven-batch-runner</artifactId>
<packaging>jar</packaging>

<name>Nx Maven Batch Runner</name>
<description>Batch runner for Nx Maven plugin using Maven Embedder API</description>

<repositories>
<!-- Apache Snapshots for Maven 4.x beta artifacts -->
<repository>
<id>apache-snapshots</id>
<name>Apache Snapshots</name>
<url>https://repository.apache.org/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>

<dependencies>
<!-- Maven 4.0.0-rc-4 CLI for ResidentMavenInvoker (shaded - needed for bootstrap) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-cli</artifactId>
<version>4.0.0-rc-4</version>
<scope>compile</scope>
</dependency>

<!-- Maven JLine for message formatting (shaded - needed for maven-cli) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-jline</artifactId>
<version>4.0.0-rc-4</version>
<scope>compile</scope>
</dependency>

<!-- Maven Executor API (shaded - needed for bootstrap) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-executor</artifactId>
<version>4.0.0-rc-4</version>
<scope>compile</scope>
</dependency>

<!-- Maven Core (shaded - needed for DefaultMaven and execution classes) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>4.0.0-rc-4</version>
<scope>compile</scope>
</dependency>

<!-- Maven Plugin API (shaded - needed for plugin execution) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>4.0.0-rc-4</version>
<scope>compile</scope>
</dependency>

<!-- Maven Model (shaded - needed for project/dependency model) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>4.0.0-rc-4</version>
<scope>compile</scope>
</dependency>

<!-- Guice - MUST be shaded (not in Maven 4.x lib, but needed by maven-cli) -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
<classifier>classes</classifier>
<scope>compile</scope>
</dependency>

<!-- Sisu Plexus - MUST be shaded for PlexusContainer and related classes -->
<!-- Maven 4.x includes this in lib, but for standalone JAR we need to shade it -->
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.9.0.M4</version>
<scope>compile</scope>
</dependency>

<!-- Logging - MUST be shaded (runtime doesn't guarantee it) -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>compile</scope>
</dependency>

<!-- JSON parsing - MUST be shaded (not part of Maven) -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<scope>test</scope>
</dependency>

<!-- Logging for testing -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Kotlin Compiler -->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Java Compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>

<!-- Failsafe for Integration Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Shade Plugin for uber JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${project.build.directory}/batch-runner.jar</outputFile>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>dev.nx.maven.NxMavenBatchRunnerKt</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<!-- Combine META-INF resources for plexus components -->
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/sisu/javax.inject.Named</resource>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
</build>
</project>
15 changes: 15 additions & 0 deletions packages/maven/batch-runner/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"projectType": "application",
"name": "maven-batch-runner",
"targets": {
"package": {
"executor": "nx:run-commands",
"options": {
"command": "mvn clean package -q -DskipTests=true",
"cwd": "packages/maven/batch-runner"
},
"outputs": ["{projectRoot}/target/*.jar"]
}
},
"tags": []
}
Loading
Loading