Compare commits

..

74 commits
2.1.0 ... main

Author SHA1 Message Date
Geert Bevin 45c86e7efa Updated readme badge
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-linux (23) (push) Has been cancelled
bld-ci / build-linux (24) (push) Has been cancelled
bld-ci / build-linux (25) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-macos (23) (push) Has been cancelled
bld-ci / build-macos (24) (push) Has been cancelled
bld-ci / build-macos (25) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
bld-ci / build-windows (23) (push) Has been cancelled
bld-ci / build-windows (24) (push) Has been cancelled
bld-ci / build-windows (25) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
2026-04-28 19:56:30 -04:00
Geert Bevin 400dca63d7 Test fixes for new sonatype retention rules 2026-04-28 19:50:18 -04:00
Geert Bevin 7b542ac5d0
Merge pull request #76 from ethauvin/main
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-linux (23) (push) Has been cancelled
bld-ci / build-linux (24) (push) Has been cancelled
bld-ci / build-linux (25) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-macos (23) (push) Has been cancelled
bld-ci / build-macos (24) (push) Has been cancelled
bld-ci / build-macos (25) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
bld-ci / build-windows (23) (push) Has been cancelled
bld-ci / build-windows (24) (push) Has been cancelled
bld-ci / build-windows (25) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
Add support for multiple input types in path-related javac options
2026-03-05 19:02:46 -05:00
Erik C. Thauvin aa10006ce2
Remove redundant null/empty checks 2026-01-25 18:28:39 -08:00
Erik C. Thauvin 4de8d3c629
Handle null values in path and comma-separated options via stream filters 2026-01-25 11:37:35 -08:00
Erik C. Thauvin 44144ce095
Add missing null/empty checks 2026-01-25 11:20:24 -08:00
Erik C. Thauvin 3160161299
Update copyright 2026-01-22 00:19:36 -08:00
Erik C. Thauvin b22257ed43
Refactor javac options to improve consistency and handle null/empty parameters 2026-01-22 00:16:50 -08:00
Erik C. Thauvin 25c77ed5df
Improve method consistency 2026-01-21 15:01:17 -08:00
Erik C. Thauvin 21ed5912f0
Add support for multiple input types (Collection, Varargs, File, Path) in JavacOptions path-related methods. 2026-01-21 11:37:20 -08:00
Erik C. Thauvin 737927da26
Refactor XLint options for better handling of null/empty lists.
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-linux (23) (push) Has been cancelled
bld-ci / build-linux (24) (push) Has been cancelled
bld-ci / build-linux (25) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-macos (23) (push) Has been cancelled
bld-ci / build-macos (24) (push) Has been cancelled
bld-ci / build-macos (25) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
bld-ci / build-windows (23) (push) Has been cancelled
bld-ci / build-windows (24) (push) Has been cancelled
bld-ci / build-windows (25) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
2026-01-11 11:33:00 -08:00
Erik C. Thauvin 6fd3948f04
Add JUnit reporter integration and update workflow steps 2026-01-11 11:17:15 -08:00
Erik C. Thauvin c537b584f2
Add unit tests for JavacOptions class 2026-01-11 11:17:15 -08:00
Erik C. Thauvin 7a419ed197
Add support for -Xlint options in JavacOptions 2026-01-11 11:17:15 -08:00
Erik C. Thauvin 9c5928f9b1
Cleanup Javadocs 2026-01-11 11:17:15 -08:00
Erik C. Thauvin 26ff495b79
Fix containsRelease method to check for --release instead of -release in JavacOptions 2026-01-11 11:17:15 -08:00
Erik C. Thauvin 585325dd46
Add support for --add-reads, --default-module-for-created-files and --patch-module in JavacOptions 2026-01-11 11:17:15 -08:00
Erik C. Thauvin 793fde47dc
Add support for --add-exports in JavacOptions 2026-01-11 11:17:15 -08:00
Erik C. Thauvin fea026a9c6
Add support for --source and --target in JavacOptions 2026-01-11 11:17:14 -08:00
Erik C. Thauvin c71a98c6ee
Allow for modulePath and classPath specification using a File array or collection 2026-01-11 11:17:14 -08:00
Erik C. Thauvin 8ad5414d67
Revise README to focus on contributing guidelines
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-linux (23) (push) Has been cancelled
bld-ci / build-linux (24) (push) Has been cancelled
bld-ci / build-linux (25) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-macos (23) (push) Has been cancelled
bld-ci / build-macos (24) (push) Has been cancelled
bld-ci / build-macos (25) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
bld-ci / build-windows (23) (push) Has been cancelled
bld-ci / build-windows (24) (push) Has been cancelled
bld-ci / build-windows (25) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
Updated the README to replace the 'Building bld' section with a link to the 'CONTRIBUTING.md' file.
2025-12-30 12:45:43 -08:00
Erik C. Thauvin 684c697896
Create CONTRIBUTING.md with contribution instructions
Added contributing guidelines for the project.
2025-12-30 12:39:52 -08:00
Geert Bevin affa9e1dac Updated RIFE2/core
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-linux (23) (push) Has been cancelled
bld-ci / build-linux (24) (push) Has been cancelled
bld-ci / build-linux (25) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-macos (23) (push) Has been cancelled
bld-ci / build-macos (24) (push) Has been cancelled
bld-ci / build-macos (25) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
bld-ci / build-windows (23) (push) Has been cancelled
bld-ci / build-windows (24) (push) Has been cancelled
bld-ci / build-windows (25) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
2025-11-17 21:52:04 -05:00
Geert Bevin 1c70337afb Added Java 23 and 24 to CI tests 2025-11-17 21:45:32 -05:00
Geert Bevin 25bf0d3595 Added Java 25 to CI tests 2025-11-17 21:28:50 -05:00
Geert Bevin 0ec366e90b Updated RIFE2/core to version 1.9.3 2025-11-17 21:26:52 -05:00
Geert Bevin 8559696a6a Revert "Fixed missing main-class when running a modular application."
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
This reverts commit 82705b952b.
2025-11-16 20:07:04 -05:00
Geert Bevin 6f54789dd9
Merge pull request #65 from Xasmedy/main
Some checks are pending
bld-ci / build-linux (17) (push) Waiting to run
bld-ci / build-linux (20) (push) Waiting to run
bld-ci / build-linux (21) (push) Waiting to run
bld-ci / build-linux (22) (push) Waiting to run
bld-ci / build-macos (17) (push) Waiting to run
bld-ci / build-macos (20) (push) Waiting to run
bld-ci / build-macos (21) (push) Waiting to run
bld-ci / build-macos (22) (push) Waiting to run
bld-ci / build-windows (17) (push) Waiting to run
bld-ci / build-windows (20) (push) Waiting to run
bld-ci / build-windows (21) (push) Waiting to run
bld-ci / build-windows (22) (push) Waiting to run
javadocs-pages / deploy (push) Waiting to run
Fixed missing main-class when running a modular application.
2025-11-16 11:17:30 -05:00
Geert Bevin 82fe6a3aa4
Merge pull request #71 from ethauvin/main
Log missing files when compiling or running
2025-11-16 11:16:54 -05:00
Geert Bevin 52e8a6ce6a Test fixes 2025-11-16 11:16:05 -05:00
Erik C. Thauvin f33108a3f0
Log missing main class or module when running. Closes #69 2025-11-14 20:52:59 -08:00
Erik C. Thauvin f4db05581b
Log missing source files when compiling. Closes #66 2025-11-14 20:49:00 -08:00
Erik C. Thauvin ba1dad4eb3
2.3.1-SNAPSHOT 2025-11-14 20:48:53 -08:00
xasmedy 82705b952b Fixed missing main-class when running a modular application.
The `RunOperation` is using the java `-m` flag to run the modular application, but it did not provide the required main-class as of documentation `-m <module>[/<mainclass>] [args...]`.
2025-11-13 00:13:20 +01:00
Geert Bevin 5efbc8c064 Updated readme
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
2025-07-06 21:42:38 -04:00
Geert Bevin 22752668b7 Updated version to 2.3.0.
Some checks are pending
bld-ci / build-linux (17) (push) Waiting to run
bld-ci / build-linux (20) (push) Waiting to run
bld-ci / build-linux (21) (push) Waiting to run
bld-ci / build-linux (22) (push) Waiting to run
bld-ci / build-macos (17) (push) Waiting to run
bld-ci / build-macos (20) (push) Waiting to run
bld-ci / build-macos (21) (push) Waiting to run
bld-ci / build-macos (22) (push) Waiting to run
bld-ci / build-windows (17) (push) Waiting to run
bld-ci / build-windows (20) (push) Waiting to run
bld-ci / build-windows (21) (push) Waiting to run
bld-ci / build-windows (22) (push) Waiting to run
javadocs-pages / deploy (push) Waiting to run
Upgraded to bld 2.3.0.
Updated RIFE2/core.
2025-07-05 23:18:31 -04:00
Geert Bevin 9bea6d47c7 Updated version to 2.3.0-SNAPSHOT 2025-07-05 22:20:00 -04:00
Geert Bevin b0596911ed Updated readme with snapshot shield
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
2025-07-04 19:20:34 -04:00
Geert Bevin e9906c0df7 Display error message when staging repository fails to be closed. 2025-07-04 18:13:08 -04:00
Geert Bevin d3d7614e7c Added support for automatically closing staging repositories with the new central staging API. 2025-07-04 14:31:30 -04:00
Geert Bevin 91a621dfea Added new sonatype central publishing repositories that replace the OOSRH repositories, called CENTRAL_RELEASED and CENTRAL_SNAPSHOTS.
Some checks are pending
bld-ci / build-linux (17) (push) Waiting to run
bld-ci / build-linux (20) (push) Waiting to run
bld-ci / build-linux (21) (push) Waiting to run
bld-ci / build-linux (22) (push) Waiting to run
bld-ci / build-macos (17) (push) Waiting to run
bld-ci / build-macos (20) (push) Waiting to run
bld-ci / build-macos (21) (push) Waiting to run
bld-ci / build-macos (22) (push) Waiting to run
bld-ci / build-windows (17) (push) Waiting to run
bld-ci / build-windows (20) (push) Waiting to run
bld-ci / build-windows (21) (push) Waiting to run
bld-ci / build-windows (22) (push) Waiting to run
javadocs-pages / deploy (push) Waiting to run
Updated bld to use the new snapshot repository instead.
Worked around new sonatype publishing repositories not allowing signed Maven metadata files.
2025-07-03 13:08:26 -04:00
Geert Bevin 5af8ca7b2e WIP additional debugging information when publishing upload fails
Some checks are pending
bld-ci / build-linux (17) (push) Waiting to run
bld-ci / build-linux (20) (push) Waiting to run
bld-ci / build-linux (21) (push) Waiting to run
bld-ci / build-linux (22) (push) Waiting to run
bld-ci / build-macos (17) (push) Waiting to run
bld-ci / build-macos (20) (push) Waiting to run
bld-ci / build-macos (21) (push) Waiting to run
bld-ci / build-macos (22) (push) Waiting to run
bld-ci / build-windows (17) (push) Waiting to run
bld-ci / build-windows (20) (push) Waiting to run
bld-ci / build-windows (21) (push) Waiting to run
bld-ci / build-windows (22) (push) Waiting to run
javadocs-pages / deploy (push) Waiting to run
2025-07-02 22:41:24 -04:00
Geert Bevin d6d3c0fc1d Updated version to 2.2.2-SNAPSHOT
Some checks failed
bld-ci / build-linux (17) (push) Has been cancelled
bld-ci / build-linux (20) (push) Has been cancelled
bld-ci / build-linux (21) (push) Has been cancelled
bld-ci / build-linux (22) (push) Has been cancelled
bld-ci / build-macos (17) (push) Has been cancelled
bld-ci / build-macos (20) (push) Has been cancelled
bld-ci / build-macos (21) (push) Has been cancelled
bld-ci / build-macos (22) (push) Has been cancelled
bld-ci / build-windows (17) (push) Has been cancelled
bld-ci / build-windows (20) (push) Has been cancelled
bld-ci / build-windows (21) (push) Has been cancelled
bld-ci / build-windows (22) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled
2025-02-24 21:02:58 -05:00
Geert Bevin 9158e7296f Upgraded GitHub actions 2025-02-24 20:39:56 -05:00
Geert Bevin b1b5c89c78 Updated version to 2.2.1 2025-02-24 20:29:27 -05:00
Geert Bevin 4b6cac6ace Improvement to environment API for process operation. 2025-01-22 19:14:13 -05:00
Geert Bevin 9362a60c52 More tests 2025-01-22 18:51:05 -05:00
Geert Bevin ca7fa0c4b8 Fixed #58 : Add an option to set environment variables before spawining a process 2025-01-22 18:30:07 -05:00
Geert Bevin f9f20e62ef Fixed #57 : Add an option to check if project required settins have been set 2025-01-21 21:19:45 -05:00
Geert Bevin 4b762796e0 Updated version to 2.2.1-SNAPSHOT 2025-01-21 21:08:31 -05:00
Geert Bevin 03a15433ff Updated version to 2.2.0.
Updated versions for RIFE2 project creation.
Updated RIFE2/core.
2025-01-11 12:08:10 -05:00
Geert Bevin 625055bbb6 RIFE2 project creation fix 2025-01-11 10:07:19 -05:00
Geert Bevin 72d214b3b6 Dependency update 2025-01-11 10:06:52 -05:00
Geert Bevin f753f87a79 Updated RIFE2/core 2025-01-10 18:53:25 -05:00
Geert Bevin fec4f68027 Added support for Maven project.parent properties 2025-01-10 18:45:02 -05:00
Geert Bevin 92c8cd3033 Updated RIFE2/core 2024-12-27 12:54:13 -05:00
Geert Bevin da0b92fb8e Updated RIFE2/core 2024-12-27 12:29:01 -05:00
Geert Bevin 2dd53ace3d More improvements to create operation 2024-12-27 10:33:38 -05:00
Geert Bevin 3d86aa8c8d Unify command line use of create operations 2024-12-26 20:06:59 -05:00
Geert Bevin 32052deaa3 Interrupt creation operation when a blank package or project name is provided 2024-12-26 18:47:14 -05:00
Geert Bevin b27cc78fb7 Don't add Lib suffix for lib project creation 2024-12-26 18:42:01 -05:00
Geert Bevin a7efd01697 Updated RIFE2/core 2024-12-26 17:13:43 -05:00
Geert Bevin 92fc85bd9c Updated blueprint dependencies 2024-12-26 17:09:33 -05:00
Geert Bevin 34667b5402 Improvements to create operations 2024-12-26 16:51:46 -05:00
Geert Bevin 66f7d180b9 Implements #52 : command line enhancements for project creation 2024-11-16 18:23:10 -05:00
Geert Bevin 6c2a9acf1c
Merge pull request #56 from ethauvin/main
Added javac options to specify the directory used to place generated source files.
2024-10-14 16:01:04 -04:00
Geert Bevin c6c9d32c35 Added support for automatically consolidating compile options that are named differently but serve the same purpose 2024-10-14 09:07:24 -04:00
Geert Bevin 3e9b252c51 Updated RIFE2/core 2024-10-10 10:11:04 -04:00
Erik C. Thauvin 3f60ed78ef
Removed extra empty line 2024-10-04 10:34:55 -07:00
Erik C. Thauvin 762e099988
Added javac options to specify the directory used to place generated source files. 2024-10-02 00:16:05 -07:00
Erik C. Thauvin 9941fc0d10
Merge pull request #55 from ethauvin/main
Added support for explicitly requesting annotation processing
2024-10-01 16:05:25 -07:00
Erik C. Thauvin f51add49f0
Added support for explicitly requesting annotation processing, as needed by Java 23 (and backported to 17 and 11) 2024-10-01 15:51:37 -07:00
Geert Bevin 3dce798d52 Updated version to 2.1.1-SNAPSHOT 2024-09-07 10:22:13 -04:00
Erik C. Thauvin d5e65ec9e8
Updated bld badge version to 2.1.0 2024-08-29 23:08:39 -07:00
52 changed files with 5762 additions and 1880 deletions

View file

@ -2,6 +2,9 @@ name: bld-ci
on: [push, pull_request, workflow_dispatch] on: [push, pull_request, workflow_dispatch]
env:
REPORTS_DIR: "build/test-results/test/"
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -87,7 +90,7 @@ jobs:
strategy: strategy:
matrix: matrix:
java-version: [ 17, 20, 21, 22 ] java-version: [ 17, 20, 21, 22, 23, 24, 25 ]
steps: steps:
- name: Checkout source repository - name: Checkout source repository
@ -98,25 +101,37 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }} - name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: 'corretto' distribution: 'corretto'
java-version: ${{ matrix.java-version }} java-version: ${{ matrix.java-version }}
check-latest: true check-latest: true
- name: Download dependencies
run: ./bld clean download
- name: Compile source
run: ./bld compile
- name: Run tests - name: Run tests
id: tests
run: >- run: >-
./bld clean download compile test ./bld test
-Dtest.postgres=true -Dtest.mysql=true -Dtest.mariadb=true -Dtest.oracle=true -Dtest.oracle-free=true -Dtest.postgres=true -Dtest.mysql=true -Dtest.mariadb=true -Dtest.oracle=true -Dtest.oracle-free=true
-DtestsBadgeUrl=https://rife2.com/tests-badge/update/com.uwyn.rife2/bld -DtestsBadgeUrl=https://rife2.com/tests-badge/update/com.uwyn.rife2/bld
-DtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }} -DtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }}
--reports-dir=${{ env.REPORTS_DIR }}
- name: Run reporter
if: always() && steps.tests.outcome == 'failure'
run: ./bld reporter --all
build-macos: build-macos:
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
matrix: matrix:
java-version: [ 17, 20, 21, 22 ] java-version: [ 17, 20, 21, 22, 23, 24, 25 ]
steps: steps:
- name: Checkout source repository - name: Checkout source repository
@ -127,22 +142,32 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }} - name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: 'corretto' distribution: 'corretto'
java-version: ${{ matrix.java-version }} java-version: ${{ matrix.java-version }}
check-latest: true check-latest: true
- name: Download dependencies
run: ./bld clean download
- name: Compile source
run: ./bld compile
- name: Run tests - name: Run tests
run: >- id: tests
./bld clean download compile test run: ./bld test --reports-dir=${{ env.REPORTS_DIR }}
- name: Run reporter
if: always() && steps.tests.outcome == 'failure'
run: ./bld reporter --all
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:
matrix: matrix:
java-version: [ 17, 20, 21, 22 ] java-version: [ 17, 20, 21, 22, 23, 24, 25 ]
steps: steps:
- name: Configure git line endings - name: Configure git line endings
@ -156,12 +181,22 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }} - name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: 'corretto' distribution: 'corretto'
java-version: ${{ matrix.java-version }} java-version: ${{ matrix.java-version }}
check-latest: true check-latest: true
- name: Download dependencies
run: .\bld.bat clean download
- name: Compile source
run: .\bld.bat compile
- name: Run tests - name: Run tests
run: >- id: tests
.\bld.bat clean download compile test run: .\bld.bat test --reports-dir=${{ env.REPORTS_DIR }}
- name: Run reporter
if: always() && steps.tests.outcome == 'failure'
run: .\bld.bat reporter --all

View file

@ -37,7 +37,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: 'corretto' distribution: 'corretto'
java-version: 17 java-version: 17
@ -46,14 +46,14 @@ jobs:
run: ./bld clean download clean compile javadoc run: ./bld clean download clean compile javadoc
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v3 uses: actions/configure-pages@v5
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v2 uses: actions/upload-pages-artifact@v3
with: with:
# Upload generated Javadocs repository # Upload generated Javadocs repository
path: 'build/javadoc/' path: 'build/javadoc/'
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v2 uses: actions/deploy-pages@v4

View file

@ -2,12 +2,12 @@
<library name="bld"> <library name="bld">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.3.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.3.0-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" /> <root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

20
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,20 @@
# Contributing
If you want to contribute to `bld` or customize it, all you have to do is clone the GitHub
repository and update the [RIFE2/core](https://github.com/rife2/rife2-core) submodule:
```console
git clone git@github.com:rife2/bld.git
cd bld
git submodule init
git submodule update
```
Then use `bld` to build itself:
```console
./bld compile
```
The project has an IntelliJ IDEA project structure. You can just open it after all
the dependencies were downloaded and peruse the code.

View file

@ -1,9 +1,9 @@
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/2.0.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![bld](https://img.shields.io/badge/2.3.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Release](https://img.shields.io/github/release/rife2/bld.svg)](https://github.com/rife2/bld/releases/latest) [![Release](https://img.shields.io/github/release/rife2/bld.svg)](https://github.com/rife2/bld/releases/latest)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.uwyn.rife2/bld/badge.svg?color=blue)](https://maven-badges.herokuapp.com/maven-central/com.uwyn.rife2/bld) [![Maven Central](https://img.shields.io/maven-central/v/com.uwyn.rife2/bld)](https://central.sonatype.com/artifact/com.uwyn.rife2/bld)
[![Nexus Snapshot](https://img.shields.io/nexus/s/com.uwyn.rife2/bld?server=https%3A%2F%2Fs01.oss.sonatype.org%2F)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/bld/) [![GitHub Snapshot](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fcentral.sonatype.com%2Frepository%2Fmaven-snapshots%2Fcom%2Fuwyn%2Frife2%2Fbld%2Fmaven-metadata.xml)](https://github.com/rife2/bld/packages/2214741/versions)
[![gradle-ci](https://github.com/rife2/bld/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld/actions/workflows/bld.yml) [![gradle-ci](https://github.com/rife2/bld/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld/actions/workflows/bld.yml)
[![Tests](https://rife2.com/tests-badge/badge/com.uwyn.rife2/bld)](https://github.com/rife2/rife2/actions/workflows/bld.yml) [![Tests](https://rife2.com/tests-badge/badge/com.uwyn.rife2/bld)](https://github.com/rife2/rife2/actions/workflows/bld.yml)
@ -48,33 +48,29 @@ import java.util.List;
import static rife.bld.dependencies.Repository.*; import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.*; import static rife.bld.dependencies.Scope.*;
public class MyappBuild extends Project { public class MyAppBuild extends Project {
public MyappBuild() { public MyAppBuild() {
pkg = "com.example"; pkg = "com.example";
name = "Myapp"; name = "my-app";
mainClass = "com.example.MyappMain"; mainClass = "com.example.MyApp";
version = version(0,1,0); version = version(0,1,0);
downloadSources = true; downloadSources = true;
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES); repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
scope(test) scope(test)
.include(dependency("org.junit.jupiter", .include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,4)))
"junit-jupiter", .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,4)));
version(5,11,0)))
.include(dependency("org.junit.platform",
"junit-platform-console-standalone",
version(1,11,0)));
} }
public static void main(String[] args) { public static void main(String[] args) {
new MyappBuild().start(args); new MyAppBuild().start(args);
} }
} }
``` ```
> **NOTE:** `bld` supports different ways to describe dependencies, > **NOTE:** `bld` supports different ways to describe dependencies,
> `dependency("org.junit.jupiter", "junit-jupiter", version(5,11,0))` can for instance also > `dependency("org.junit.jupiter", "junit-jupiter", version(5,11,4))` can for instance also
> be written as `dependency("org.junit.jupiter:junit-jupiter:5.11.0")`. Which format you use, > be written as `dependency("org.junit.jupiter:junit-jupiter:5.11.4")`. Which format you use,
> is a matter of personal taste. > is a matter of personal taste.
# Where does `bld` fit? # Where does `bld` fit?
@ -135,23 +131,7 @@ to post on the [forums](https://forum.uwyn.com) or to join us on [Discord](http
Read more in the [full documentation](https://github.com/rife2/bld/wiki) and [bld Javadocs](https://rife2.github.io/bld/). Read more in the [full documentation](https://github.com/rife2/bld/wiki) and [bld Javadocs](https://rife2.github.io/bld/).
# Building `bld` # Contributing
If you want to contribute to `bld` or customize it, all you have to do is clone the GitHub See [CONTIBUTING.md](https://github.com/rife2/bld?tab=contributing-ov-file#readme) for information about
repository and update the [RIFE2/core](https://github.com/rife2/rife2-core) submodule: contributing to this project.
```console
git clone git@github.com:rife2/bld.git
cd bld
git submodule init
git submodule update
```
Then use `bld` to build itself:
```console
./bld compile
```
The project has an IntelliJ IDEA project structure. You can just open it after all
the dependencies were downloaded and peruse the code.

2
core

@ -1 +1 @@
Subproject commit efc0744cb2f623d11223f784b92640c40d486242 Subproject commit fa567721c00d99626ed439db4f0340eadff0ec03

Binary file not shown.

View file

@ -1,11 +1,12 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.0 bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.3
bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.0 bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.3
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.0 bld.extension-reporter=com.uwyn.rife2:bld-junit-reporter:0.9.2
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.3
bld.javaOptions= bld.javaOptions=
bld.javacOptions= bld.javacOptions=
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
bld.sourceDirectories=core/src/bld/java bld.sourceDirectories=core/src/bld/java
bld.version=2.1.0 bld.version=2.3.0

View file

@ -7,6 +7,7 @@ package rife;
import rife.bld.BuildCommand; import rife.bld.BuildCommand;
import rife.bld.Cli; import rife.bld.Cli;
import rife.bld.dependencies.VersionNumber; import rife.bld.dependencies.VersionNumber;
import rife.bld.extension.JUnitReporterOperation;
import rife.bld.extension.ZipOperation; import rife.bld.extension.ZipOperation;
import rife.bld.operations.*; import rife.bld.operations.*;
import rife.bld.publish.*; import rife.bld.publish.*;
@ -33,7 +34,7 @@ public class BldBuild extends AbstractRife2Build {
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES); repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
scope(test) scope(test)
.include(dependency("org.json", "json", version(20240303))); .include(dependency("org.json", "json", version(20250517)));
var core_dir = new File(workDirectory(), "core"); var core_dir = new File(workDirectory(), "core");
var core_src_dir = new File(core_dir, "src"); var core_src_dir = new File(core_dir, "src");
@ -86,7 +87,7 @@ public class BldBuild extends AbstractRife2Build {
publishOperation() publishOperation()
.repository(version.isSnapshot() ? repository("rife2-snapshots") : repository("rife2-releases")) .repository(version.isSnapshot() ? repository("rife2-snapshots") : repository("rife2-releases"))
.repository(version.isSnapshot() ? repository("sonatype-snapshots") : repository("sonatype-releases")) .repository(version.isSnapshot() ? repository("central-snapshots") : repository("central-releases"))
.repository(repository("github")) .repository(repository("github"))
.info(new PublishInfo() .info(new PublishInfo()
.groupId("com.uwyn.rife2") .groupId("com.uwyn.rife2")
@ -161,6 +162,14 @@ public class BldBuild extends AbstractRife2Build {
zipBld(); zipBld();
} }
@BuildCommand(summary = "Runs the JUnit reporter")
public void reporter() throws Exception {
new JUnitReporterOperation()
.fromProject(this)
.failOnSummary(true)
.execute();
}
public void publish() public void publish()
throws Exception { throws Exception {
all(); all();

View file

@ -1376,6 +1376,17 @@ public class BaseProject extends BuildExecutor {
return pkg; return pkg;
} }
/**
* Returns whether this project's package was set.
*
* @return {@code true} if the package was set; or
* {@code false} otherwise
* @since 2.2.1
*/
public boolean hasPkg() {
return pkg != null;
}
/** /**
* Returns the project's name. * Returns the project's name.
* *
@ -1388,6 +1399,17 @@ public class BaseProject extends BuildExecutor {
return name; return name;
} }
/**
* Returns whether this project's name was set.
*
* @return {@code true} if the name was set; or
* {@code false} otherwise
* @since 2.2.1
*/
public boolean hasName() {
return name != null;
}
/** /**
* Returns the project's version. * Returns the project's version.
* *
@ -1400,6 +1422,17 @@ public class BaseProject extends BuildExecutor {
return version; return version;
} }
/**
* Returns whether this project's version was set.
*
* @return {@code true} if the version was set; or
* {@code false} otherwise
* @since 2.2.1
*/
public boolean hasVersion() {
return version != null;
}
/** /**
* Returns the project's main class to execute. * Returns the project's main class to execute.
* *

View file

@ -22,22 +22,22 @@ import static rife.bld.dependencies.Scope.test;
* @since 1.9 * @since 1.9
*/ */
public class AppProjectBlueprint extends Project { public class AppProjectBlueprint extends Project {
public AppProjectBlueprint(File work, String packageName, String projectName) { public AppProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public AppProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public AppProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Main"; mainClass = packageName + "." + baseName;
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS); repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
scope(test) scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,4)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,0))); .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,4)));
} }
} }

View file

@ -21,16 +21,16 @@ import static rife.bld.dependencies.Repository.SONATYPE_SNAPSHOTS;
* @since 1.5.20 * @since 1.5.20
*/ */
public class BaseProjectBlueprint extends Project { public class BaseProjectBlueprint extends Project {
public BaseProjectBlueprint(File work, String packageName, String projectName) { public BaseProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public BaseProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public BaseProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Main"; mainClass = packageName + "." + baseName;
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;

View file

@ -22,22 +22,22 @@ import static rife.bld.dependencies.Scope.test;
* @since 1.6 * @since 1.6
*/ */
public class LibProjectBlueprint extends Project { public class LibProjectBlueprint extends Project {
public LibProjectBlueprint(File work, String packageName, String projectName) { public LibProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public LibProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public LibProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Lib"; mainClass = packageName + "." + baseName;
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS); repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
scope(test) scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,4)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,0))); .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,4)));
} }
} }

View file

@ -23,31 +23,31 @@ import static rife.bld.dependencies.Scope.*;
* @since 1.5 * @since 1.5
*/ */
public class Rife2ProjectBlueprint extends WebProject { public class Rife2ProjectBlueprint extends WebProject {
public Rife2ProjectBlueprint(File work, String packageName, String projectName) { public Rife2ProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public Rife2ProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public Rife2ProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Site"; mainClass = packageName + "." + baseName + "Site";
uberJarMainClass = mainClass + "Uber"; uberJarMainClass = mainClass + "Uber";
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS); repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
scope(compile) scope(compile)
.include(dependency("com.uwyn.rife2", "rife2", version(1,8,0))); .include(dependency("com.uwyn.rife2", "rife2", version(1,9,1)));
scope(test) scope(test)
.include(dependency("org.jsoup", "jsoup", version(1,18,1))) .include(dependency("org.jsoup", "jsoup", version(1,18,3)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,4)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,0))); .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,4)));
scope(standalone) scope(standalone)
.include(dependency("org.eclipse.jetty.ee10", "jetty-ee10", version(12,0,12))) .include(dependency("org.eclipse.jetty.ee10", "jetty-ee10", version(12,0,16)))
.include(dependency("org.eclipse.jetty.ee10", "jetty-ee10-servlet", version(12,0,12))) .include(dependency("org.eclipse.jetty.ee10", "jetty-ee10-servlet", version(12,0,16)))
.include(dependency("org.slf4j", "slf4j-simple", version(2,0,13))); .include(dependency("org.slf4j", "slf4j-simple", version(2,0,16)));
precompileOperation().templateTypes(TemplateType.HTML); precompileOperation().templateTypes(TemplateType.HTML);
} }

View file

@ -32,6 +32,9 @@ public record Repository(String location, String username, String password) {
public static final Repository SONATYPE_RELEASES_LEGACY = new Repository("https://oss.sonatype.org/service/local/staging/deploy/maven2/"); public static final Repository SONATYPE_RELEASES_LEGACY = new Repository("https://oss.sonatype.org/service/local/staging/deploy/maven2/");
public static final Repository SONATYPE_SNAPSHOTS = new Repository("https://s01.oss.sonatype.org/content/repositories/snapshots/"); public static final Repository SONATYPE_SNAPSHOTS = new Repository("https://s01.oss.sonatype.org/content/repositories/snapshots/");
public static final Repository SONATYPE_SNAPSHOTS_LEGACY = new Repository("https://oss.sonatype.org/content/repositories/snapshots/"); public static final Repository SONATYPE_SNAPSHOTS_LEGACY = new Repository("https://oss.sonatype.org/content/repositories/snapshots/");
public static final String OSSRH_STAGING_API_DOMAIN = "ossrh-staging-api.central.sonatype.com";
public static final Repository CENTRAL_RELEASES = new Repository("https://" + OSSRH_STAGING_API_DOMAIN + "/service/local/staging/deploy/maven2/");
public static final Repository CENTRAL_SNAPSHOTS = new Repository("https://central.sonatype.com/repository/maven-snapshots/");
public static final Repository RIFE2_RELEASES = new Repository("https://repo.rife2.com/releases/"); public static final Repository RIFE2_RELEASES = new Repository("https://repo.rife2.com/releases/");
public static final Repository RIFE2_SNAPSHOTS = new Repository("https://repo.rife2.com/snapshots/"); public static final Repository RIFE2_SNAPSHOTS = new Repository("https://repo.rife2.com/snapshots/");
@ -98,6 +101,8 @@ public record Repository(String location, String username, String password) {
case "SONATYPE_RELEASES_LEGACY" -> Repository.SONATYPE_RELEASES_LEGACY; case "SONATYPE_RELEASES_LEGACY" -> Repository.SONATYPE_RELEASES_LEGACY;
case "SONATYPE_SNAPSHOTS" -> Repository.SONATYPE_SNAPSHOTS; case "SONATYPE_SNAPSHOTS" -> Repository.SONATYPE_SNAPSHOTS;
case "SONATYPE_SNAPSHOTS_LEGACY" -> Repository.SONATYPE_SNAPSHOTS_LEGACY; case "SONATYPE_SNAPSHOTS_LEGACY" -> Repository.SONATYPE_SNAPSHOTS_LEGACY;
case "CENTRAL_RELEASES" -> Repository.CENTRAL_RELEASES;
case "CENTRAL_SNAPSHOTS" -> Repository.CENTRAL_SNAPSHOTS;
default -> new Repository(locationOrName); default -> new Repository(locationOrName);
}; };
} }

View file

@ -250,6 +250,9 @@ class Xml2MavenPom extends Xml2Data {
if (isChildOfProject()) { if (isChildOfProject()) {
addProjectProperty(qName); addProjectProperty(qName);
} else if (isChildOfParent() || isChildOfDependency()) { } else if (isChildOfParent() || isChildOfDependency()) {
if (isChildOfProjectParent()) {
addProjectParentProperty(qName);
}
lastGroupId_ = getCharacterData(); lastGroupId_ = getCharacterData();
} else if (collectExclusions_ && isChildOfExclusion()) { } else if (collectExclusions_ && isChildOfExclusion()) {
lastExclusionGroupId_ = getCharacterData(); lastExclusionGroupId_ = getCharacterData();
@ -259,6 +262,9 @@ class Xml2MavenPom extends Xml2Data {
if (isChildOfProject()) { if (isChildOfProject()) {
addProjectProperty(qName); addProjectProperty(qName);
} else if (isChildOfParent() || isChildOfDependency()) { } else if (isChildOfParent() || isChildOfDependency()) {
if (isChildOfProjectParent()) {
addProjectParentProperty(qName);
}
lastArtifactId_ = getCharacterData(); lastArtifactId_ = getCharacterData();
} else if (collectExclusions_ && isChildOfExclusion()) { } else if (collectExclusions_ && isChildOfExclusion()) {
lastExclusionArtifactId_ = getCharacterData(); lastExclusionArtifactId_ = getCharacterData();
@ -269,6 +275,9 @@ class Xml2MavenPom extends Xml2Data {
addProjectProperty(qName); addProjectProperty(qName);
} else if (isChildOfParent() || isChildOfDependency()) { } else if (isChildOfParent() || isChildOfDependency()) {
lastVersion_ = getCharacterData(); lastVersion_ = getCharacterData();
if (isChildOfProjectParent()) {
addProjectParentProperty(qName);
}
} }
} }
case "type" -> { case "type" -> {
@ -306,6 +315,13 @@ class Xml2MavenPom extends Xml2Data {
return "project".equals(elementStack_.peek()); return "project".equals(elementStack_.peek());
} }
private boolean isChildOfProjectParent() {
if (elementStack_.size() < 2) {
return false;
}
return "parent".equals(elementStack_.peek()) && "project".equals(elementStack_.elementAt(elementStack_.size() - 2));
}
private boolean isChildOfParent() { private boolean isChildOfParent() {
return "parent".equals(elementStack_.peek()); return "parent".equals(elementStack_.peek());
} }
@ -322,6 +338,10 @@ class Xml2MavenPom extends Xml2Data {
mavenProperties_.put("project." + name, getCharacterData()); mavenProperties_.put("project." + name, getCharacterData());
} }
private void addProjectParentProperty(String name) {
mavenProperties_.put("project.parent." + name, getCharacterData());
}
private String getCharacterData() { private String getCharacterData() {
if (characterData_ == null) { if (characterData_ == null) {
return null; return null;

View file

@ -22,8 +22,9 @@ public class CreateAppHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new Java application project. Creates a new Java application project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,8 +22,9 @@ public class CreateBaseHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new Java baseline project. Creates a new Java baseline project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,9 +22,10 @@ public class CreateHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new project from multiple choice. Creates a new project from multiple choice.
Usage : ${topic} <type> <package> <name> Usage : ${topic} <type> <package> <name> <base>
type The type of project to create (app, base, lib, rife2) type The type of project to create (app, base, lib, rife2)
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,8 +22,9 @@ public class CreateLibHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new Java library project. Creates a new Java library project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,8 +22,9 @@ public class CreateRife2Help implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new RIFE2 web application project. Creates a new RIFE2 web application project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -26,16 +26,17 @@ import java.util.List;
* @since 1.5 * @since 1.5
*/ */
public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<T, P>, P extends Project> extends AbstractOperation<AbstractCreateOperation<T, P>> { public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<T, P>, P extends Project> extends AbstractOperation<AbstractCreateOperation<T, P>> {
private String packageName_;
private String projectName_;
private String baseName_;
final String templateBase_; final String templateBase_;
File workDirectory_ = new File(System.getProperty("user.dir")); File workDirectory_ = new File(System.getProperty("user.dir"));
String packageName_;
String projectName_;
boolean downloadDependencies_; boolean downloadDependencies_;
P project_; P project_;
String projectClassName_;
String projectBuildName_; String projectBuildName_;
String projectMainName_; String projectMainName_;
String projectMainUberName_; String projectMainUberName_;
@ -97,11 +98,11 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
project_ = createProjectBlueprint(); project_ = createProjectBlueprint();
// standard names // standard names
projectClassName_ = StringUtils.capitalize(project_.name()); var base_name = baseName();
projectBuildName_ = projectBuildClassName(projectClassName_); projectBuildName_ = projectBuildClassName(base_name);
projectMainName_ = projectMainClassName(projectClassName_); projectMainName_ = projectMainClassName(base_name);
projectMainUberName_ = projectMainUberClassName(projectClassName_); projectMainUberName_ = projectMainUberClassName(base_name);
projectTestName_ = projectTestClassName(projectClassName_); projectTestName_ = projectTestClassName(base_name);
// create the main project structure // create the main project structure
ideaDirectory_ = new File(project_.workDirectory(), ".idea"); ideaDirectory_ = new File(project_.workDirectory(), ".idea");
@ -132,7 +133,7 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
* @since 1.6 * @since 1.6
*/ */
protected String projectMainClassName(String projectClassName) { protected String projectMainClassName(String projectClassName) {
return projectClassName + "Main"; return projectClassName;
} }
/** /**
@ -142,7 +143,7 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
* @since 1.6 * @since 1.6
*/ */
protected String projectMainUberClassName(String projectClassName) { protected String projectMainUberClassName(String projectClassName) {
return projectClassName + "Main"; return projectClassName;
} }
/** /**
@ -199,7 +200,7 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
test_template.setValue("projectTest", projectTestName_); test_template.setValue("projectTest", projectTestName_);
test_template.setValue("projectMain", projectMainName_); test_template.setValue("projectMain", projectMainName_);
if (test_template.hasValueId("project")) { if (test_template.hasValueId("project")) {
test_template.setValue("project", projectClassName_); test_template.setValue("project", project_.name());
} }
var project_test_file = new File(testPackageDirectory_, projectTestName_ + ".java"); var project_test_file = new File(testPackageDirectory_, projectTestName_ + ".java");
FileUtils.writeString(test_template.getContent(), project_test_file); FileUtils.writeString(test_template.getContent(), project_test_file);
@ -211,7 +212,7 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
build_template.setValue("package", project_.pkg()); build_template.setValue("package", project_.pkg());
} }
if (build_template.hasValueId("project")) { if (build_template.hasValueId("project")) {
build_template.setValue("project", projectClassName_); build_template.setValue("project", project_.name());
} }
if (build_template.hasValueId("projectMain")) { if (build_template.hasValueId("projectMain")) {
build_template.setValue("projectMain", projectMainName_); build_template.setValue("projectMain", projectMainName_);
@ -375,32 +376,62 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
public T fromArguments(List<String> arguments) { public T fromArguments(List<String> arguments) {
String package_name = null; String package_name = null;
String project_name = null; String project_name = null;
String base_name = null;
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
package_name = arguments.remove(0); package_name = arguments.remove(0);
} }
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
project_name = arguments.remove(0); project_name = arguments.remove(0);
} }
if ((package_name == null || project_name == null) && System.console() == null) { if (!arguments.isEmpty()) {
throw new OperationOptionException("ERROR: Expecting the package and project names as the arguments."); base_name = arguments.remove(0);
}
if ((package_name == null || project_name == null || base_name == null) && System.console() == null) {
throw new OperationOptionException("ERROR: Expecting the package, project and base names as the arguments.");
} }
if (package_name == null || package_name.isEmpty()) { if (package_name == null || package_name.isBlank()) {
System.out.println("Please enter a package name (for instance: com.example):"); System.out.println("Please enter a package name (for instance: com.example):");
package_name = System.console().readLine(); package_name = System.console().readLine();
if (package_name == null || package_name.isBlank()) {
throw new OperationOptionException("ERROR: package name is required.");
}
} else { } else {
System.out.println("Using package name: " + package_name); System.out.println("Using package name: " + package_name);
} }
if (project_name == null || project_name.isEmpty()) { if (!ValidityChecks.checkJavaPackage(package_name)) {
System.out.println("Please enter a project name (for instance: myapp):"); throw new OperationOptionException("ERROR: package name is invalid.");
}
if (project_name == null || project_name.isBlank()) {
System.out.println("Please enter a project name (for instance: my-app):");
project_name = System.console().readLine(); project_name = System.console().readLine();
if (project_name == null || project_name.isBlank()) {
throw new OperationOptionException("ERROR: project name is required.");
}
} else { } else {
System.out.println("Using project name: " + project_name); System.out.println("Using project name: " + project_name);
} }
if (base_name == null || base_name.isBlank()) {
var default_base_name = generateBaseName(project_name);
System.out.println("Please enter the base name for generated project classes (default: " + default_base_name + "):");
base_name = System.console().readLine();
if (base_name == null || base_name.isBlank()) {
base_name = default_base_name;
System.out.println("Using base name: " + base_name);
}
} else {
System.out.println("Using base name: " + base_name);
}
if (!ValidityChecks.checkJavaIdentifier(base_name)) {
throw new OperationOptionException("ERROR: base name is invalid.");
}
return workDirectory(new File(System.getProperty("user.dir"))) return workDirectory(new File(System.getProperty("user.dir")))
.packageName(package_name) .packageName(package_name)
.projectName(project_name) .projectName(project_name)
.baseName(base_name)
.downloadDependencies(true); .downloadDependencies(true);
} }
@ -445,7 +476,6 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
throw new OperationOptionException("ERROR: The package name is invalid."); throw new OperationOptionException("ERROR: The package name is invalid.");
} }
packageName_ = name;
return (T) this; return (T) this;
} }
@ -462,10 +492,26 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
throw new OperationOptionException("ERROR: The project name should not be blank."); throw new OperationOptionException("ERROR: The project name should not be blank.");
} }
if (!ValidityChecks.checkJavaIdentifier(projectName_)) { return (T) this;
throw new OperationOptionException("ERROR: The project name is invalid.");
} }
projectName_ = name;
/**
* Provides the base name for the project classes to generate.
*
* @param name the base name
* @return this operation instance
* @since 2.2
*/
public T baseName(String name) {
baseName_ = StringUtils.trim(name);
if (baseName_.isEmpty()) {
throw new OperationOptionException("ERROR: The base name should not be blank.");
}
if (!ValidityChecks.checkJavaIdentifier(baseName_)) {
throw new OperationOptionException("ERROR: The base name is invalid.");
}
return (T) this; return (T) this;
} }
@ -513,6 +559,30 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
return projectName_; return projectName_;
} }
static String generateBaseName(String projectName) {
if (projectName != null) {
return StringUtils.filterAsIdentifier(projectName.trim(), true);
}
return null;
}
/**
* Retrieves the base name for the project classes to generate.
* <p>
* If no base name was provided, one will be generated from the project name.
*
* @return the base name
* @since 2.2
*/
public String baseName() {
if (baseName_ == null || baseName_.isEmpty()) {
return generateBaseName(projectName());
}
return baseName_;
}
/** /**
* Retrieves whether dependencies will be downloaded at project creation. * Retrieves whether dependencies will be downloaded at project creation.
* *

View file

@ -10,8 +10,7 @@ import rife.bld.operations.exceptions.OperationOptionException;
import rife.tools.exceptions.FileUtilsErrorException; import rife.tools.exceptions.FileUtilsErrorException;
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.function.Function; import java.util.function.Function;
/** /**
@ -24,6 +23,7 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
public static final String DEFAULT_JAVA_TOOL = "java"; public static final String DEFAULT_JAVA_TOOL = "java";
protected File workDirectory_ = new File(System.getProperty("user.dir")); protected File workDirectory_ = new File(System.getProperty("user.dir"));
protected final Map<String, String> environment_ = new HashMap<>();
protected String javaTool_ = DEFAULT_JAVA_TOOL; protected String javaTool_ = DEFAULT_JAVA_TOOL;
protected final JavaOptions javaOptions_ = new JavaOptions(); protected final JavaOptions javaOptions_ = new JavaOptions();
protected final List<String> classpath_ = new ArrayList<>(); protected final List<String> classpath_ = new ArrayList<>();
@ -87,6 +87,10 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
var builder = new ProcessBuilder(executeConstructProcessCommandList()); var builder = new ProcessBuilder(executeConstructProcessCommandList());
builder.directory(workDirectory()); builder.directory(workDirectory());
if (!environment_.isEmpty()) {
builder.environment().putAll(environment_);
}
builder.redirectInput(ProcessBuilder.Redirect.INHERIT); builder.redirectInput(ProcessBuilder.Redirect.INHERIT);
final var output_processor = outputProcessor(); final var output_processor = outputProcessor();
@ -163,6 +167,31 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
return (T) this; return (T) this;
} }
/**
* Provides an environment variable to use for the operation.
*
* @param name the name of the environment variable
* @param value the value of the environment variable
* @return this operation instance
* @since 2.2.1
*/
public T environment(String name, String value) {
environment_.put(name, value);
return (T) this;
}
/**
* Provides environment variable entries to use for the operation.
*
* @param environment environment entries for the operation
* @return this operation instance
* @since 2.2.1
*/
public T environment(Map<String, String> environment) {
environment_.putAll(environment);
return (T) this;
}
/** /**
* Provides the name of the tool to use for {@code java} execution. * Provides the name of the tool to use for {@code java} execution.
* <p> * <p>
@ -201,6 +230,18 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
return (T) this; return (T) this;
} }
/**
* Provides classpath entries to use for the operation.
*
* @param classpath classpath entries for the operation
* @return this operation instance
* @since 2.3.1
*
*/
public T classpath(File... classpath) {
return classpath(List.of(classpath));
}
/** /**
* Provides a list of classpath entries to use for the operation. * Provides a list of classpath entries to use for the operation.
* <p> * <p>
@ -215,6 +256,20 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
return (T) this; return (T) this;
} }
/**
* Provides a list of classpath entries to use for the operation.
* <p>
* A copy will be created to allow this list to be independently modifiable.
*
* @param classpath a list of classpath entries for the operation
* @return this operation instance
* @since 2.3.1
*/
public T classpath(Collection<File> classpath) {
classpath_.addAll(classpath.stream().map(File::getAbsolutePath).toList());
return (T) this;
}
/** /**
* Provides module path entries to use for the operation. * Provides module path entries to use for the operation.
* *
@ -227,6 +282,17 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
return (T) this; return (T) this;
} }
/**
* Provides module path entries to use for the operation.
*
* @param modulePath module path entries for the operation
* @return this operation instance
* @since 2.3.1
*/
public T modulePath(File... modulePath) {
return modulePath(List.of(modulePath));
}
/** /**
* Provides a list of module path entries to use for the operation. * Provides a list of module path entries to use for the operation.
* <p> * <p>
@ -241,6 +307,20 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
return (T) this; return (T) this;
} }
/**
* Provides a list of module path entries to use for the operation.
* <p>
* A copy will be created to allow this list to be independently modifiable.
*
* @param modulePath a list of module path entries for the operation
* @return this operation instance
* @since 2.3.1
*/
public T modulePath(Collection<File> modulePath) {
modulePath_.addAll(modulePath.stream().map(File::getAbsolutePath).toList());
return (T) this;
}
/** /**
* Provides the main class to launch with the java tool. * Provides the main class to launch with the java tool.
* *
@ -303,6 +383,18 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
return workDirectory_; return workDirectory_;
} }
/**
* Retrieves the environment to use for the operation.
* <p>
* This is a modifiable map that can be retrieved and changed.
*
* @return the operation's environment
* @since 2.2.1
*/
public Map<String, String> environment() {
return environment_;
}
/** /**
* retrieves the name of the tool to use for {@code java} execution. * retrieves the name of the tool to use for {@code java} execution.
* *

View file

@ -23,6 +23,13 @@ import java.util.List;
* @since 1.5 * @since 1.5
*/ */
public class CompileOperation extends AbstractOperation<CompileOperation> { public class CompileOperation extends AbstractOperation<CompileOperation> {
static final String COMPILE_OPTION_D = "-d";
static final String COMPILE_OPTION_CP = "-cp";
static final String COMPILE_OPTION_CLASS_PATH = "--class-path";
static final String COMPILE_OPTION_CLASSPATH = "--classpath";
static final String COMPILE_OPTION_P = "-p";
static final String COMPILE_OPTION_MODULE_PATH = "--module-path";
private File buildMainDirectory_; private File buildMainDirectory_;
private File buildTestDirectory_; private File buildTestDirectory_;
private final List<String> compileMainClasspath_ = new ArrayList<>(); private final List<String> compileMainClasspath_ = new ArrayList<>();
@ -80,12 +87,19 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
for (var directory : mainSourceDirectories()) { for (var directory : mainSourceDirectories()) {
sources.addAll(FileUtils.getJavaFileList(directory)); sources.addAll(FileUtils.getJavaFileList(directory));
} }
if (sources.isEmpty()) {
if (!silent()) {
System.err.println("No main source files found.");
}
} else {
executeBuildSources( executeBuildSources(
compileMainClasspath(), compileMainClasspath(),
compileMainModulePath(), compileMainModulePath(),
sources, sources,
buildMainDirectory()); buildMainDirectory());
} }
}
/** /**
* Part of the {@link #execute} operation, builds the test sources. * Part of the {@link #execute} operation, builds the test sources.
@ -98,12 +112,19 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
for (var directory : testSourceDirectories()) { for (var directory : testSourceDirectories()) {
sources.addAll(FileUtils.getJavaFileList(directory)); sources.addAll(FileUtils.getJavaFileList(directory));
} }
if (sources.isEmpty()) {
if (!silent()) {
System.err.println("No test source files found.");
}
} else {
executeBuildSources( executeBuildSources(
compileTestClasspath(), compileTestClasspath(),
compileTestModulePath(), compileTestModulePath(),
sources, sources,
buildTestDirectory()); buildTestDirectory());
} }
}
/** /**
* Part of the {@link #execute} operation, build sources to a destination. * Part of the {@link #execute} operation, build sources to a destination.
@ -124,19 +145,33 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
try (var file_manager = compiler.getStandardFileManager(null, null, null)) { try (var file_manager = compiler.getStandardFileManager(null, null, null)) {
var compilation_units = file_manager.getJavaFileObjectsFromFiles(sources); var compilation_units = file_manager.getJavaFileObjectsFromFiles(sources);
var diagnostics = new DiagnosticCollector<JavaFileObject>(); var diagnostics = new DiagnosticCollector<JavaFileObject>();
var options = new ArrayList<>(List.of("-d", destination.getAbsolutePath())); var options = new ArrayList<>(List.of(COMPILE_OPTION_D, destination.getAbsolutePath()));
if (!classpath.isEmpty()) { if (!classpath.isEmpty()) {
options.addAll(List.of("-cp", FileUtils.joinPaths(classpath))); var class_path = FileUtils.joinPaths(classpath);
class_path = removeAndAppendCompileOptionPath(class_path, COMPILE_OPTION_CP);
class_path = removeAndAppendCompileOptionPath(class_path, COMPILE_OPTION_CLASS_PATH);
class_path = removeAndAppendCompileOptionPath(class_path, COMPILE_OPTION_CLASSPATH);
options.addAll(List.of(COMPILE_OPTION_CP, class_path));
} }
if (!modulePath.isEmpty()) { if (!modulePath.isEmpty()) {
options.addAll(List.of("-p", FileUtils.joinPaths(modulePath))); var module_path = FileUtils.joinPaths(modulePath);
module_path = removeAndAppendCompileOptionPath(module_path, COMPILE_OPTION_P);
module_path = removeAndAppendCompileOptionPath(module_path, COMPILE_OPTION_MODULE_PATH);
options.addAll(List.of(COMPILE_OPTION_P, module_path));
} }
options.addAll(compileOptions()); options.addAll(compileOptions());
var compilation_task = compiler.getTask(null, file_manager, diagnostics, options, null, compilation_units); var compilation_task = compiler.getTask(null, file_manager, diagnostics, options, null, compilation_units);
if (!compilation_task.call()) { if (!compilation_task.call()) {
diagnostics_.addAll(diagnostics.getDiagnostics()); diagnostics_.addAll(diagnostics.getDiagnostics());
executeProcessDiagnostics(diagnostics); executeProcessDiagnostics(diagnostics);
} }
var module_info_class = new File(destination, "module-info.class"); var module_info_class = new File(destination, "module-info.class");
if (module_info_class.exists() && moduleMainClass() != null) { if (module_info_class.exists() && moduleMainClass() != null) {
var orig_bytes = FileUtils.readBytes(module_info_class); var orig_bytes = FileUtils.readBytes(module_info_class);
@ -146,6 +181,16 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
} }
} }
private String removeAndAppendCompileOptionPath(String basePath, String option) {
var index = compileOptions_.indexOf(option);
if (index != -1 && index + 1 < compileOptions_.size() - 1) {
compileOptions_.remove(index);
return basePath + File.pathSeparator + compileOptions_.remove(index);
}
return basePath;
}
/** /**
* Part of the {@link #execute} operation, processes the compilation diagnostics. * Part of the {@link #execute} operation, processes the compilation diagnostics.
* *

View file

@ -21,6 +21,6 @@ public class CreateAppOperation extends AbstractCreateOperation<CreateAppOperati
} }
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new AppProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new AppProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
} }

View file

@ -21,6 +21,6 @@ public class CreateBaseOperation extends AbstractCreateOperation<CreateBaseOpera
} }
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new BaseProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new BaseProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
} }

View file

@ -21,11 +21,7 @@ public class CreateLibOperation extends AbstractCreateOperation<CreateLibOperati
} }
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new LibProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new LibProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
}
protected String projectMainClassName(String projectClassName) {
return projectClassName + "Lib";
} }
protected boolean createIdeaRunMain() { protected boolean createIdeaRunMain() {

View file

@ -7,6 +7,7 @@ package rife.bld.operations;
import rife.bld.operations.exceptions.OperationOptionException; import rife.bld.operations.exceptions.OperationOptionException;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -33,20 +34,29 @@ public class CreateOperation {
String type = null; String type = null;
String package_name = null; String package_name = null;
String project_name = null; String project_name = null;
String base_name = null;
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
type = arguments.remove(0); type = arguments.remove(0);
} }
var create_operation_args = new ArrayList<String>();
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
package_name = arguments.remove(0); package_name = arguments.remove(0);
create_operation_args.add(package_name);
} }
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
project_name = arguments.remove(0); project_name = arguments.remove(0);
create_operation_args.add(project_name);
} }
if ((type == null || package_name == null || project_name == null) && System.console() == null) { if (!arguments.isEmpty()) {
throw new OperationOptionException("ERROR: Expecting the type, package and project names as the arguments."); base_name = arguments.remove(0);
create_operation_args.add(base_name);
}
if ((package_name == null || project_name == null || base_name == null) && System.console() == null) {
throw new OperationOptionException("ERROR: Expecting the package, project and base names as the arguments.");
} }
if (type == null || type.isEmpty()) { if (type == null || type.isBlank()) {
System.out.println("Please enter a number for the project type:"); System.out.println("Please enter a number for the project type:");
System.out.printf(" 1: %s (Java baseline project)%n", BASE); System.out.printf(" 1: %s (Java baseline project)%n", BASE);
System.out.printf(" 2: %s (Java application project)%n", APP); System.out.printf(" 2: %s (Java application project)%n", APP);
@ -77,31 +87,6 @@ public class CreateOperation {
throw new OperationOptionException("ERROR: Unsupported project type."); throw new OperationOptionException("ERROR: Unsupported project type.");
} }
if (package_name == null || package_name.isEmpty()) { return create_operation.fromArguments(create_operation_args);
System.out.println("Please enter a package name (for instance: com.example):");
package_name = System.console().readLine();
} else {
System.out.println("Using package name: " + package_name);
}
if (project_name == null || project_name.isEmpty()) {
String name_example;
if (LIB.equals(type)) {
name_example = "mylib";
} else if (RIFE2.equals(type)) {
name_example = "mywebapp";
} else {
name_example = "myapp";
}
System.out.printf("Please enter a project name (for instance: %s):%n", name_example);
project_name = System.console().readLine();
} else {
System.out.println("Using project name: " + project_name);
}
return create_operation.workDirectory(new File(System.getProperty("user.dir")))
.packageName(package_name)
.projectName(project_name)
.downloadDependencies(true);
} }
} }

View file

@ -7,6 +7,7 @@ package rife.bld.operations;
import rife.bld.blueprints.Rife2ProjectBlueprint; import rife.bld.blueprints.Rife2ProjectBlueprint;
import rife.template.TemplateFactory; import rife.template.TemplateFactory;
import rife.tools.FileUtils; import rife.tools.FileUtils;
import rife.tools.StringUtils;
import rife.tools.exceptions.FileUtilsErrorException; import rife.tools.exceptions.FileUtilsErrorException;
import java.io.File; import java.io.File;
@ -27,14 +28,14 @@ public class CreateRife2Operation extends AbstractCreateOperation<CreateRife2Ope
} }
protected Rife2ProjectBlueprint createProjectBlueprint() { protected Rife2ProjectBlueprint createProjectBlueprint() {
return new Rife2ProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new Rife2ProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
@Override @Override
protected void executeConfigure() { protected void executeConfigure() {
super.executeConfigure(); super.executeConfigure();
projectMainName_ = projectClassName_ + "Site"; projectMainName_ = baseName() + "Site";
projectMainUberName_ = projectMainName_ + "Uber"; projectMainUberName_ = projectMainName_ + "Uber";
srcMainWebappCssDirectory_ = new File(project_.srcMainWebappDirectory(), "css"); srcMainWebappCssDirectory_ = new File(project_.srcMainWebappDirectory(), "css");
srcMainWebappWebInfDirectory_ = new File(project_.srcMainWebappDirectory(), "WEB-INF"); srcMainWebappWebInfDirectory_ = new File(project_.srcMainWebappDirectory(), "WEB-INF");
@ -63,7 +64,7 @@ public class CreateRife2Operation extends AbstractCreateOperation<CreateRife2Ope
// project template // project template
var template_template = TemplateFactory.HTML.get(templateBase_ + "project_template"); var template_template = TemplateFactory.HTML.get(templateBase_ + "project_template");
template_template.setValue("project", projectClassName_); template_template.setValue("project", project_.name());
var project_template_file = new File(project_.srcMainResourcesTemplatesDirectory(), "hello.html"); var project_template_file = new File(project_.srcMainResourcesTemplatesDirectory(), "hello.html");
FileUtils.writeString(template_template.getContent(), project_template_file); FileUtils.writeString(template_template.getContent(), project_template_file);

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@ import rife.bld.BldVersion;
import rife.bld.dependencies.*; import rife.bld.dependencies.*;
import rife.bld.dependencies.exceptions.DependencyException; import rife.bld.dependencies.exceptions.DependencyException;
import rife.bld.operations.exceptions.OperationOptionException; import rife.bld.operations.exceptions.OperationOptionException;
import rife.bld.operations.exceptions.RestApiException;
import rife.bld.operations.exceptions.SignException; import rife.bld.operations.exceptions.SignException;
import rife.bld.operations.exceptions.UploadException; import rife.bld.operations.exceptions.UploadException;
import rife.bld.publish.*; import rife.bld.publish.*;
@ -27,6 +28,7 @@ import java.time.ZoneId;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
import static rife.bld.dependencies.Dependency.*; import static rife.bld.dependencies.Dependency.*;
import static rife.bld.publish.MetadataBuilder.SNAPSHOT_TIMESTAMP_FORMATTER; import static rife.bld.publish.MetadataBuilder.SNAPSHOT_TIMESTAMP_FORMATTER;
@ -40,6 +42,9 @@ import static rife.tools.StringUtils.encodeHexLower;
* @since 1.5.7 * @since 1.5.7
*/ */
public class PublishOperation extends AbstractOperation<PublishOperation> { public class PublishOperation extends AbstractOperation<PublishOperation> {
private static final String OSSRH_STAGING_MANUAL_SEARCH = "https://" + Repository.OSSRH_STAGING_API_DOMAIN + "/manual/search/repositories";
private static final String OSSRH_STAGING_MANUAL_UPLOAD = "https://" + Repository.OSSRH_STAGING_API_DOMAIN + "/manual/upload/repository/";
private boolean offline_ = false; private boolean offline_ = false;
private HierarchicalProperties properties_ = null; private HierarchicalProperties properties_ = null;
private ArtifactRetriever retriever_ = null; private ArtifactRetriever retriever_ = null;
@ -87,6 +92,11 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
executePublishArtifacts(repository, actual_version); executePublishArtifacts(repository, actual_version);
executePublishPom(repository, actual_version); executePublishPom(repository, actual_version);
executePublishMetadata(repository, moment); executePublishMetadata(repository, moment);
if (!info().version().isSnapshot() &&
repository.location().contains(Repository.OSSRH_STAGING_API_DOMAIN)) {
executeCloseOSSRHStagingRepository(repository);
}
} }
if (!silent()) { if (!silent()) {
System.out.println("Publishing finished successfully."); System.out.println("Publishing finished successfully.");
@ -133,14 +143,18 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
var resolution = new VersionResolution(properties()); var resolution = new VersionResolution(properties());
var resolver = new DependencyResolver(resolution, artifactRetriever(), List.of(repository), new Dependency(info().groupId(), info().artifactId(), info().version())); var resolver = new DependencyResolver(resolution, artifactRetriever(), List.of(repository), new Dependency(info().groupId(), info().artifactId(), info().version()));
var snapshot_meta = resolver.getSnapshotMavenMetadata(); var snapshot_meta = resolver.getSnapshotMavenMetadata();
snapshot_build_number = snapshot_meta.getSnapshotBuildNumber() + 1; var build_number_meta = snapshot_meta.getSnapshotBuildNumber();
if (build_number_meta == null) {
throw new DependencyException("Snapshot metadata build number doesn't exist.");
}
snapshot_build_number = build_number_meta + 1;
} catch (DependencyException e) { } catch (DependencyException e) {
// start the build number from the beginning // start the build number from the beginning
System.out.println("Unable to retrieve previous snapshot metadata, using first build number."); System.out.println("Unable to retrieve previous snapshot metadata, using first build number.");
System.out.println("This is expected for a first publication or for publication to a staging repository."); System.out.println("This is expected for a first publication or for publication to a staging repository.");
} }
// adapt the actual version that's use by the artifacts // adapt the actual version used by the artifacts
var snapshot_qualifier = snapshot_timestamp + "-" + snapshot_build_number; var snapshot_qualifier = snapshot_timestamp + "-" + snapshot_build_number;
actual_version = info().version().withQualifier(snapshot_qualifier); actual_version = info().version().withQualifier(snapshot_qualifier);
@ -161,7 +175,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
.info(info()) .info(info())
.updated(moment) .updated(moment)
.build(), .build(),
info().version() + "/" + repository.getMetadataName(), true); info().version() + "/" + repository.getMetadataName(), false);
return actual_version; return actual_version;
} }
@ -181,7 +195,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
artifact_name.append('-').append(artifact.classifier()); artifact_name.append('-').append(artifact.classifier());
} }
var type = artifact.type(); var type = artifact.type();
if (type == null || TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) { if (TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
type = TYPE_JAR; type = TYPE_JAR;
} }
artifact_name.append('.').append(type); artifact_name.append('.').append(type);
@ -470,12 +484,8 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
var builder = HttpRequest.newBuilder() var builder = HttpRequest.newBuilder()
.PUT(body) .PUT(body)
.uri(URI.create(url)) .uri(URI.create(url))
.header(HEADER_USER_AGENT, "bld/" + BldVersion.getVersion() + .header(HEADER_USER_AGENT, constructBldUserAgent());
" (" + System.getProperty("os.name") + "; " + System.getProperty("os.version") + "; " + System.getProperty("os.arch") + ") " + applyAuthorization(repository, builder);
"(" + System.getProperty("java.vendor") + " " + System.getProperty("java.vm.name") + "; " + System.getProperty("java.version") + "; " + System.getProperty("java.vm.version") + ")");
if (repository.username() != null && repository.password() != null) {
builder.header(HEADER_AUTHORIZATION, basicAuthorizationHeader(repository.username(), repository.password()));
}
var request = builder.build(); var request = builder.build();
HttpResponse<String> response; HttpResponse<String> response;
@ -501,6 +511,105 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
} }
} }
private static String constructBldUserAgent() {
return "bld/" + BldVersion.getVersion() +
" (" + System.getProperty("os.name") + "; " + System.getProperty("os.version") + "; " + System.getProperty("os.arch") + ") " +
"(" + System.getProperty("java.vendor") + " " + System.getProperty("java.vm.name") + "; " + System.getProperty("java.version") + "; " + System.getProperty("java.vm.version") + ")";
}
private static void applyAuthorization(Repository repository, HttpRequest.Builder builder) {
if (repository.username() != null && repository.password() != null) {
builder.header(HEADER_AUTHORIZATION, basicAuthorizationHeader(repository.username(), repository.password()));
}
}
/**
* Part of the {@link #execute} operation, closes the OSSRH staging API repository.
*
* @param repository the repository to close a staging repository in
* @since 2.2.2
*/
protected void executeCloseOSSRHStagingRepository(Repository repository) {
var url_search = OSSRH_STAGING_MANUAL_SEARCH;
System.out.print("Finding open staging repositories at: " + url_search + " ... ");
System.out.flush();
try {
var builder_search = HttpRequest.newBuilder()
.GET()
.uri(URI.create(url_search))
.header(HEADER_USER_AGENT, constructBldUserAgent());
applyAuthorization(repository, builder_search);
var request_list = builder_search.build();
HttpResponse<String> response_search;
try {
response_search = client_.send(request_list, HttpResponse.BodyHandlers.ofString());
} catch (IOException e) {
System.out.print("I/O error");
throw new RestApiException(url_search, e);
} catch (InterruptedException e) {
System.out.print("interrupted");
throw new RestApiException(url_search, e);
}
if (response_search.statusCode() >= 200 &&
response_search.statusCode() < 300) {
System.out.println("done");
var pattern_key = Pattern.compile("\\{\\s*\"key\"\\s*:\\s*\"([^\"]+)\"\\s*,\\s*\"state\"\\s*:\\s*\"open\"");
var matcher_key = pattern_key.matcher(response_search.body());
if (matcher_key.find()) {
var key = matcher_key.group(1);
System.out.println("Found open staging repository with key: " + key);
var url_close = OSSRH_STAGING_MANUAL_UPLOAD + key;
System.out.print("Closing the staging repository at: " + url_close + " ... ");
System.out.flush();
var builder_close = HttpRequest.newBuilder()
.POST(BodyPublishers.ofString(""))
.uri(URI.create(url_close))
.header(HEADER_USER_AGENT, constructBldUserAgent());
applyAuthorization(repository, builder_close);
var request_close = builder_close.build();
HttpResponse<String> response_close;
try {
response_close = client_.send(request_close, HttpResponse.BodyHandlers.ofString());
} catch (IOException e) {
System.out.print("I/O error");
throw new RestApiException(url_close, e);
} catch (InterruptedException e) {
System.out.print("interrupted");
throw new RestApiException(url_close, e);
}
if (response_close.statusCode() >= 200 &&
response_close.statusCode() < 300) {
System.out.print("done");
} else {
System.out.println("failed");
var pattern_error = Pattern.compile("\\s*\"error\"\\s*:\\s*\"([^\"]*)\"");
var matcher_error = pattern_error.matcher(response_close.body());
if (matcher_error.find()) {
var error = matcher_error.group(1);
System.out.print(error.translateEscapes());
}
throw new RestApiException(url_close, response_close.statusCode());
}
}
else {
System.out.print("No open staging repository found.");
throw new RestApiException(url_search);
}
} else {
System.out.print("failed");
throw new RestApiException(url_search, response_search.statusCode());
}
} finally {
System.out.println();
}
}
/** /**
* Configures a publish operation from a {@link BaseProject}. * Configures a publish operation from a {@link BaseProject}.
* *

View file

@ -49,6 +49,9 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
else if (mainClass() != null && !mainClass().isEmpty()){ else if (mainClass() != null && !mainClass().isEmpty()){
args.add(mainClass()); args.add(mainClass());
} }
else if (!silent()) {
System.err.println("No main class or module specified.");
}
args.addAll(runOptions()); args.addAll(runOptions());

View file

@ -0,0 +1,40 @@
/*
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
* Licensed under the Apache License, Version 2.0 (the "License")
*/
package rife.bld.operations.exceptions;
import rife.tools.HttpUtils;
import java.io.Serial;
/**
* When thrown, indicates that something went wrong during the use of a rest API call.
*
* @author Geert Bevin (gbevin[remove] at uwyn dot com)
* @since 2.2.2
*/
public class RestApiException extends RuntimeException {
@Serial private static final long serialVersionUID = -6753423938407177328L;
private final String url_;
public RestApiException(String url, int status) {
super("An error occurred while using rest API at '" + url + "'\nHTTP status code " + status + " : " + HttpUtils.statusReason(status));
url_ = url;
}
public RestApiException(String url, Throwable cause) {
super("An error occurred while using rest API at '" + url + "'", cause);
url_ = url;
}
public RestApiException(String url) {
super("An error occurred while using rest API at '" + url + "'");
url_ = url;
}
public String getUrl() {
return url_;
}
}

View file

@ -45,9 +45,9 @@ public class Wrapper {
public static final String WRAPPER_PROPERTIES = WRAPPER_PREFIX + ".properties"; public static final String WRAPPER_PROPERTIES = WRAPPER_PREFIX + ".properties";
static final String MAVEN_CENTRAL = "https://repo1.maven.org/maven2/"; static final String MAVEN_CENTRAL = "https://repo1.maven.org/maven2/";
static final String SONATYPE_SNAPSHOTS = "https://s01.oss.sonatype.org/content/repositories/snapshots/"; static final String CENTRAL_SNAPSHOTS = "https://central.sonatype.com/repository/maven-snapshots/";
static final String DOWNLOAD_LOCATION = MAVEN_CENTRAL + "com/uwyn/rife2/bld/${version}/"; static final String DOWNLOAD_LOCATION = MAVEN_CENTRAL + "com/uwyn/rife2/bld/${version}/";
static final String DOWNLOAD_LOCATION_SNAPSHOT = SONATYPE_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/"; static final String DOWNLOAD_LOCATION_SNAPSHOT = CENTRAL_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/";
static final String BLD_CACHE = "bld.cache"; static final String BLD_CACHE = "bld.cache";
static final String BLD_FILENAME = "bld-${version}.jar"; static final String BLD_FILENAME = "bld-${version}.jar";
static final String BLD_SOURCES_FILENAME = "bld-${version}-sources.jar"; static final String BLD_SOURCES_FILENAME = "bld-${version}-sources.jar";

View file

@ -1 +1 @@
2.1.0 2.3.1-SNAPSHOT

View file

@ -29,10 +29,13 @@ public class TestProject {
assertTrue(project.workDirectory().exists()); assertTrue(project.workDirectory().exists());
assertTrue(project.workDirectory().isDirectory()); assertTrue(project.workDirectory().isDirectory());
assertNull(project.pkg); assertNull(project.pkg);
assertFalse(project.hasPkg());
assertThrows(IllegalStateException.class, project::pkg); assertThrows(IllegalStateException.class, project::pkg);
assertNull(project.name); assertNull(project.name);
assertFalse(project.hasName());
assertThrows(IllegalStateException.class, project::name); assertThrows(IllegalStateException.class, project::name);
assertNull(project.version); assertNull(project.version);
assertFalse(project.hasVersion());
assertThrows(IllegalStateException.class, project::version); assertThrows(IllegalStateException.class, project::version);
assertNull(project.mainClass); assertNull(project.mainClass);
assertNull(project.module); assertNull(project.module);
@ -140,6 +143,22 @@ public class TestProject {
} }
} }
@Test
void testCustomProject()
throws Exception {
var tmp = Files.createTempDirectory("test").toFile();
try {
var result = new StringBuilder();
var project = new CustomProject(tmp, result);
assertTrue(project.hasPkg());
assertTrue(project.hasName());
assertTrue(project.hasVersion());
} finally {
FileUtils.deleteDirectory(tmp);
}
}
@Test @Test
void testCustomCommand() void testCustomCommand()
throws Exception { throws Exception {

View file

@ -26,7 +26,7 @@ public class TestDependencyResolver {
@Test @Test
void testInstantiation() { void testInstantiation() {
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "com.uwyn.rife2:rife2:1.8.0")), var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "com.uwyn.rife2:rife2:1.8.0")),
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0))); ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
assertNotNull(resolver); assertNotNull(resolver);
assertEquals(new VersionNumber(1,8,0), resolver.resolution().overrideVersion(new Dependency("com.uwyn.rife2", "rife2"))); assertEquals(new VersionNumber(1,8,0), resolver.resolution().overrideVersion(new Dependency("com.uwyn.rife2", "rife2")));
assertTrue(resolver.repositories().contains(MAVEN_CENTRAL)); assertTrue(resolver.repositories().contains(MAVEN_CENTRAL));
@ -36,38 +36,38 @@ public class TestDependencyResolver {
@Test @Test
void testNotFound() { void testNotFound() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.org.unknown", "voidthing")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.org.unknown", "voidthing"));
assertFalse(resolver.exists()); assertFalse(resolver.exists());
} }
@Test @Test
void testCheckExistence() { void testCheckExistence() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
assertTrue(resolver.exists()); assertTrue(resolver.exists());
} }
@Test @Test
void testCheckExistenceVersion() { void testCheckExistenceVersion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
assertTrue(resolver.exists()); assertTrue(resolver.exists());
} }
@Test @Test
void testCheckExistenceMissingVersion() { void testCheckExistenceMissingVersion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9)));
assertFalse(resolver.exists()); assertFalse(resolver.exists());
} }
@Test @Test
void testCheckVersionOverride() { void testCheckVersionOverride() {
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "com.uwyn.rife2:rife2:1.8.0")), var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "com.uwyn.rife2:rife2:1.8.0")),
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9))); ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9)));
assertEquals(new VersionNumber(1, 8, 0), resolver.resolveVersion()); assertEquals(new VersionNumber(1, 8, 0), resolver.resolveVersion());
} }
@Test @Test
void testListVersions() { void testListVersions() {
var resolver1 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver1 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var versions1 = resolver1.listVersions(); var versions1 = resolver1.listVersions();
assertNotNull(versions1); assertNotNull(versions1);
assertFalse(versions1.isEmpty()); assertFalse(versions1.isEmpty());
@ -75,7 +75,7 @@ public class TestDependencyResolver {
assertTrue(versions1.contains(new VersionNumber(1, 0, 0))); assertTrue(versions1.contains(new VersionNumber(1, 0, 0)));
assertTrue(versions1.contains(new VersionNumber(1, 2, 1))); assertTrue(versions1.contains(new VersionNumber(1, 2, 1)));
var resolver2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server")); var resolver2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server"));
var versions2 = resolver2.listVersions(); var versions2 = resolver2.listVersions();
assertNotNull(versions2); assertNotNull(versions2);
assertFalse(versions2.isEmpty()); assertFalse(versions2.isEmpty());
@ -86,7 +86,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetLatestVersion() { void testGetLatestVersion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var version = resolver.latestVersion(); var version = resolver.latestVersion();
assertNotNull(version); assertNotNull(version);
assertTrue(version.compareTo(new VersionNumber(1, 4)) >= 0); assertTrue(version.compareTo(new VersionNumber(1, 4)) >= 0);
@ -94,7 +94,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetReleaseVersion() { void testGetReleaseVersion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var version = resolver.releaseVersion(); var version = resolver.releaseVersion();
assertNotNull(version); assertNotNull(version);
assertTrue(version.compareTo(new VersionNumber(1, 4)) >= 0); assertTrue(version.compareTo(new VersionNumber(1, 4)) >= 0);
@ -102,7 +102,7 @@ public class TestDependencyResolver {
@Test @Test
void testMetadata() { void testMetadata() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
var metadata = resolver.getMavenMetadata(); var metadata = resolver.getMavenMetadata();
assertNotNull(metadata); assertNotNull(metadata);
assertTrue(metadata.getLatest().compareTo(resolver.dependency().version()) > 0); assertTrue(metadata.getLatest().compareTo(resolver.dependency().version()) > 0);
@ -111,16 +111,16 @@ public class TestDependencyResolver {
@Test @Test
void testSnapshotMetadata() { void testSnapshotMetadata() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var metadata = resolver.getSnapshotMavenMetadata(); var metadata = resolver.getSnapshotMavenMetadata();
assertNotNull(metadata); assertNotNull(metadata);
assertEquals("20230307.195509", metadata.getSnapshotTimestamp()); assertEquals("20230408.014123", metadata.getSnapshotTimestamp());
assertEquals(4, metadata.getSnapshotBuildNumber()); assertEquals(7, metadata.getSnapshotBuildNumber());
} }
@Test @Test
void testGetCompileDependenciesRIFE2() { void testGetCompileDependenciesRIFE2() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(0, dependencies.size()); assertEquals(0, dependencies.size());
@ -128,7 +128,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesRIFE2Snapshot() { void testGetCompileDependenciesRIFE2Snapshot() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(0, dependencies.size()); assertEquals(0, dependencies.size());
@ -136,7 +136,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesGoogleApi() { void testGetCompileDependenciesGoogleApi() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(1, dependencies.size()); assertEquals(1, dependencies.size());
@ -146,7 +146,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesJetty() { void testGetCompileDependenciesJetty() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(4, dependencies.size()); assertEquals(4, dependencies.size());
@ -159,7 +159,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesAssertJ() { void testGetCompileDependenciesAssertJ() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.assertj", "assertj-joda-time", new VersionNumber(2, 2, 0))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.assertj", "assertj-joda-time", new VersionNumber(2, 2, 0)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(1, dependencies.size()); assertEquals(1, dependencies.size());
@ -167,10 +167,30 @@ public class TestDependencyResolver {
org.assertj:assertj-core""", StringUtils.join(dependencies, "\n")); org.assertj:assertj-core""", StringUtils.join(dependencies, "\n"));
} }
@Test
void testGetCompileDependenciesSwagger() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("io.swagger.core.v3", "swagger-core", new VersionNumber(2,2,27)));
var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies);
assertEquals(11, dependencies.size());
assertEquals("""
jakarta.xml.bind:jakarta.xml.bind-api:2.3.3
org.apache.commons:commons-lang3:3.17.0
org.slf4j:slf4j-api:2.0.9
com.fasterxml.jackson.core:jackson-annotations:2.16.2
com.fasterxml.jackson.core:jackson-databind:2.16.2
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.2
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.2
io.swagger.core.v3:swagger-annotations:2.2.27
org.yaml:snakeyaml:2.3
io.swagger.core.v3:swagger-models:2.2.27
jakarta.validation:jakarta.validation-api:2.0.2""", StringUtils.join(dependencies, "\n"));
}
@Test @Test
void testGetCompileDependenciesJettyOverride1() { void testGetCompileDependenciesJettyOverride1() {
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.13")), var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.16")),
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(4, dependencies.size()); assertEquals(4, dependencies.size());
@ -178,13 +198,13 @@ public class TestDependencyResolver {
org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2 org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2
org.eclipse.jetty:jetty-http:11.0.14 org.eclipse.jetty:jetty-http:11.0.14
org.eclipse.jetty:jetty-io:11.0.14 org.eclipse.jetty:jetty-io:11.0.14
org.slf4j:slf4j-api:2.0.13""", StringUtils.join(dependencies, "\n")); org.slf4j:slf4j-api:2.0.16""", StringUtils.join(dependencies, "\n"));
} }
@Test @Test
void testGetCompileDependenciesJettyOverride2() { void testGetCompileDependenciesJettyOverride2() {
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11,org.eclipse.jetty:jetty-io:11.0.13,org.eclipse.jetty:jetty-server:11.0.15")), var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11,org.eclipse.jetty:jetty-io:11.0.13,org.eclipse.jetty:jetty-server:11.0.15")),
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(4, dependencies.size()); assertEquals(4, dependencies.size());
@ -197,7 +217,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileRuntimeDependenciesJunit() { void testGetCompileRuntimeDependenciesJunit() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
var dependencies_compile = resolver.getDirectDependencies(compile, runtime); var dependencies_compile = resolver.getDirectDependencies(compile, runtime);
assertNotNull(dependencies_compile); assertNotNull(dependencies_compile);
assertEquals(3, dependencies_compile.size()); assertEquals(3, dependencies_compile.size());
@ -209,7 +229,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesSpringBoot() { void testGetCompileDependenciesSpringBoot() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(6, dependencies.size()); assertEquals(6, dependencies.size());
@ -224,7 +244,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesMaven() { void testGetCompileDependenciesMaven() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(26, dependencies.size()); assertEquals(26, dependencies.size());
@ -259,7 +279,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesPlay() { void testGetCompileDependenciesPlay() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(25, dependencies.size()); assertEquals(25, dependencies.size());
@ -293,7 +313,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileDependenciesVaadin() { void testGetCompileDependenciesVaadin() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
var dependencies = resolver.getDirectDependencies(compile); var dependencies = resolver.getDirectDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(9, dependencies.size()); assertEquals(9, dependencies.size());
@ -311,20 +331,22 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileRuntimeDependenciesBitly() { void testGetCompileRuntimeDependenciesBitly() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
var dependencies = resolver.getDirectDependencies(compile, runtime); var dependencies = resolver.getDirectDependencies(compile, runtime);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(4, dependencies.size()); assertEquals(6, dependencies.size());
assertEquals(""" assertEquals("""
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 org.jetbrains.kotlin:kotlin-stdlib:2.1.10
com.squareup.okhttp3:okhttp:4.11.0 org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
com.squareup.okhttp3:logging-interceptor:4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
org.json:json:20230618""", StringUtils.join(dependencies, "\n")); com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okhttp3:logging-interceptor:4.12.0
org.json:json:20250107""", StringUtils.join(dependencies, "\n"));
} }
@Test @Test
void testGetCompileTransitiveDependenciesRIFE2() { void testGetCompileTransitiveDependenciesRIFE2() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(1, dependencies.size()); assertEquals(1, dependencies.size());
@ -334,17 +356,17 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesRIFE2Snapshot() { void testGetCompileTransitiveDependenciesRIFE2Snapshot() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(1, dependencies.size()); assertEquals(1, dependencies.size());
assertEquals(""" assertEquals("""
com.uwyn.rife2:rife2:1.4.1-SNAPSHOT""", StringUtils.join(dependencies, "\n")); com.uwyn.rife2:rife2:1.5.18-SNAPSHOT""", StringUtils.join(dependencies, "\n"));
} }
@Test @Test
void testGetCompileTransitiveDependenciesJetty() { void testGetCompileTransitiveDependenciesJetty() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(6, dependencies.size()); assertEquals(6, dependencies.size());
@ -359,7 +381,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesJettyExclusion() { void testGetCompileTransitiveDependenciesJettyExclusion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)) new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
.exclude("org.slf4j", "slf4j-api")); .exclude("org.slf4j", "slf4j-api"));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
@ -375,7 +397,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesJettyFullGroupExclusion() { void testGetCompileTransitiveDependenciesJettyFullGroupExclusion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)) new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
.exclude("org.eclipse.jetty", "*")); .exclude("org.eclipse.jetty", "*"));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
@ -389,7 +411,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesJettyFullArtifactExclusion() { void testGetCompileTransitiveDependenciesJettyFullArtifactExclusion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)) new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
.exclude("*", "jetty-http") .exclude("*", "jetty-http")
.exclude("*", "slf4j-api")); .exclude("*", "slf4j-api"));
@ -405,7 +427,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesJettyFullExclusion() { void testGetCompileTransitiveDependenciesJettyFullExclusion() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)) new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
.exclude("*", "*")); .exclude("*", "*"));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
@ -417,8 +439,8 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesJettyAndSlfj() { void testGetCompileTransitiveDependenciesJettyAndSlfj() {
var dependencies = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))).getAllDependencies(compile); var dependencies = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))).getAllDependencies(compile);
var dependencies2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6))).getAllDependencies(compile, runtime); var dependencies2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6))).getAllDependencies(compile, runtime);
assertNotNull(dependencies); assertNotNull(dependencies);
assertNotNull(dependencies2); assertNotNull(dependencies2);
assertEquals(6, dependencies.size()); assertEquals(6, dependencies.size());
@ -437,7 +459,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileRuntimeTransitiveDependenciesJunit() { void testGetCompileRuntimeTransitiveDependenciesJunit() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
var dependencies_compile = resolver.getAllDependencies(compile, runtime); var dependencies_compile = resolver.getAllDependencies(compile, runtime);
assertNotNull(dependencies_compile); assertNotNull(dependencies_compile);
assertEquals(8, dependencies_compile.size()); assertEquals(8, dependencies_compile.size());
@ -460,7 +482,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesSpringBoot() { void testGetCompileTransitiveDependenciesSpringBoot() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(18, dependencies.size()); assertEquals(18, dependencies.size());
@ -487,7 +509,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesMaven() { void testGetCompileTransitiveDependenciesMaven() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(32, dependencies.size()); assertEquals(32, dependencies.size());
@ -528,7 +550,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesPlay() { void testGetCompileTransitiveDependenciesPlay() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(48, dependencies.size()); assertEquals(48, dependencies.size());
@ -585,7 +607,7 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileTransitiveDependenciesVaadin() { void testGetCompileTransitiveDependenciesVaadin() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
var dependencies = resolver.getAllDependencies(compile); var dependencies = resolver.getAllDependencies(compile);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(88, dependencies.size()); assertEquals(88, dependencies.size());
@ -682,27 +704,27 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileRuntimeTransitiveDependenciesBitly() { void testGetCompileRuntimeTransitiveDependenciesBitly() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
var dependencies = resolver.getAllDependencies(compile, runtime); var dependencies = resolver.getAllDependencies(compile, runtime);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(11, dependencies.size()); assertEquals(11, dependencies.size());
assertEquals(""" assertEquals("""
net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT net.thauvin.erik:bitly-shorten:2.0.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 org.jetbrains.kotlin:kotlin-stdlib:2.1.10
com.squareup.okhttp3:okhttp:4.11.0 org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
com.squareup.okhttp3:logging-interceptor:4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
org.json:json:20230618 com.squareup.okhttp3:okhttp:4.12.0
org.jetbrains.kotlin:kotlin-stdlib:1.8.22 com.squareup.okhttp3:logging-interceptor:4.12.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22 org.json:json:20250107
com.squareup.okio:okio:3.2.0
org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
org.jetbrains:annotations:13.0 org.jetbrains:annotations:13.0
com.squareup.okio:okio-jvm:3.2.0""", StringUtils.join(dependencies, "\n")); org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10
com.squareup.okio:okio:3.6.0
com.squareup.okio:okio-jvm:3.6.0""", StringUtils.join(dependencies, "\n"));
} }
@Test @Test
void testGetCompileRuntimeTransitiveDependenciesMariaDb() { void testGetCompileRuntimeTransitiveDependenciesMariaDb() {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.mariadb.jdbc", "mariadb-java-client", new VersionNumber(3, 1, 3))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.mariadb.jdbc", "mariadb-java-client", new VersionNumber(3, 1, 3)));
var dependencies_compile = resolver.getAllDependencies(compile, runtime); var dependencies_compile = resolver.getAllDependencies(compile, runtime);
assertNotNull(dependencies_compile); assertNotNull(dependencies_compile);
assertEquals(9, dependencies_compile.size()); assertEquals(9, dependencies_compile.size());
@ -726,7 +748,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependency() void testTransferDependency()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -748,7 +770,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySources() void testTransferDependencySources()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -771,7 +793,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySourcesJavadoc() void testTransferDependencySourcesJavadoc()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -795,17 +817,17 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySnapshot() void testTransferDependencySnapshot()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2); var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2);
assertEquals(""" assertEquals("""
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar""", StringUtils.join(result, "\n")); https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar""", StringUtils.join(result, "\n"));
var files = FileUtils.getFileList(tmp1); var files = FileUtils.getFileList(tmp1);
assertEquals(1, files.size()); assertEquals(1, files.size());
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
assertTrue(FileUtils.getFileList(tmp2).isEmpty()); assertTrue(FileUtils.getFileList(tmp2).isEmpty());
} finally { } finally {
@ -817,19 +839,19 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySnapshotSources() void testTransferDependencySnapshotSources()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES); var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES);
assertEquals(""" assertEquals("""
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar""", StringUtils.join(result, "\n")); https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar""", StringUtils.join(result, "\n"));
var files = FileUtils.getFileList(tmp1); var files = FileUtils.getFileList(tmp1);
assertEquals(2, files.size()); assertEquals(2, files.size());
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
assertTrue(FileUtils.getFileList(tmp2).isEmpty()); assertTrue(FileUtils.getFileList(tmp2).isEmpty());
} finally { } finally {
@ -841,21 +863,21 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySnapshotSourcesJavadoc() void testTransferDependencySnapshotSourcesJavadoc()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES, CLASSIFIER_JAVADOC); var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES, CLASSIFIER_JAVADOC);
assertEquals(""" assertEquals("""
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-javadoc.jar""", StringUtils.join(result, "\n")); https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-javadoc.jar""", StringUtils.join(result, "\n"));
var files = FileUtils.getFileList(tmp1); var files = FileUtils.getFileList(tmp1);
assertEquals(3, files.size()); assertEquals(3, files.size());
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-javadoc.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-javadoc.jar"));
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
assertTrue(FileUtils.getFileList(tmp2).isEmpty()); assertTrue(FileUtils.getFileList(tmp2).isEmpty());
} finally { } finally {
@ -867,7 +889,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySourcesModule() void testTransferDependencySourcesModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2"));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -890,7 +912,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySourcesJavadocModule() void testTransferDependencySourcesJavadocModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2")); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2"));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -914,19 +936,19 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySnapshotModule() void testTransferDependencySnapshotModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2); var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2);
assertEquals(""" assertEquals("""
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar""", StringUtils.join(result, "\n")); https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar""", StringUtils.join(result, "\n"));
assertTrue(FileUtils.getFileList(tmp1).isEmpty()); assertTrue(FileUtils.getFileList(tmp1).isEmpty());
var files = FileUtils.getFileList(tmp2); var files = FileUtils.getFileList(tmp2);
assertEquals(1, files.size()); assertEquals(1, files.size());
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
} finally { } finally {
FileUtils.deleteDirectory(tmp1); FileUtils.deleteDirectory(tmp1);
FileUtils.deleteDirectory(tmp2); FileUtils.deleteDirectory(tmp2);
@ -936,21 +958,21 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySnapshotSourcesModule() void testTransferDependencySnapshotSourcesModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES); var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES);
assertEquals(""" assertEquals("""
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar""", StringUtils.join(result, "\n")); https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar""", StringUtils.join(result, "\n"));
assertTrue(FileUtils.getFileList(tmp1).isEmpty()); assertTrue(FileUtils.getFileList(tmp1).isEmpty());
var files = FileUtils.getFileList(tmp2); var files = FileUtils.getFileList(tmp2);
assertEquals(2, files.size()); assertEquals(2, files.size());
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
} finally { } finally {
FileUtils.deleteDirectory(tmp1); FileUtils.deleteDirectory(tmp1);
FileUtils.deleteDirectory(tmp2); FileUtils.deleteDirectory(tmp2);
@ -960,23 +982,23 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySnapshotSourcesJavadocModule() void testTransferDependencySnapshotSourcesJavadocModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES, CLASSIFIER_JAVADOC); var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES, CLASSIFIER_JAVADOC);
assertEquals(""" assertEquals("""
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-javadoc.jar""", StringUtils.join(result, "\n")); https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-javadoc.jar""", StringUtils.join(result, "\n"));
assertTrue(FileUtils.getFileList(tmp1).isEmpty()); assertTrue(FileUtils.getFileList(tmp1).isEmpty());
var files = FileUtils.getFileList(tmp2); var files = FileUtils.getFileList(tmp2);
assertEquals(3, files.size()); assertEquals(3, files.size());
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-javadoc.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-javadoc.jar"));
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar")); assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
} finally { } finally {
FileUtils.deleteDirectory(tmp1); FileUtils.deleteDirectory(tmp1);
FileUtils.deleteDirectory(tmp2); FileUtils.deleteDirectory(tmp2);
@ -986,7 +1008,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyJetty() void testTransferDependencyJetty()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1020,7 +1042,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyJettyModule() void testTransferDependencyJettyModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1051,10 +1073,60 @@ public class TestDependencyResolver {
} }
} }
@Test
void testTransferDependencySwagger()
throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("io.swagger.core.v3", "swagger-core", new VersionNumber(2,2,27)));
var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile();
try {
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2);
assertEquals("""
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core/2.2.27/swagger-core-2.2.27.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.17.0/commons-lang3-3.17.0.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.16.2/jackson-annotations-2.16.2.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.16.2/jackson-databind-2.16.2.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.16.2/jackson-dataformat-yaml-2.16.2.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.16.2/jackson-datatype-jsr310-2.16.2.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-annotations/2.2.27/swagger-annotations-2.2.27.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.3/snakeyaml-2.3.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-models/2.2.27/swagger-models-2.2.27.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar
https://repo1.maven.org/maven2/:https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.16.2/jackson-core-2.16.2.jar""", StringUtils.join(result, "\n"));
var files = FileUtils.getFileList(tmp1);
assertEquals(14, files.size());
Collections.sort(files);
assertEquals("""
commons-lang3-3.17.0.jar
jackson-annotations-2.16.2.jar
jackson-core-2.16.2.jar
jackson-databind-2.16.2.jar
jackson-dataformat-yaml-2.16.2.jar
jackson-datatype-jsr310-2.16.2.jar
jakarta.activation-api-1.2.2.jar
jakarta.validation-api-2.0.2.jar
jakarta.xml.bind-api-2.3.3.jar
slf4j-api-2.0.9.jar
snakeyaml-2.3.jar
swagger-annotations-2.2.27.jar
swagger-core-2.2.27.jar
swagger-models-2.2.27.jar""", StringUtils.join(files, "\n"));
assertTrue(FileUtils.getFileList(tmp2).isEmpty());
} finally {
FileUtils.deleteDirectory(tmp1);
FileUtils.deleteDirectory(tmp2);
}
}
@Test @Test
void testTransferDependencyGoogleApi() void testTransferDependencyGoogleApi()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1124,7 +1196,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyGoogleApiModule() void testTransferDependencyGoogleApiModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0"))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1198,7 +1270,7 @@ public class TestDependencyResolver {
.put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11") .put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11")
.put(PROPERTY_OVERRIDE_PREFIX + "1", "org.eclipse.jetty:jetty-io:11.0.13") .put(PROPERTY_OVERRIDE_PREFIX + "1", "org.eclipse.jetty:jetty-io:11.0.13")
.put(PROPERTY_OVERRIDE_PREFIX + "2", "org.eclipse.jetty:jetty-server:11.0.15")); .put(PROPERTY_OVERRIDE_PREFIX + "2", "org.eclipse.jetty:jetty-server:11.0.15"));
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1236,7 +1308,7 @@ public class TestDependencyResolver {
.put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11") .put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11")
.put(PROPERTY_OVERRIDE_PREFIX + "1", "org.eclipse.jetty:jetty-io:11.0.13") .put(PROPERTY_OVERRIDE_PREFIX + "1", "org.eclipse.jetty:jetty-io:11.0.13")
.put(PROPERTY_OVERRIDE_PREFIX + "2", "org.eclipse.jetty:jetty-server:11.0.15")); .put(PROPERTY_OVERRIDE_PREFIX + "2", "org.eclipse.jetty:jetty-server:11.0.15"));
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1270,7 +1342,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyJettySources() void testTransferDependencyJettySources()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1316,7 +1388,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyJettySourcesModule() void testTransferDependencyJettySourcesModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1362,7 +1434,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyJettySourcesJavadoc() void testTransferDependencyJettySourcesJavadoc()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1420,7 +1492,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyJettySourcesJavadocModule() void testTransferDependencyJettySourcesJavadocModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1478,7 +1550,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependenciesJunit() void testTransferDependenciesJunit()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1516,7 +1588,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencySpringBoot() void testTransferDependencySpringBoot()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1574,7 +1646,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyMaven() void testTransferDependencyMaven()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1660,7 +1732,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyPlay() void testTransferDependencyPlay()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1780,7 +1852,7 @@ public class TestDependencyResolver {
throws Exception { throws Exception {
var resolution = new VersionResolution(new HierarchicalProperties() var resolution = new VersionResolution(new HierarchicalProperties()
.put(PROPERTY_OVERRIDE_PREFIX, "org.scala-lang:scala-library:2.13.12,org.slf4j:slf4j-api:2.0.11,com.google.guava:guava:31.1-jre")); .put(PROPERTY_OVERRIDE_PREFIX, "org.scala-lang:scala-library:2.13.12,org.slf4j:slf4j-api:2.0.11,com.google.guava:guava:31.1-jre"));
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19))); var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -1898,7 +1970,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferDependencyVaadin() void testTransferDependencyVaadin()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -2096,7 +2168,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferCheckExisting() void testTransferCheckExisting()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {
@ -2154,7 +2226,7 @@ public class TestDependencyResolver {
@Test @Test
void testTransferCheckExistingModule() void testTransferCheckExistingModule()
throws Exception { throws Exception {
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))); var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
var tmp1 = Files.createTempDirectory("transfers").toFile(); var tmp1 = Files.createTempDirectory("transfers").toFile();
var tmp2 = Files.createTempDirectory("modules").toFile(); var tmp2 = Files.createTempDirectory("modules").toFile();
try { try {

View file

@ -359,19 +359,19 @@ public class TestDependencySet {
@Test @Test
void testGenerateDependencyTreeCompileRuntime() { void testGenerateDependencyTreeCompileRuntime() {
var dependencies = new DependencySet() var dependencies = new DependencySet()
.include(new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT"))); .include(new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
assertEquals(StringUtils.convertLineSeparator(""" assertEquals(StringUtils.convertLineSeparator("""
net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT net.thauvin.erik:bitly-shorten:2.0.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 org.jetbrains.kotlin:kotlin-stdlib:2.1.10
org.jetbrains.kotlin:kotlin-stdlib:1.8.22 org.jetbrains:annotations:13.0
org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
org.jetbrains:annotations:13.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22 org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10
com.squareup.okhttp3:okhttp:4.11.0 com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio:3.2.0 com.squareup.okio:okio:3.6.0
com.squareup.okio:okio-jvm:3.2.0 com.squareup.okio:okio-jvm:3.6.0
com.squareup.okhttp3:logging-interceptor:4.11.0 com.squareup.okhttp3:logging-interceptor:4.12.0
org.json:json:20230618 org.json:json:20250107
"""), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), compile, runtime)); """), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), compile, runtime));
} }
} }

View file

@ -223,7 +223,7 @@ public class TestCompileOperation {
var compile_operation = new CompileOperation() var compile_operation = new CompileOperation()
.fromProject(create_operation.project()); .fromProject(create_operation.project());
var main_app_class = new File(new File(compile_operation.buildMainDirectory(), "tst"), "AppMain.class"); var main_app_class = new File(new File(compile_operation.buildMainDirectory(), "tst"), "App.class");
var test_app_class = new File(new File(compile_operation.buildTestDirectory(), "tst"), "AppTest.class"); var test_app_class = new File(new File(compile_operation.buildTestDirectory(), "tst"), "AppTest.class");
assertFalse(main_app_class.exists()); assertFalse(main_app_class.exists());
assertFalse(test_app_class.exists()); assertFalse(test_app_class.exists());

View file

@ -65,165 +65,166 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyApp\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()
@ -247,62 +248,63 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("org.stuff") .packageName("org.stuff")
.projectName("yourthing"); .projectName("your-thing")
.baseName("YourThing");
create_operation.execute(); create_operation.execute();
assertEquals(""" assertEquals("""
/yourthing /your-thing
/yourthing/.gitignore /your-thing/.gitignore
/yourthing/.idea /your-thing/.idea
/yourthing/.idea/app.iml /your-thing/.idea/app.iml
/yourthing/.idea/bld.iml /your-thing/.idea/bld.iml
/yourthing/.idea/libraries /your-thing/.idea/libraries
/yourthing/.idea/libraries/bld.xml /your-thing/.idea/libraries/bld.xml
/yourthing/.idea/libraries/compile.xml /your-thing/.idea/libraries/compile.xml
/yourthing/.idea/libraries/runtime.xml /your-thing/.idea/libraries/runtime.xml
/yourthing/.idea/libraries/test.xml /your-thing/.idea/libraries/test.xml
/yourthing/.idea/misc.xml /your-thing/.idea/misc.xml
/yourthing/.idea/modules.xml /your-thing/.idea/modules.xml
/yourthing/.idea/runConfigurations /your-thing/.idea/runConfigurations
/yourthing/.idea/runConfigurations/Run Main.xml /your-thing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml /your-thing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode /your-thing/.vscode
/yourthing/.vscode/launch.json /your-thing/.vscode/launch.json
/yourthing/.vscode/settings.json /your-thing/.vscode/settings.json
/yourthing/bld /your-thing/bld
/yourthing/bld.bat /your-thing/bld.bat
/yourthing/lib /your-thing/lib
/yourthing/lib/bld /your-thing/lib/bld
/yourthing/lib/bld/bld-wrapper.jar /your-thing/lib/bld/bld-wrapper.jar
/yourthing/lib/bld/bld-wrapper.properties /your-thing/lib/bld/bld-wrapper.properties
/yourthing/lib/compile /your-thing/lib/compile
/yourthing/lib/compile/modules /your-thing/lib/compile/modules
/yourthing/lib/provided /your-thing/lib/provided
/yourthing/lib/provided/modules /your-thing/lib/provided/modules
/yourthing/lib/runtime /your-thing/lib/runtime
/yourthing/lib/runtime/modules /your-thing/lib/runtime/modules
/yourthing/lib/test /your-thing/lib/test
/yourthing/lib/test/modules /your-thing/lib/test/modules
/yourthing/src /your-thing/src
/yourthing/src/bld /your-thing/src/bld
/yourthing/src/bld/java /your-thing/src/bld/java
/yourthing/src/bld/java/org /your-thing/src/bld/java/org
/yourthing/src/bld/java/org/stuff /your-thing/src/bld/java/org/stuff
/yourthing/src/bld/java/org/stuff/YourthingBuild.java /your-thing/src/bld/java/org/stuff/YourThingBuild.java
/yourthing/src/bld/resources /your-thing/src/bld/resources
/yourthing/src/main /your-thing/src/main
/yourthing/src/main/java /your-thing/src/main/java
/yourthing/src/main/java/org /your-thing/src/main/java/org
/yourthing/src/main/java/org/stuff /your-thing/src/main/java/org/stuff
/yourthing/src/main/java/org/stuff/YourthingMain.java /your-thing/src/main/java/org/stuff/YourThing.java
/yourthing/src/main/resources /your-thing/src/main/resources
/yourthing/src/main/resources/templates /your-thing/src/main/resources/templates
/yourthing/src/test /your-thing/src/test
/yourthing/src/test/java /your-thing/src/test/java
/yourthing/src/test/java/org /your-thing/src/test/java/org
/yourthing/src/test/java/org/stuff /your-thing/src/test/java/org/stuff
/yourthing/src/test/java/org/stuff/YourthingTest.java /your-thing/src/test/java/org/stuff/YourThingTest.java
/yourthing/src/test/resources""", /your-thing/src/test/resources""",
FileUtils.generateDirectoryListing(tmp)); FileUtils.generateDirectoryListing(tmp));
var compile_operation = new CompileOperation() { var compile_operation = new CompileOperation() {
@ -327,7 +329,8 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
@ -350,88 +353,87 @@ public class TestCreateAppOperation {
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
System.out.println(FileUtils.generateDirectoryListing(tmp));
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyApp\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/local /my-app/lib/local
/myapp/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/local/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-5\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-5\\.11\\.4\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-api-5\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-api-5\\.11\\.4\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-engine-5\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-engine-5\\.11\\.4\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-params-5\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-params-5\\.11\\.4\\.jar
/myapp/lib/local/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/local/junit-platform-commons-1\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/local/junit-platform-commons-1\\.11\\.4\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/local/junit-platform-console-standalone-1\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/local/junit-platform-console-standalone-1\\.11\\.4\\.jar
/myapp/lib/local/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/local/junit-platform-engine-1\\.11\\.4-sources\\.jar
/myapp/lib/local/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/local/junit-platform-engine-1\\.11\\.4\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/local/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0\\.jar /my-app/lib/local/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()
@ -455,7 +457,8 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
@ -477,87 +480,87 @@ public class TestCreateAppOperation {
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyApp\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/local_compile /my-app/lib/local_compile
/myapp/lib/local_test /my-app/lib/local_test
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/local_test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-5\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-5\\.11\\.4\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-api-5\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-api-5\\.11\\.4\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-engine-5\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-engine-5\\.11\\.4\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-params-5\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-params-5\\.11\\.4\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-platform-commons-1\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/local_test/junit-platform-commons-1\\.11\\.4\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-platform-console-standalone-1\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/local_test/junit-platform-console-standalone-1\\.11\\.4\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-platform-engine-1\\.11\\.4-sources\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/local_test/junit-platform-engine-1\\.11\\.4\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/local_test/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()

View file

@ -58,129 +58,130 @@ public class TestCreateBaseOperation {
var create_operation = new CreateBaseOperation() var create_operation = new CreateBaseOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyApp\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()
@ -204,129 +205,130 @@ public class TestCreateBaseOperation {
var create_operation = new CreateBaseOperation() var create_operation = new CreateBaseOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("org.stuff") .packageName("org.stuff")
.projectName("yourthing"); .projectName("your-thing")
.baseName("YourThing");
create_operation.execute(); create_operation.execute();
assertEquals(""" assertEquals("""
/yourthing /your-thing
/yourthing/.gitignore /your-thing/.gitignore
/yourthing/.idea /your-thing/.idea
/yourthing/.idea/app.iml /your-thing/.idea/app.iml
/yourthing/.idea/bld.iml /your-thing/.idea/bld.iml
/yourthing/.idea/libraries /your-thing/.idea/libraries
/yourthing/.idea/libraries/bld.xml /your-thing/.idea/libraries/bld.xml
/yourthing/.idea/libraries/compile.xml /your-thing/.idea/libraries/compile.xml
/yourthing/.idea/libraries/runtime.xml /your-thing/.idea/libraries/runtime.xml
/yourthing/.idea/libraries/test.xml /your-thing/.idea/libraries/test.xml
/yourthing/.idea/misc.xml /your-thing/.idea/misc.xml
/yourthing/.idea/modules.xml /your-thing/.idea/modules.xml
/yourthing/.idea/runConfigurations /your-thing/.idea/runConfigurations
/yourthing/.idea/runConfigurations/Run Main.xml /your-thing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml /your-thing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode /your-thing/.vscode
/yourthing/.vscode/launch.json /your-thing/.vscode/launch.json
/yourthing/.vscode/settings.json /your-thing/.vscode/settings.json
/yourthing/bld /your-thing/bld
/yourthing/bld.bat /your-thing/bld.bat
/yourthing/lib /your-thing/lib
/yourthing/lib/bld /your-thing/lib/bld
/yourthing/lib/bld/bld-wrapper.jar /your-thing/lib/bld/bld-wrapper.jar
/yourthing/lib/bld/bld-wrapper.properties /your-thing/lib/bld/bld-wrapper.properties
/yourthing/lib/compile /your-thing/lib/compile
/yourthing/lib/compile/modules /your-thing/lib/compile/modules
/yourthing/lib/provided /your-thing/lib/provided
/yourthing/lib/provided/modules /your-thing/lib/provided/modules
/yourthing/lib/runtime /your-thing/lib/runtime
/yourthing/lib/runtime/modules /your-thing/lib/runtime/modules
/yourthing/lib/test /your-thing/lib/test
/yourthing/lib/test/modules /your-thing/lib/test/modules
/yourthing/src /your-thing/src
/yourthing/src/bld /your-thing/src/bld
/yourthing/src/bld/java /your-thing/src/bld/java
/yourthing/src/bld/java/org /your-thing/src/bld/java/org
/yourthing/src/bld/java/org/stuff /your-thing/src/bld/java/org/stuff
/yourthing/src/bld/java/org/stuff/YourthingBuild.java /your-thing/src/bld/java/org/stuff/YourThingBuild.java
/yourthing/src/bld/resources /your-thing/src/bld/resources
/yourthing/src/main /your-thing/src/main
/yourthing/src/main/java /your-thing/src/main/java
/yourthing/src/main/java/org /your-thing/src/main/java/org
/yourthing/src/main/java/org/stuff /your-thing/src/main/java/org/stuff
/yourthing/src/main/java/org/stuff/YourthingMain.java /your-thing/src/main/java/org/stuff/YourThing.java
/yourthing/src/main/resources /your-thing/src/main/resources
/yourthing/src/main/resources/templates /your-thing/src/main/resources/templates
/yourthing/src/test /your-thing/src/test
/yourthing/src/test/java /your-thing/src/test/java
/yourthing/src/test/java/org /your-thing/src/test/java/org
/yourthing/src/test/java/org/stuff /your-thing/src/test/java/org/stuff
/yourthing/src/test/java/org/stuff/YourthingTest.java /your-thing/src/test/java/org/stuff/YourThingTest.java
/yourthing/src/test/resources""", /your-thing/src/test/resources""",
FileUtils.generateDirectoryListing(tmp)); FileUtils.generateDirectoryListing(tmp));
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertEquals(""" assertEquals("""
/yourthing /your-thing
/yourthing/.gitignore /your-thing/.gitignore
/yourthing/.idea /your-thing/.idea
/yourthing/.idea/app.iml /your-thing/.idea/app.iml
/yourthing/.idea/bld.iml /your-thing/.idea/bld.iml
/yourthing/.idea/libraries /your-thing/.idea/libraries
/yourthing/.idea/libraries/bld.xml /your-thing/.idea/libraries/bld.xml
/yourthing/.idea/libraries/compile.xml /your-thing/.idea/libraries/compile.xml
/yourthing/.idea/libraries/runtime.xml /your-thing/.idea/libraries/runtime.xml
/yourthing/.idea/libraries/test.xml /your-thing/.idea/libraries/test.xml
/yourthing/.idea/misc.xml /your-thing/.idea/misc.xml
/yourthing/.idea/modules.xml /your-thing/.idea/modules.xml
/yourthing/.idea/runConfigurations /your-thing/.idea/runConfigurations
/yourthing/.idea/runConfigurations/Run Main.xml /your-thing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml /your-thing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode /your-thing/.vscode
/yourthing/.vscode/launch.json /your-thing/.vscode/launch.json
/yourthing/.vscode/settings.json /your-thing/.vscode/settings.json
/yourthing/bld /your-thing/bld
/yourthing/bld.bat /your-thing/bld.bat
/yourthing/build /your-thing/build
/yourthing/build/main /your-thing/build/main
/yourthing/build/main/org /your-thing/build/main/org
/yourthing/build/main/org/stuff /your-thing/build/main/org/stuff
/yourthing/build/main/org/stuff/YourthingMain.class /your-thing/build/main/org/stuff/YourThing.class
/yourthing/build/test /your-thing/build/test
/yourthing/build/test/org /your-thing/build/test/org
/yourthing/build/test/org/stuff /your-thing/build/test/org/stuff
/yourthing/build/test/org/stuff/YourthingTest.class /your-thing/build/test/org/stuff/YourThingTest.class
/yourthing/lib /your-thing/lib
/yourthing/lib/bld /your-thing/lib/bld
/yourthing/lib/bld/bld-wrapper.jar /your-thing/lib/bld/bld-wrapper.jar
/yourthing/lib/bld/bld-wrapper.properties /your-thing/lib/bld/bld-wrapper.properties
/yourthing/lib/compile /your-thing/lib/compile
/yourthing/lib/compile/modules /your-thing/lib/compile/modules
/yourthing/lib/provided /your-thing/lib/provided
/yourthing/lib/provided/modules /your-thing/lib/provided/modules
/yourthing/lib/runtime /your-thing/lib/runtime
/yourthing/lib/runtime/modules /your-thing/lib/runtime/modules
/yourthing/lib/test /your-thing/lib/test
/yourthing/lib/test/modules /your-thing/lib/test/modules
/yourthing/src /your-thing/src
/yourthing/src/bld /your-thing/src/bld
/yourthing/src/bld/java /your-thing/src/bld/java
/yourthing/src/bld/java/org /your-thing/src/bld/java/org
/yourthing/src/bld/java/org/stuff /your-thing/src/bld/java/org/stuff
/yourthing/src/bld/java/org/stuff/YourthingBuild.java /your-thing/src/bld/java/org/stuff/YourThingBuild.java
/yourthing/src/bld/resources /your-thing/src/bld/resources
/yourthing/src/main /your-thing/src/main
/yourthing/src/main/java /your-thing/src/main/java
/yourthing/src/main/java/org /your-thing/src/main/java/org
/yourthing/src/main/java/org/stuff /your-thing/src/main/java/org/stuff
/yourthing/src/main/java/org/stuff/YourthingMain.java /your-thing/src/main/java/org/stuff/YourThing.java
/yourthing/src/main/resources /your-thing/src/main/resources
/yourthing/src/main/resources/templates /your-thing/src/main/resources/templates
/yourthing/src/test /your-thing/src/test
/yourthing/src/test/java /your-thing/src/test/java
/yourthing/src/test/java/org /your-thing/src/test/java/org
/yourthing/src/test/java/org/stuff /your-thing/src/test/java/org/stuff
/yourthing/src/test/java/org/stuff/YourthingTest.java /your-thing/src/test/java/org/stuff/YourThingTest.java
/yourthing/src/test/resources""", /your-thing/src/test/resources""",
FileUtils.generateDirectoryListing(tmp)); FileUtils.generateDirectoryListing(tmp));
var check_result = new StringBuilder(); var check_result = new StringBuilder();

View file

@ -58,163 +58,164 @@ public class TestCreateLibOperation {
var create_operation = new CreateLibOperation() var create_operation = new CreateLibOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappLib\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappLib\\.class /my-app/build/main/com/example/MyApp\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.4\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.4\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.4\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappLib\\.java /my-app/src/main/java/com/example/MyApp\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new JUnitOperation() new JUnitOperation()

File diff suppressed because it is too large Load diff

View file

@ -159,7 +159,7 @@ public class TestDownloadOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
operation.dependencies().scope(Scope.standalone) operation.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
operation.dependencies().scope(Scope.test) operation.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1))); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
@ -174,14 +174,14 @@ public class TestDownloadOperation {
/dir4 /dir4
/dir4/dir9 /dir4/dir9
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
/dir5 /dir5
/dir5/dir10 /dir5/dir10
@ -249,7 +249,7 @@ public class TestDownloadOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
operation.dependencies().scope(Scope.standalone) operation.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
operation.dependencies().scope(Scope.test) operation.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)).excludeSources().excludeJavadoc()); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)).excludeSources().excludeJavadoc());
@ -270,30 +270,30 @@ public class TestDownloadOperation {
/dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar /dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar /dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-javadoc.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-javadoc.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-sources.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-sources.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-http-12.0.12-javadoc.jar /dir4/dir9/jetty-http-12.0.16-javadoc.jar
/dir4/dir9/jetty-http-12.0.12-sources.jar /dir4/dir9/jetty-http-12.0.16-sources.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-io-12.0.12-javadoc.jar /dir4/dir9/jetty-io-12.0.16-javadoc.jar
/dir4/dir9/jetty-io-12.0.12-sources.jar /dir4/dir9/jetty-io-12.0.16-sources.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-security-12.0.12-javadoc.jar /dir4/dir9/jetty-security-12.0.16-javadoc.jar
/dir4/dir9/jetty-security-12.0.12-sources.jar /dir4/dir9/jetty-security-12.0.16-sources.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-server-12.0.12-javadoc.jar /dir4/dir9/jetty-server-12.0.16-javadoc.jar
/dir4/dir9/jetty-server-12.0.12-sources.jar /dir4/dir9/jetty-server-12.0.16-sources.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-session-12.0.12-javadoc.jar /dir4/dir9/jetty-session-12.0.16-javadoc.jar
/dir4/dir9/jetty-session-12.0.12-sources.jar /dir4/dir9/jetty-session-12.0.16-sources.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-util-12.0.12-javadoc.jar /dir4/dir9/jetty-util-12.0.16-javadoc.jar
/dir4/dir9/jetty-util-12.0.12-sources.jar /dir4/dir9/jetty-util-12.0.16-sources.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/slf4j-api-2.0.13-javadoc.jar /dir4/dir9/slf4j-api-2.0.16-javadoc.jar
/dir4/dir9/slf4j-api-2.0.13-sources.jar /dir4/dir9/slf4j-api-2.0.16-sources.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/slf4j-simple-2.0.6-javadoc.jar /dir4/slf4j-simple-2.0.6-javadoc.jar
/dir4/slf4j-simple-2.0.6-sources.jar /dir4/slf4j-simple-2.0.6-sources.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
@ -371,7 +371,7 @@ public class TestDownloadOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
project.dependencies().scope(Scope.standalone) project.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
project.dependencies().scope(Scope.test) project.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1))); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
@ -413,22 +413,22 @@ public class TestDownloadOperation {
/lib/standalone/modules /lib/standalone/modules
/lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar /lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar
/lib/standalone/modules/jakarta.servlet-api-6.0.0.jar /lib/standalone/modules/jakarta.servlet-api-6.0.0.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.12-sources.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.16-sources.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.12.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.16.jar
/lib/standalone/modules/jetty-http-12.0.12-sources.jar /lib/standalone/modules/jetty-http-12.0.16-sources.jar
/lib/standalone/modules/jetty-http-12.0.12.jar /lib/standalone/modules/jetty-http-12.0.16.jar
/lib/standalone/modules/jetty-io-12.0.12-sources.jar /lib/standalone/modules/jetty-io-12.0.16-sources.jar
/lib/standalone/modules/jetty-io-12.0.12.jar /lib/standalone/modules/jetty-io-12.0.16.jar
/lib/standalone/modules/jetty-security-12.0.12-sources.jar /lib/standalone/modules/jetty-security-12.0.16-sources.jar
/lib/standalone/modules/jetty-security-12.0.12.jar /lib/standalone/modules/jetty-security-12.0.16.jar
/lib/standalone/modules/jetty-server-12.0.12-sources.jar /lib/standalone/modules/jetty-server-12.0.16-sources.jar
/lib/standalone/modules/jetty-server-12.0.12.jar /lib/standalone/modules/jetty-server-12.0.16.jar
/lib/standalone/modules/jetty-session-12.0.12-sources.jar /lib/standalone/modules/jetty-session-12.0.16-sources.jar
/lib/standalone/modules/jetty-session-12.0.12.jar /lib/standalone/modules/jetty-session-12.0.16.jar
/lib/standalone/modules/jetty-util-12.0.12-sources.jar /lib/standalone/modules/jetty-util-12.0.16-sources.jar
/lib/standalone/modules/jetty-util-12.0.12.jar /lib/standalone/modules/jetty-util-12.0.16.jar
/lib/standalone/modules/slf4j-api-2.0.13-sources.jar /lib/standalone/modules/slf4j-api-2.0.16-sources.jar
/lib/standalone/modules/slf4j-api-2.0.13.jar /lib/standalone/modules/slf4j-api-2.0.16.jar
/lib/standalone/slf4j-simple-2.0.6-sources.jar /lib/standalone/slf4j-simple-2.0.6-sources.jar
/lib/standalone/slf4j-simple-2.0.6.jar /lib/standalone/slf4j-simple-2.0.6.jar
/lib/test /lib/test

View file

@ -13,6 +13,7 @@ import rife.tools.StringUtils;
import java.io.File; import java.io.File;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
@ -25,6 +26,7 @@ public class TestJUnitOperation {
assertTrue(operation.workDirectory().exists()); assertTrue(operation.workDirectory().exists());
assertTrue(operation.workDirectory().isDirectory()); assertTrue(operation.workDirectory().isDirectory());
assertTrue(operation.workDirectory().canWrite()); assertTrue(operation.workDirectory().canWrite());
assertTrue(operation.environment().isEmpty());
assertEquals("java", operation.javaTool()); assertEquals("java", operation.javaTool());
assertTrue(operation.javaOptions().isEmpty()); assertTrue(operation.javaOptions().isEmpty());
assertTrue(operation.classpath().isEmpty()); assertTrue(operation.classpath().isEmpty());
@ -37,6 +39,8 @@ public class TestJUnitOperation {
@Test @Test
void testPopulation() void testPopulation()
throws Exception { throws Exception {
var environment = Map.of("env1", "val1", "env2", "val2", "env3", "val3");
var environment_full = Map.of("env1", "val1", "env2", "val2", "env3", "val3", "env4", "val4");
var work_directory = Files.createTempDirectory("test").toFile(); var work_directory = Files.createTempDirectory("test").toFile();
try { try {
var java_tool = "javatool"; var java_tool = "javatool";
@ -53,6 +57,8 @@ public class TestJUnitOperation {
var operation1 = new JUnitOperation(); var operation1 = new JUnitOperation();
operation1 operation1
.workDirectory(work_directory) .workDirectory(work_directory)
.environment(environment)
.environment("env4", "val4")
.javaTool(java_tool) .javaTool(java_tool)
.javaOptions(List.of(test_java_option1, test_java_option2)) .javaOptions(List.of(test_java_option1, test_java_option2))
.testToolOptions(List.of(test_tool_option1, test_tool_option2)) .testToolOptions(List.of(test_tool_option1, test_tool_option2))
@ -62,6 +68,7 @@ public class TestJUnitOperation {
.errorProcessor(test_error_consumer); .errorProcessor(test_error_consumer);
assertEquals(work_directory, operation1.workDirectory()); assertEquals(work_directory, operation1.workDirectory());
assertEquals(environment_full, operation1.environment());
assertEquals(java_tool, operation1.javaTool()); assertEquals(java_tool, operation1.javaTool());
assertTrue(operation1.javaOptions().contains(test_java_option1)); assertTrue(operation1.javaOptions().contains(test_java_option1));
assertTrue(operation1.javaOptions().contains(test_java_option2)); assertTrue(operation1.javaOptions().contains(test_java_option2));
@ -75,6 +82,8 @@ public class TestJUnitOperation {
var operation2 = new JUnitOperation(); var operation2 = new JUnitOperation();
operation2.workDirectory(work_directory); operation2.workDirectory(work_directory);
operation2.environment(environment);
operation2.environment("env4", "val4");
operation2.javaTool(java_tool); operation2.javaTool(java_tool);
operation2.javaOptions().add(test_java_option1); operation2.javaOptions().add(test_java_option1);
operation2.javaOptions().add(test_java_option2); operation2.javaOptions().add(test_java_option2);
@ -87,6 +96,7 @@ public class TestJUnitOperation {
operation2.errorProcessor(test_error_consumer); operation2.errorProcessor(test_error_consumer);
assertEquals(work_directory, operation2.workDirectory()); assertEquals(work_directory, operation2.workDirectory());
assertEquals(environment_full, operation2.environment());
assertEquals(java_tool, operation2.javaTool()); assertEquals(java_tool, operation2.javaTool());
assertTrue(operation2.javaOptions().contains(test_java_option1)); assertTrue(operation2.javaOptions().contains(test_java_option1));
assertTrue(operation2.javaOptions().contains(test_java_option2)); assertTrue(operation2.javaOptions().contains(test_java_option2));
@ -124,7 +134,7 @@ public class TestJUnitOperation {
public class Source1 { public class Source1 {
public final String name_; public final String name_;
public Source1() { public Source1() {
name_ = "source1"; name_ = System.getenv("execute_name") + System.getenv("execute_number");
} }
public static void main(String[] arguments) public static void main(String[] arguments)
@ -156,6 +166,8 @@ public class TestJUnitOperation {
var output = new StringBuilder(); var output = new StringBuilder();
var test_operation = new JUnitOperation() var test_operation = new JUnitOperation()
.environment(Map.of("execute_name", "source"))
.environment("execute_number", "1")
.mainClass("Source2") .mainClass("Source2")
.classpath(List.of(build_main.getAbsolutePath(), build_test.getAbsolutePath())) .classpath(List.of(build_main.getAbsolutePath(), build_test.getAbsolutePath()))
.outputProcessor(s -> { .outputProcessor(s -> {

View file

@ -209,7 +209,7 @@ public class TestJarOperation {
assertEquals(""" assertEquals("""
META-INF/MANIFEST.MF META-INF/MANIFEST.MF
tst/AppMain.class tst/App.class
""", content.toString()); """, content.toString());
} finally { } finally {
FileUtils.deleteDirectory(tmp); FileUtils.deleteDirectory(tmp);

File diff suppressed because it is too large Load diff

View file

@ -273,7 +273,7 @@ public class TestJavadocOperation {
var javadoc_operation = new JavadocOperation() var javadoc_operation = new JavadocOperation()
.fromProject(create_operation.project()); .fromProject(create_operation.project());
var main_app_html = new File(new File(javadoc_operation.buildDirectory(), "tst"), "AppMain.html"); var main_app_html = new File(new File(javadoc_operation.buildDirectory(), "tst"), "App.html");
var index_html = new File(javadoc_operation.buildDirectory(), "index.html"); var index_html = new File(javadoc_operation.buildDirectory(), "index.html");
var index_all_html = new File(javadoc_operation.buildDirectory(), "index-all.html"); var index_all_html = new File(javadoc_operation.buildDirectory(), "index-all.html");
assertFalse(main_app_html.exists()); assertFalse(main_app_html.exists());

View file

@ -51,8 +51,8 @@ public class TestPublishOperation {
} }
static class PublishProject extends AppProjectBlueprint { static class PublishProject extends AppProjectBlueprint {
public PublishProject(File work, String packageName, String projectName, VersionNumber versionNumber) { public PublishProject(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
super(work, packageName, projectName, versionNumber); super(work, packageName, projectName, baseName, versionNumber);
javaRelease = 17; javaRelease = 17;
} }
} }
@ -209,7 +209,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 0, 0)); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 0, 0));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)
@ -342,7 +342,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 0, 0)); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 0, 0));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)
@ -419,7 +419,7 @@ public class TestPublishOperation {
// create a first publication // create a first publication
var create_operation1 = new CreateAppOperation() { var create_operation1 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp1) .workDirectory(tmp1)
@ -496,7 +496,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)
@ -589,7 +589,7 @@ public class TestPublishOperation {
// create a first publication // create a first publication
var create_operation1 = new CreateAppOperation() { var create_operation1 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp1) .workDirectory(tmp1)
@ -645,7 +645,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)

View file

@ -184,7 +184,7 @@ public class TestPurgeOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
operation_download2.dependencies().scope(Scope.standalone) operation_download2.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
operation_download2.dependencies().scope(Scope.test) operation_download2.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1))); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
@ -201,21 +201,21 @@ public class TestPurgeOperation {
/dir4 /dir4
/dir4/dir9 /dir4/dir9
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-ee10-servlet-12.0.6.jar /dir4/dir9/jetty-ee10-servlet-12.0.6.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-http-12.0.6.jar /dir4/dir9/jetty-http-12.0.6.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-io-12.0.6.jar /dir4/dir9/jetty-io-12.0.6.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-security-12.0.6.jar /dir4/dir9/jetty-security-12.0.6.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-server-12.0.6.jar /dir4/dir9/jetty-server-12.0.6.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-session-12.0.6.jar /dir4/dir9/jetty-session-12.0.6.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/jetty-util-12.0.6.jar /dir4/dir9/jetty-util-12.0.6.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/dir9/slf4j-api-2.0.9.jar /dir4/dir9/slf4j-api-2.0.9.jar
/dir4/slf4j-simple-2.0.0.jar /dir4/slf4j-simple-2.0.0.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
@ -276,7 +276,7 @@ public class TestPurgeOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
operation_purge.dependencies().scope(Scope.standalone) operation_purge.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
operation_purge.dependencies().scope(Scope.test) operation_purge.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1))); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
@ -291,14 +291,14 @@ public class TestPurgeOperation {
/dir4 /dir4
/dir4/dir9 /dir4/dir9
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
/dir5 /dir5
/dir5/dir10 /dir5/dir10
@ -398,7 +398,7 @@ public class TestPurgeOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
operation_download2.dependencies().scope(Scope.standalone) operation_download2.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
operation_download2.dependencies().scope(Scope.test) operation_download2.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1))); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
@ -425,51 +425,51 @@ public class TestPurgeOperation {
/dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar /dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar /dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-javadoc.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-javadoc.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-sources.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-sources.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-ee10-servlet-12.0.6-javadoc.jar /dir4/dir9/jetty-ee10-servlet-12.0.6-javadoc.jar
/dir4/dir9/jetty-ee10-servlet-12.0.6-sources.jar /dir4/dir9/jetty-ee10-servlet-12.0.6-sources.jar
/dir4/dir9/jetty-ee10-servlet-12.0.6.jar /dir4/dir9/jetty-ee10-servlet-12.0.6.jar
/dir4/dir9/jetty-http-12.0.12-javadoc.jar /dir4/dir9/jetty-http-12.0.16-javadoc.jar
/dir4/dir9/jetty-http-12.0.12-sources.jar /dir4/dir9/jetty-http-12.0.16-sources.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-http-12.0.6-javadoc.jar /dir4/dir9/jetty-http-12.0.6-javadoc.jar
/dir4/dir9/jetty-http-12.0.6-sources.jar /dir4/dir9/jetty-http-12.0.6-sources.jar
/dir4/dir9/jetty-http-12.0.6.jar /dir4/dir9/jetty-http-12.0.6.jar
/dir4/dir9/jetty-io-12.0.12-javadoc.jar /dir4/dir9/jetty-io-12.0.16-javadoc.jar
/dir4/dir9/jetty-io-12.0.12-sources.jar /dir4/dir9/jetty-io-12.0.16-sources.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-io-12.0.6-javadoc.jar /dir4/dir9/jetty-io-12.0.6-javadoc.jar
/dir4/dir9/jetty-io-12.0.6-sources.jar /dir4/dir9/jetty-io-12.0.6-sources.jar
/dir4/dir9/jetty-io-12.0.6.jar /dir4/dir9/jetty-io-12.0.6.jar
/dir4/dir9/jetty-security-12.0.12-javadoc.jar /dir4/dir9/jetty-security-12.0.16-javadoc.jar
/dir4/dir9/jetty-security-12.0.12-sources.jar /dir4/dir9/jetty-security-12.0.16-sources.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-security-12.0.6-javadoc.jar /dir4/dir9/jetty-security-12.0.6-javadoc.jar
/dir4/dir9/jetty-security-12.0.6-sources.jar /dir4/dir9/jetty-security-12.0.6-sources.jar
/dir4/dir9/jetty-security-12.0.6.jar /dir4/dir9/jetty-security-12.0.6.jar
/dir4/dir9/jetty-server-12.0.12-javadoc.jar /dir4/dir9/jetty-server-12.0.16-javadoc.jar
/dir4/dir9/jetty-server-12.0.12-sources.jar /dir4/dir9/jetty-server-12.0.16-sources.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-server-12.0.6-javadoc.jar /dir4/dir9/jetty-server-12.0.6-javadoc.jar
/dir4/dir9/jetty-server-12.0.6-sources.jar /dir4/dir9/jetty-server-12.0.6-sources.jar
/dir4/dir9/jetty-server-12.0.6.jar /dir4/dir9/jetty-server-12.0.6.jar
/dir4/dir9/jetty-session-12.0.12-javadoc.jar /dir4/dir9/jetty-session-12.0.16-javadoc.jar
/dir4/dir9/jetty-session-12.0.12-sources.jar /dir4/dir9/jetty-session-12.0.16-sources.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-session-12.0.6-javadoc.jar /dir4/dir9/jetty-session-12.0.6-javadoc.jar
/dir4/dir9/jetty-session-12.0.6-sources.jar /dir4/dir9/jetty-session-12.0.6-sources.jar
/dir4/dir9/jetty-session-12.0.6.jar /dir4/dir9/jetty-session-12.0.6.jar
/dir4/dir9/jetty-util-12.0.12-javadoc.jar /dir4/dir9/jetty-util-12.0.16-javadoc.jar
/dir4/dir9/jetty-util-12.0.12-sources.jar /dir4/dir9/jetty-util-12.0.16-sources.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/jetty-util-12.0.6-javadoc.jar /dir4/dir9/jetty-util-12.0.6-javadoc.jar
/dir4/dir9/jetty-util-12.0.6-sources.jar /dir4/dir9/jetty-util-12.0.6-sources.jar
/dir4/dir9/jetty-util-12.0.6.jar /dir4/dir9/jetty-util-12.0.6.jar
/dir4/dir9/slf4j-api-2.0.13-javadoc.jar /dir4/dir9/slf4j-api-2.0.16-javadoc.jar
/dir4/dir9/slf4j-api-2.0.13-sources.jar /dir4/dir9/slf4j-api-2.0.16-sources.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/dir9/slf4j-api-2.0.9-javadoc.jar /dir4/dir9/slf4j-api-2.0.9-javadoc.jar
/dir4/dir9/slf4j-api-2.0.9-sources.jar /dir4/dir9/slf4j-api-2.0.9-sources.jar
/dir4/dir9/slf4j-api-2.0.9.jar /dir4/dir9/slf4j-api-2.0.9.jar
@ -590,7 +590,7 @@ public class TestPurgeOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
operation_purge.dependencies().scope(Scope.standalone) operation_purge.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
operation_purge.dependencies().scope(Scope.test) operation_purge.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)).excludeSources().excludeJavadoc()); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)).excludeSources().excludeJavadoc());
@ -611,30 +611,30 @@ public class TestPurgeOperation {
/dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar /dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar /dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-javadoc.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-javadoc.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-sources.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-sources.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-http-12.0.12-javadoc.jar /dir4/dir9/jetty-http-12.0.16-javadoc.jar
/dir4/dir9/jetty-http-12.0.12-sources.jar /dir4/dir9/jetty-http-12.0.16-sources.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-io-12.0.12-javadoc.jar /dir4/dir9/jetty-io-12.0.16-javadoc.jar
/dir4/dir9/jetty-io-12.0.12-sources.jar /dir4/dir9/jetty-io-12.0.16-sources.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-security-12.0.12-javadoc.jar /dir4/dir9/jetty-security-12.0.16-javadoc.jar
/dir4/dir9/jetty-security-12.0.12-sources.jar /dir4/dir9/jetty-security-12.0.16-sources.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-server-12.0.12-javadoc.jar /dir4/dir9/jetty-server-12.0.16-javadoc.jar
/dir4/dir9/jetty-server-12.0.12-sources.jar /dir4/dir9/jetty-server-12.0.16-sources.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-session-12.0.12-javadoc.jar /dir4/dir9/jetty-session-12.0.16-javadoc.jar
/dir4/dir9/jetty-session-12.0.12-sources.jar /dir4/dir9/jetty-session-12.0.16-sources.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-util-12.0.12-javadoc.jar /dir4/dir9/jetty-util-12.0.16-javadoc.jar
/dir4/dir9/jetty-util-12.0.12-sources.jar /dir4/dir9/jetty-util-12.0.16-sources.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/slf4j-api-2.0.13-javadoc.jar /dir4/dir9/slf4j-api-2.0.16-javadoc.jar
/dir4/dir9/slf4j-api-2.0.13-sources.jar /dir4/dir9/slf4j-api-2.0.16-sources.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/slf4j-simple-2.0.6-javadoc.jar /dir4/slf4j-simple-2.0.6-javadoc.jar
/dir4/slf4j-simple-2.0.6-sources.jar /dir4/slf4j-simple-2.0.6-sources.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
@ -695,22 +695,22 @@ public class TestPurgeOperation {
/dir4/dir9 /dir4/dir9
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar /dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12-sources.jar /dir4/dir9/jetty-ee10-servlet-12.0.16-sources.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-http-12.0.12-sources.jar /dir4/dir9/jetty-http-12.0.16-sources.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-io-12.0.12-sources.jar /dir4/dir9/jetty-io-12.0.16-sources.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-security-12.0.12-sources.jar /dir4/dir9/jetty-security-12.0.16-sources.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-server-12.0.12-sources.jar /dir4/dir9/jetty-server-12.0.16-sources.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-session-12.0.12-sources.jar /dir4/dir9/jetty-session-12.0.16-sources.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-util-12.0.12-sources.jar /dir4/dir9/jetty-util-12.0.16-sources.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/slf4j-api-2.0.13-sources.jar /dir4/dir9/slf4j-api-2.0.16-sources.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/slf4j-simple-2.0.6-sources.jar /dir4/slf4j-simple-2.0.6-sources.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
/dir5 /dir5
@ -756,14 +756,14 @@ public class TestPurgeOperation {
/dir4 /dir4
/dir4/dir9 /dir4/dir9
/dir4/dir9/jakarta.servlet-api-6.0.0.jar /dir4/dir9/jakarta.servlet-api-6.0.0.jar
/dir4/dir9/jetty-ee10-servlet-12.0.12.jar /dir4/dir9/jetty-ee10-servlet-12.0.16.jar
/dir4/dir9/jetty-http-12.0.12.jar /dir4/dir9/jetty-http-12.0.16.jar
/dir4/dir9/jetty-io-12.0.12.jar /dir4/dir9/jetty-io-12.0.16.jar
/dir4/dir9/jetty-security-12.0.12.jar /dir4/dir9/jetty-security-12.0.16.jar
/dir4/dir9/jetty-server-12.0.12.jar /dir4/dir9/jetty-server-12.0.16.jar
/dir4/dir9/jetty-session-12.0.12.jar /dir4/dir9/jetty-session-12.0.16.jar
/dir4/dir9/jetty-util-12.0.12.jar /dir4/dir9/jetty-util-12.0.16.jar
/dir4/dir9/slf4j-api-2.0.13.jar /dir4/dir9/slf4j-api-2.0.16.jar
/dir4/slf4j-simple-2.0.6.jar /dir4/slf4j-simple-2.0.6.jar
/dir5 /dir5
/dir5/dir10 /dir5/dir10
@ -836,7 +836,7 @@ public class TestPurgeOperation {
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3))); .include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
project2.dependencies().scope(Scope.standalone) project2.dependencies().scope(Scope.standalone)
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6))) .include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,12))); .include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,16)));
project2.dependencies().scope(Scope.test) project2.dependencies().scope(Scope.test)
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1))) .include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1))); .include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
@ -899,36 +899,36 @@ public class TestPurgeOperation {
/lib/standalone/modules /lib/standalone/modules
/lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar /lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar
/lib/standalone/modules/jakarta.servlet-api-6.0.0.jar /lib/standalone/modules/jakarta.servlet-api-6.0.0.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.12-sources.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.16-sources.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.12.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.16.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.6-sources.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.6-sources.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.6.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.6.jar
/lib/standalone/modules/jetty-http-12.0.12-sources.jar /lib/standalone/modules/jetty-http-12.0.16-sources.jar
/lib/standalone/modules/jetty-http-12.0.12.jar /lib/standalone/modules/jetty-http-12.0.16.jar
/lib/standalone/modules/jetty-http-12.0.6-sources.jar /lib/standalone/modules/jetty-http-12.0.6-sources.jar
/lib/standalone/modules/jetty-http-12.0.6.jar /lib/standalone/modules/jetty-http-12.0.6.jar
/lib/standalone/modules/jetty-io-12.0.12-sources.jar /lib/standalone/modules/jetty-io-12.0.16-sources.jar
/lib/standalone/modules/jetty-io-12.0.12.jar /lib/standalone/modules/jetty-io-12.0.16.jar
/lib/standalone/modules/jetty-io-12.0.6-sources.jar /lib/standalone/modules/jetty-io-12.0.6-sources.jar
/lib/standalone/modules/jetty-io-12.0.6.jar /lib/standalone/modules/jetty-io-12.0.6.jar
/lib/standalone/modules/jetty-security-12.0.12-sources.jar /lib/standalone/modules/jetty-security-12.0.16-sources.jar
/lib/standalone/modules/jetty-security-12.0.12.jar /lib/standalone/modules/jetty-security-12.0.16.jar
/lib/standalone/modules/jetty-security-12.0.6-sources.jar /lib/standalone/modules/jetty-security-12.0.6-sources.jar
/lib/standalone/modules/jetty-security-12.0.6.jar /lib/standalone/modules/jetty-security-12.0.6.jar
/lib/standalone/modules/jetty-server-12.0.12-sources.jar /lib/standalone/modules/jetty-server-12.0.16-sources.jar
/lib/standalone/modules/jetty-server-12.0.12.jar /lib/standalone/modules/jetty-server-12.0.16.jar
/lib/standalone/modules/jetty-server-12.0.6-sources.jar /lib/standalone/modules/jetty-server-12.0.6-sources.jar
/lib/standalone/modules/jetty-server-12.0.6.jar /lib/standalone/modules/jetty-server-12.0.6.jar
/lib/standalone/modules/jetty-session-12.0.12-sources.jar /lib/standalone/modules/jetty-session-12.0.16-sources.jar
/lib/standalone/modules/jetty-session-12.0.12.jar /lib/standalone/modules/jetty-session-12.0.16.jar
/lib/standalone/modules/jetty-session-12.0.6-sources.jar /lib/standalone/modules/jetty-session-12.0.6-sources.jar
/lib/standalone/modules/jetty-session-12.0.6.jar /lib/standalone/modules/jetty-session-12.0.6.jar
/lib/standalone/modules/jetty-util-12.0.12-sources.jar /lib/standalone/modules/jetty-util-12.0.16-sources.jar
/lib/standalone/modules/jetty-util-12.0.12.jar /lib/standalone/modules/jetty-util-12.0.16.jar
/lib/standalone/modules/jetty-util-12.0.6-sources.jar /lib/standalone/modules/jetty-util-12.0.6-sources.jar
/lib/standalone/modules/jetty-util-12.0.6.jar /lib/standalone/modules/jetty-util-12.0.6.jar
/lib/standalone/modules/slf4j-api-2.0.13-sources.jar /lib/standalone/modules/slf4j-api-2.0.16-sources.jar
/lib/standalone/modules/slf4j-api-2.0.13.jar /lib/standalone/modules/slf4j-api-2.0.16.jar
/lib/standalone/modules/slf4j-api-2.0.9-sources.jar /lib/standalone/modules/slf4j-api-2.0.9-sources.jar
/lib/standalone/modules/slf4j-api-2.0.9.jar /lib/standalone/modules/slf4j-api-2.0.9.jar
/lib/standalone/slf4j-simple-2.0.0-sources.jar /lib/standalone/slf4j-simple-2.0.0-sources.jar
@ -1009,22 +1009,22 @@ public class TestPurgeOperation {
/lib/standalone/modules /lib/standalone/modules
/lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar /lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar
/lib/standalone/modules/jakarta.servlet-api-6.0.0.jar /lib/standalone/modules/jakarta.servlet-api-6.0.0.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.12-sources.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.16-sources.jar
/lib/standalone/modules/jetty-ee10-servlet-12.0.12.jar /lib/standalone/modules/jetty-ee10-servlet-12.0.16.jar
/lib/standalone/modules/jetty-http-12.0.12-sources.jar /lib/standalone/modules/jetty-http-12.0.16-sources.jar
/lib/standalone/modules/jetty-http-12.0.12.jar /lib/standalone/modules/jetty-http-12.0.16.jar
/lib/standalone/modules/jetty-io-12.0.12-sources.jar /lib/standalone/modules/jetty-io-12.0.16-sources.jar
/lib/standalone/modules/jetty-io-12.0.12.jar /lib/standalone/modules/jetty-io-12.0.16.jar
/lib/standalone/modules/jetty-security-12.0.12-sources.jar /lib/standalone/modules/jetty-security-12.0.16-sources.jar
/lib/standalone/modules/jetty-security-12.0.12.jar /lib/standalone/modules/jetty-security-12.0.16.jar
/lib/standalone/modules/jetty-server-12.0.12-sources.jar /lib/standalone/modules/jetty-server-12.0.16-sources.jar
/lib/standalone/modules/jetty-server-12.0.12.jar /lib/standalone/modules/jetty-server-12.0.16.jar
/lib/standalone/modules/jetty-session-12.0.12-sources.jar /lib/standalone/modules/jetty-session-12.0.16-sources.jar
/lib/standalone/modules/jetty-session-12.0.12.jar /lib/standalone/modules/jetty-session-12.0.16.jar
/lib/standalone/modules/jetty-util-12.0.12-sources.jar /lib/standalone/modules/jetty-util-12.0.16-sources.jar
/lib/standalone/modules/jetty-util-12.0.12.jar /lib/standalone/modules/jetty-util-12.0.16.jar
/lib/standalone/modules/slf4j-api-2.0.13-sources.jar /lib/standalone/modules/slf4j-api-2.0.16-sources.jar
/lib/standalone/modules/slf4j-api-2.0.13.jar /lib/standalone/modules/slf4j-api-2.0.16.jar
/lib/standalone/slf4j-simple-2.0.6-sources.jar /lib/standalone/slf4j-simple-2.0.6-sources.jar
/lib/standalone/slf4j-simple-2.0.6.jar /lib/standalone/slf4j-simple-2.0.6.jar
/lib/test /lib/test

View file

@ -11,6 +11,7 @@ import rife.tools.FileUtils;
import java.io.File; import java.io.File;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.jar.Attributes; import java.util.jar.Attributes;
@ -24,6 +25,7 @@ public class TestRunOperation {
assertTrue(operation.workDirectory().exists()); assertTrue(operation.workDirectory().exists());
assertTrue(operation.workDirectory().isDirectory()); assertTrue(operation.workDirectory().isDirectory());
assertTrue(operation.workDirectory().canWrite()); assertTrue(operation.workDirectory().canWrite());
assertTrue(operation.environment().isEmpty());
assertEquals("java", operation.javaTool()); assertEquals("java", operation.javaTool());
assertTrue(operation.javaOptions().isEmpty()); assertTrue(operation.javaOptions().isEmpty());
assertTrue(operation.classpath().isEmpty()); assertTrue(operation.classpath().isEmpty());
@ -38,6 +40,8 @@ public class TestRunOperation {
@Test @Test
void testPopulation() void testPopulation()
throws Exception { throws Exception {
var environment = Map.of("env1", "val1", "env2", "val2", "env3", "val3");
var environment_full = Map.of("env1", "val1", "env2", "val2", "env3", "val3", "env4", "val4");
var work_directory = Files.createTempDirectory("test").toFile(); var work_directory = Files.createTempDirectory("test").toFile();
try { try {
var java_tool = "javatool"; var java_tool = "javatool";
@ -55,6 +59,8 @@ public class TestRunOperation {
var operation1 = new RunOperation(); var operation1 = new RunOperation();
operation1 operation1
.workDirectory(work_directory) .workDirectory(work_directory)
.environment(environment)
.environment("env4", "val4")
.javaTool(java_tool) .javaTool(java_tool)
.javaOptions(List.of(run_java_option1, run_java_option2)) .javaOptions(List.of(run_java_option1, run_java_option2))
.classpath(List.of(run_classpath1, run_classpath2)) .classpath(List.of(run_classpath1, run_classpath2))
@ -65,6 +71,7 @@ public class TestRunOperation {
.errorProcessor(run_error_consumer); .errorProcessor(run_error_consumer);
assertEquals(work_directory, operation1.workDirectory()); assertEquals(work_directory, operation1.workDirectory());
assertEquals(environment_full, operation1.environment());
assertEquals(java_tool, operation1.javaTool()); assertEquals(java_tool, operation1.javaTool());
assertTrue(operation1.javaOptions().contains(run_java_option1)); assertTrue(operation1.javaOptions().contains(run_java_option1));
assertTrue(operation1.javaOptions().contains(run_java_option2)); assertTrue(operation1.javaOptions().contains(run_java_option2));
@ -79,6 +86,8 @@ public class TestRunOperation {
var operation2 = new RunOperation(); var operation2 = new RunOperation();
operation2.workDirectory(work_directory); operation2.workDirectory(work_directory);
operation2.environment(environment);
operation2.environment("env4", "val4");
operation2.javaTool(java_tool); operation2.javaTool(java_tool);
operation2.javaOptions().add(run_java_option1); operation2.javaOptions().add(run_java_option1);
operation2.javaOptions().add(run_java_option2); operation2.javaOptions().add(run_java_option2);
@ -92,6 +101,7 @@ public class TestRunOperation {
operation2.errorProcessor(run_error_consumer); operation2.errorProcessor(run_error_consumer);
assertEquals(work_directory, operation2.workDirectory()); assertEquals(work_directory, operation2.workDirectory());
assertEquals(environment_full, operation2.environment());
assertEquals(java_tool, operation2.javaTool()); assertEquals(java_tool, operation2.javaTool());
assertTrue(operation2.javaOptions().contains(run_java_option1)); assertTrue(operation2.javaOptions().contains(run_java_option1));
assertTrue(operation2.javaOptions().contains(run_java_option2)); assertTrue(operation2.javaOptions().contains(run_java_option2));
@ -129,7 +139,7 @@ public class TestRunOperation {
public class Source1 { public class Source1 {
public final String name_; public final String name_;
public Source1() { public Source1() {
name_ = "source1"; name_ = System.getenv("execute_name") + System.getenv("execute_number");
} }
public static void main(String[] arguments) public static void main(String[] arguments)
@ -149,6 +159,8 @@ public class TestRunOperation {
var output = new StringBuilder(); var output = new StringBuilder();
var run_operation = new RunOperation() var run_operation = new RunOperation()
.environment(Map.of("execute_name", "source"))
.environment("execute_number", "1")
.mainClass("Source1") .mainClass("Source1")
.classpath(List.of(build_main.getAbsolutePath())) .classpath(List.of(build_main.getAbsolutePath()))
.outputProcessor(s -> { .outputProcessor(s -> {
@ -179,7 +191,7 @@ public class TestRunOperation {
public class Source1 { public class Source1 {
public final String name_; public final String name_;
public Source1() { public Source1() {
name_ = "source1"; name_ = System.getenv("execute_name") + System.getenv("execute_number");
} }
public static void main(String[] arguments) public static void main(String[] arguments)
@ -214,6 +226,8 @@ public class TestRunOperation {
var output = new StringBuilder(); var output = new StringBuilder();
var run_operation = new RunOperation() var run_operation = new RunOperation()
.environment(Map.of("execute_name", "source"))
.environment("execute_number", "1")
.module("pkg") .module("pkg")
.modulePath(new File(destination_dir, destination_name).getAbsolutePath()) .modulePath(new File(destination_dir, destination_name).getAbsolutePath())
.outputProcessor(s -> { .outputProcessor(s -> {

View file

@ -174,7 +174,7 @@ public class TestUberJarOperation {
assertThrows(ExitStatusException.class, run_operation::execute); assertThrows(ExitStatusException.class, run_operation::execute);
Thread.sleep(2000); Thread.sleep(2000);
assertTrue(check_result.toString().contains("<p>Hello World App</p>")); assertTrue(check_result.toString().contains("<p>Hello World app</p>"));
} finally { } finally {
FileUtils.deleteDirectory(tmp); FileUtils.deleteDirectory(tmp);
} }