[
  {
    "path": ".claude/settings.json",
    "content": "{\n  \"permissions\": {\n    \"allow\": [\n      \"Bash(./gradlew:*)\",\n      \"Bash(cat:*)\",\n      \"Bash(echo:*)\",\n      \"Bash(find:*)\",\n      \"Bash(gh:*)\",\n      \"Bash(git:*)\",\n      \"Bash(grep:*)\",\n      \"Bash(javac:*)\",\n      \"Bash(mv:*)\",\n      \"Bash(npm test:*)\",\n      \"Bash(rg:*)\",\n      \"Bash(rm:*)\",\n      \"Bash(timeout:*)\",\n      \"WebFetch(domain:github.com)\",\n      \"mcp__github__get_issue\",\n      \"mcp__github__get_issue_comments\",\n      \"mcp__github__get_pull_request\",\n      \"mcp__github__get_pull_request_comments\",\n      \"mcp__idea__find_files_by_name_substring\",\n      \"mcp__idea__get_file_text_by_path\",\n      \"mcp__idea__get_open_in_editor_file_path\",\n      \"mcp__idea__get_open_in_editor_file_text\",\n      \"mcp__idea__get_selected_in_editor_text\",\n      \"mcp__idea__list_directory_tree_in_folder\",\n      \"mcp__idea__list_files_in_folder\",\n      \"mcp__idea__open_file_in_editor\",\n      \"mcp__idea__replace_selected_text\",\n      \"mcp__idea__replace_specific_text\",\n      \"mcp__idea__search_in_files_content\"\n    ],\n    \"deny\": []\n  }\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[src/test*/java/**.java]\nindent_size = 4\nij_continuation_indent_size = 2\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "---\nversion: 2\nupdates:\n  - package-ecosystem: github-actions\n    directory: /\n    schedule:\n      interval: weekly\n    commit-message:\n      prefix: \"chore(ci)\"\n  - package-ecosystem: maven\n    directory: /\n    schedule:\n      interval: weekly\n    commit-message:\n      prefix: \"chore(ci)\"\n    ignore:\n      - dependency-name: \"com.puppycrawl.tools:checkstyle\"\n"
  },
  {
    "path": ".github/workflows/bump-snapshots.yml",
    "content": "---\nname: bump-snapshots\n\non:\n  workflow_dispatch: {}\n  schedule:\n    - cron: 0 11 * * THU\n\njobs:\n  bump-snapshots:\n    timeout-minutes: 30\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: 0\n      - uses: actions/setup-java@v5\n        with:\n          distribution: temurin\n          java-version: 17\n          cache: maven\n          server-id: ossrh\n          settings-path: ${{ github.workspace }}\n      - name: configure-git-user\n        run: |\n          git config user.email \"team@moderne.io\"\n          git config user.name \"team-moderne[bot]\"\n\n      - name: bump-rewrite-properties-to-snapshots\n        run: |\n          ./mvnw versions:update-properties -DincludeProperties=rewrite.version,rewrite-polyglot.version -DallowSnapshots=true\n          git diff-index --quiet HEAD pom.xml || (git commit -m \"Bump rewrite.version property\" pom.xml && git push origin main)\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "---\nname: ci\n\non:\n  push:\n    branches:\n      - main\n    tags-ignore:\n      - \"*\"\n  pull_request:\n    branches:\n      - main\n  workflow_dispatch: {}\n  schedule:\n    - cron: 0 17 * * *\n\nconcurrency:\n  group: ci-${{ github.ref }}\n  cancel-in-progress: true\n\nenv:\n  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.gradle_enterprise_cache_username }}\n  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.gradle_enterprise_cache_password }}\n  DEVELOCITY_ACCESS_KEY: ${{ secrets.gradle_enterprise_access_key }}\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    timeout-minutes: 30\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-java@v5\n        with:\n          distribution: temurin\n          java-version: 17\n          cache: maven\n          server-id: ossrh\n          settings-path: ${{ github.workspace }}\n          server-username: SONATYPE_USERNAME\n          server-password: SONATYPE_PASSWORD\n          gpg-private-key: ${{ secrets.OSSRH_SIGNING_KEY }}\n          gpg-passphrase: SONATYPE_SIGNING_PASSWORD\n      - name: validate-develocity-access-key\n        run: |\n          if [ -n \"$DEVELOCITY_ACCESS_KEY\" ] && ! echo \"$DEVELOCITY_ACCESS_KEY\" | grep -q '='; then\n            echo \"DEVELOCITY_ACCESS_KEY is malformed (missing server-host= prefix), unsetting\"\n            echo \"DEVELOCITY_ACCESS_KEY=\" >> $GITHUB_ENV\n          fi\n      - name: build\n        run: ./mvnw --show-version --no-transfer-progress --update-snapshots clean verify --file=pom.xml --fail-at-end --batch-mode -Dstyle.color=always\n      - name: publish-snapshots\n        if: github.event_name != 'pull_request'\n        run: ./mvnw --show-version --no-transfer-progress --settings=${{ github.workspace }}/settings.xml --file=pom.xml --batch-mode -Dstyle.color=always --activate-profiles=sign-artifacts clean deploy -DskipTests\n        env:\n          GITHUB_TOKEN: ${{ github.token }}\n          SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}\n          SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}\n          SONATYPE_SIGNING_PASSWORD: ${{ secrets.OSSRH_SIGNING_PASSWORD }}\n      - name: slack-notification\n        if: failure() && github.event_name == 'schedule' && (github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc')\n        uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661\n        continue-on-error: true\n        env:\n          SLACK_WEBHOOK: ${{ secrets.OPS_GITHUB_ACTIONS_WEBHOOK }}\n          MSG_MINIMAL: true\n          SLACK_MESSAGE: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n          SLACK_USERNAME: ${{ github.repository }} CI failure\n          SLACK_COLOR: failure\n          SLACK_FOOTER: ''\n"
  },
  {
    "path": ".github/workflows/pages.yml",
    "content": "# Simple workflow for deploying static content to GitHub Pages\nname: Deploy plugin docs to Pages\n\non:\n  push:\n    tags:\n      - v*\n  workflow_dispatch: {}\n  workflow_run:\n    workflows: [\"publish\"]\n    types:\n      - completed\n\n# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages\npermissions:\n  contents: read\n  pages: write\n  id-token: write\n\n# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.\n# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.\nconcurrency:\n  group: \"pages\"\n  cancel-in-progress: false\n\njobs:\n  pages:\n    environment:\n      name: github-pages\n      url: ${{steps.deployment.outputs.page_url}}\n    runs-on: ubuntu-latest\n    timeout-minutes: 30\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-java@v5\n        with:\n          distribution: temurin\n          java-version: 17\n          cache: maven\n      - name: site\n        run: ./mvnw --show-version --no-transfer-progress --update-snapshots clean site --file=pom.xml --fail-at-end --batch-mode -Dstyle.color=always -Ddependency-check.skip=true\n      - uses: actions/configure-pages@v6\n      - uses: actions/upload-pages-artifact@v5\n        with:\n          path: target/site\n      - uses: actions/deploy-pages@v5\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "---\nname: publish\n\non:\n  workflow_dispatch:\n    inputs:\n      version:\n        description: 'Project version to set before releasing (e.g. 6.33.0-SNAPSHOT). Leave empty to release the current version.'\n        required: false\n        type: string\n\njobs:\n  release:\n    runs-on: ubuntu-latest\n    timeout-minutes: 30\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: 0\n      - uses: actions/setup-java@v5\n        with:\n          distribution: temurin\n          java-version: 17\n          cache: maven\n          server-id: ossrh\n          settings-path: ${{ github.workspace }}\n          server-username: SONATYPE_USERNAME\n          server-password: SONATYPE_PASSWORD\n          gpg-private-key: ${{ secrets.OSSRH_SIGNING_KEY }}\n          gpg-passphrase: SONATYPE_SIGNING_PASSWORD\n      - name: configure-git-user\n        run: |\n          git config user.email \"team@moderne.io\"\n          git config user.name \"team-moderne[bot]\"\n\n      - name: set-project-version\n        if: ${{ inputs.version != '' }}\n        run: ./mvnw versions:set -DnewVersion=${{ inputs.version }} -DgenerateBackupFiles=false\n\n      - name: bump-rewrite-properties-to-releases\n        run: |\n          ./mvnw versions:update-properties -DincludeProperties=rewrite.version,rewrite-polyglot.version -DallowDowngrade=true\n          git diff-index --quiet HEAD pom.xml || git commit -m \"Bump rewrite.version property\" pom.xml && rm -f pom.xml.versionsBackup\n\n      - name: publish-release\n        run: ./mvnw --show-version --settings=${{ github.workspace }}/settings.xml --file=pom.xml --activate-profiles=sign-artifacts,release,release-automation help:active-profiles release:prepare release:perform --batch-mode -Dstyle.color=always\n        env:\n          GITHUB_TOKEN: ${{ github.token }}\n          SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}\n          SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}\n          SONATYPE_SIGNING_PASSWORD: ${{ secrets.OSSRH_SIGNING_PASSWORD }}\n\n      - name: github-release\n        if: ${{ success() }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: |\n          export tag=$(git describe --tags --abbrev=0)\n          gh release create \"$tag\" \\\n              --repo=\"$GITHUB_REPOSITORY\" \\\n              --title=\"${tag#v}\" \\\n              --generate-notes\n\n      - name: rollback\n        if: ${{ failure() }}\n        run: ./mvnw --show-version --settings=${{github.workspace}}/settings.xml --file=pom.xml --activate-profiles=sign-artifacts,release,release-automation help:active-profiles release:rollback --batch-mode -Dstyle.color=always\n        env:\n          GITHUB_TOKEN: ${{ github.token }}\n\n      - name: bump-rewrite-properties-to-snapshots\n        run: |\n          ./mvnw versions:update-properties -DincludeProperties=rewrite.version,rewrite-polyglot.version -DallowSnapshots=true\n          git diff-index --quiet HEAD pom.xml || (git commit -m \"Bump rewrite.version property\" pom.xml && git push origin main && rm -f pom.xml.versionsBackup)\n"
  },
  {
    "path": ".github/workflows/repository-backup.yml",
    "content": "---\nname: repository-backup\non:\n  workflow_dispatch: {}\n  schedule:\n    - cron: 0 17 * * *\n\nconcurrency:\n  group: backup-${{ github.ref }}\n  cancel-in-progress: false\n\njobs:\n  repository-backup:\n    uses: openrewrite/gh-automation/.github/workflows/repository-backup.yml@main\n    secrets:\n      bucket_mirror_target: ${{ secrets.S3_GITHUB_REPOSITORY_BACKUPS_BUCKET_NAME }}\n      bucket_access_key_id: ${{ secrets.S3_GITHUB_REPOSITORY_BACKUPS_ACCESS_KEY_ID }}\n      bucket_secret_access_key: ${{ secrets.S3_GITHUB_REPOSITORY_BACKUPS_SECRET_ACCESS_KEY }}\n"
  },
  {
    "path": ".github/workflows/stale.yml",
    "content": "---\nname: stale\n\non:\n  workflow_dispatch: {}\n  schedule:\n    - cron: 36 4 * * 1\n\njobs:\n  build:\n    uses: openrewrite/gh-automation/.github/workflows/stale.yml@main\n"
  },
  {
    "path": ".gitignore",
    "content": "build/\ntarget/\nry/\nrelease.properties\npom.xml.releaseBackup\npom.xml.versionsBackup\n.idea/\n*.iml\n.classpath\n.project\n.settings\n.vscode/\n.mvn/.develocity/\n\n# Moderne CLI\n.moderne/*\n!.moderne/context/\n"
  },
  {
    "path": ".mvn/develocity.xml",
    "content": "<develocity>\n  <server>\n    <url>https://ge.openrewrite.org/</url>\n  </server>\n  <buildScan>\n    <publishing>\n      <onlyIf><![CDATA[!buildResult.failures.empty]]></onlyIf>\n    </publishing>\n    <capture>\n      <fileFingerprints>true</fileFingerprints>\n    </capture>\n  </buildScan>\n  <buildCache>\n    <local>\n      <storeEnabled>true</storeEnabled>\n    </local>\n    <remote>\n      <storeEnabled>#{isTrue(env['CI'])}</storeEnabled>\n      <server>\n        <credentials>\n          <username>#{env['GRADLE_ENTERPRISE_CACHE_USERNAME']}</username>\n          <password>#{env['GRADLE_ENTERPRISE_CACHE_PASSWORD']}</password>\n        </credentials>\n      </server>\n    </remote>\n  </buildCache>\n</develocity>\n"
  },
  {
    "path": ".mvn/extensions.xml",
    "content": "<extensions>\n  <extension>\n    <groupId>com.gradle</groupId>\n    <artifactId>develocity-maven-extension</artifactId>\n    <version>2.2.1</version>\n  </extension>\n</extensions>\n"
  },
  {
    "path": ".mvn/licenseHeader.txt",
    "content": "Copyright ${year} the original author or authors.\n<p>\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n<p>\nhttps://www.apache.org/licenses/LICENSE-2.0\n<p>\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": ".mvn/wrapper/maven-wrapper.properties",
    "content": "wrapperVersion=3.3.2\ndistributionType=only-script\ndistributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip\n"
  },
  {
    "path": ".sdkmanrc",
    "content": "# Enable auto-env through the sdkman_auto_env config\n# Add key=value pairs of SDKs to use below\njava=21.0.10-tem\n"
  },
  {
    "path": "CLAUDE.md",
    "content": "<!-- prethink-context -->\n## Moderne Prethink Context\n\nThis repository contains pre-analyzed context generated by [Moderne Prethink](https://docs.moderne.io/user-documentation/recipes/prethink). Prethink extracts structured knowledge from codebases to help you work more effectively. The context files in `.moderne/context/` contain analyzed information about this codebase.\n\n**IMPORTANT: Before exploring source code for architecture, dependency, or data flow questions:**\n1. ALWAYS check `.moderne/context/` files FIRST\n2. Do NOT perform broad codebase exploration (e.g., spawning Explore agents, searching multiple source files) unless CSV context is insufficient\n3. NEVER read entire CSV files - use SQL queries to retrieve only the rows you need\n\n**IMPORTANT: Prethink context is cheap to read — source code exploration is expensive. Always read MORE prethink context rather than less. The \"do not explore broadly\" rule applies to source code, NOT to prethink context files.**\n\nFor cross-cutting questions (data flow, deletion, dependencies between services),\nALWAYS query these context files in parallel on the first turn:\n- `architecture.md` — system diagram and component overview\n- `data-assets.csv` — entity fields and data model\n- `database-connections.csv` — which services own which tables\n- `service-endpoints.csv` — relevant API endpoints\n- `messaging-connections.csv` — Kafka/async event flows\n- `external-service-calls.csv` — cross-service HTTP calls\n\nDo NOT stop after reading a single context file when others are clearly relevant.\n\n### Available Context\n\n| Context | Description | Details |\n|---------|-------------|--------|\n| Architecture | FINOS CALM architecture diagram | [`architecture.md`](.moderne/context/architecture.md) |\n| Class Quality Metrics | Per-class cohesion, coupling, and complexity measurements | [`class-quality-metrics.md`](.moderne/context/class-quality-metrics.md) |\n| Code Smells | Detected design problems with severity and evidence | [`code-smells.md`](.moderne/context/code-smells.md) |\n| Coding Conventions | Naming patterns, import organization, and coding style | [`coding-conventions.md`](.moderne/context/coding-conventions.md) |\n| Dependencies | Project dependencies including transitive dependencies | [`dependencies.md`](.moderne/context/dependencies.md) |\n| Error Handling | Exception handling strategies and logging patterns | [`error-handling.md`](.moderne/context/error-handling.md) |\n| Method Quality Metrics | Per-method complexity and quality measurements | [`method-quality-metrics.md`](.moderne/context/method-quality-metrics.md) |\n| Package Quality Metrics | Per-package coupling, stability, and dependency cycle analysis | [`package-quality-metrics.md`](.moderne/context/package-quality-metrics.md) |\n| Project Identity | Build system coordinates, names, and module structure | [`project-identity.md`](.moderne/context/project-identity.md) |\n| Test Coverage | Maps test methods to implementation methods they verify | [`test-coverage.md`](.moderne/context/test-coverage.md) |\n| Test Gaps | Public non-trivial methods lacking test coverage | [`test-gaps.md`](.moderne/context/test-gaps.md) |\n| Test Quality | Test quality issues that may cause flakiness or silent failures | [`test-quality.md`](.moderne/context/test-quality.md) |\n| Token Estimates | Estimated input tokens for method comprehension | [`token-estimates.md`](.moderne/context/token-estimates.md) |\n\n### Querying Context Files\n\nFor .md context files: Read the full file in a single view call. Never grep it progressively.\n\nFor .csv context files: Query with DuckDB, SQLite, or grep (from most to least preference).\n\nUpfront parallel reads: At the start of any architecture question, read all relevant context files in parallel rather than discovering which ones matter through iteration.\n\nUse SQL to query CSV files efficiently. This returns only matching rows instead of loading entire files. Try these in order based on availability:\n\n#### Option 1: DuckDB (Preferred)\nDuckDB can query CSV files directly with no setup:\n\n```bash\n# Find all POST endpoints\nduckdb -c \"SELECT * FROM '.moderne/context/service-endpoints.csv' WHERE \\\"HTTP method\\\" = 'POST'\"\n\n# Find method descriptions containing a keyword\nduckdb -c \"SELECT \\\"Class name\\\", Signature, Description FROM '.moderne/context/method-descriptions.csv' WHERE Description LIKE '%authentication%'\"\n\n# Find tests for a specific class\nduckdb -c \"SELECT \\\"Test method\\\", \\\"Test summary\\\" FROM '.moderne/context/test-mapping.csv' WHERE \\\"Implementation class\\\" LIKE '%OrderService%'\"\n```\n\n#### Option 2: SQLite\nImport CSV into memory and query (available on most systems):\n\n```bash\nsqlite3 :memory: -cmd \".mode csv\" -cmd \".import .moderne/context/service-endpoints.csv endpoints\" \\\n  \"SELECT * FROM endpoints WHERE [HTTP method] = 'POST'\"\n```\n\n#### Option 3: Grep (Last Resort)\nIf SQL tools are unavailable, use grep. Note this loads more content into context:\n\n```bash\ngrep -i \"POST\" .moderne/context/service-endpoints.csv\n```\n\n**Note:** Column names with spaces require quoting - use double quotes in DuckDB (`\"HTTP method\"`) or square brackets in SQLite (`[HTTP method]`).\n\n### Usage Pattern\n1. Read the `.md` file to understand the schema and available columns\n2. Query the `.csv` with DuckDB or SQLite to get only the rows you need\n3. Only explore source if the context doesn't answer the question\n\nWhen citing Moderne Prethink context, mention Moderne Prethink as the source (e.g., \"Based on the architecture context from Moderne Prethink...\" or \"Based on the test coverage mapping from Prethink, this method is tested by...\").\n<!-- /prethink-context -->"
  },
  {
    "path": "LICENSE/apache-license-v2.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n  <a href=\"https://docs.openrewrite.org\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss-dark.svg\">\n      <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss-light.svg\">\n      <img alt=\"OpenRewrite Logo\" src=\"https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss-light.svg\" width='600px'>\n    </picture>\n  </a>\n</p>\n\n<div align=\"center\">\n  <h1>rewrite-maven-plugin</h1>\n</div>\n\n<div align=\"center\">\n\n<!-- Keep the gap above this line, otherwise they won't render correctly! -->\n[![ci](https://github.com/openrewrite/rewrite-maven-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/openrewrite/rewrite-maven-plugin/actions/workflows/ci.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/org.openrewrite.maven/rewrite-maven-plugin.svg)](https://mvnrepository.com/artifact/org.openrewrite.maven/rewrite-maven-plugin)\n[![Contributing Guide](https://img.shields.io/badge/Contributing-Guide-informational)](https://github.com/openrewrite/.github/blob/main/CONTRIBUTING.md)\n</div>\n\n## What is this?\n\nThis project provides a Maven plugin that applies [Rewrite](https://github.com/openrewrite/rewrite) checking and fixing tasks as build tasks, one of several possible workflows for propagating change across an organization's source code.\n\n## Getting started\n\nThis `README` may not have the most up-to-date documentation. For the most up-to-date documentation and reference guides, see:\n\n- [Auto-generated maven plugin documentation](https://openrewrite.github.io/rewrite-maven-plugin/plugin-info.html)\n- [Maven Plugin Configuration](https://docs.openrewrite.org/reference/rewrite-maven-plugin)\n- [OpenRewrite Quickstart Guide](https://docs.openrewrite.org/running-recipes/getting-started)\n\nTo configure, add the plugin to your POM:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\n    ...\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.openrewrite.maven</groupId>\n                <artifactId>rewrite-maven-plugin</artifactId>\n                <version><!-- latest version here --></version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n```\n\nIf wanting to leverage recipes from other dependencies:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\n    ...\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.openrewrite.maven</groupId>\n                <artifactId>rewrite-maven-plugin</artifactId>\n                <version><!-- latest version here --></version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe>\n                        <recipe>org.openrewrite.github.ActionsSetupJavaAdoptOpenJDKToTemurin</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-testing-frameworks</artifactId>\n                        <version><!-- latest dependency version here --></version>\n                    </dependency>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-github-actions</artifactId>\n                        <version><!-- latest dependency version here --></version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n```\n\nTo get started, try `mvn rewrite:help`, `mvn rewrite:discover`, `mvn rewrite:dryRun`, `mvn rewrite:run`, among other plugin goals.\n\nSee the [Maven Plugin Configuration](https://docs.openrewrite.org/reference/rewrite-maven-plugin) documentation for full configuration and usage options.\n\n### Snapshots\n\nTo use the latest `-SNAPSHOT` version, add a `<pluginRepositories>` entry for OSSRH snapshots. For example:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\n    ...\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.openrewrite.maven</groupId>\n                <artifactId>rewrite-maven-plugin</artifactId>\n                <!-- Use whichever version is latest at the time of reading. This number is a placeholder. -->\n                <version>4.17.0-SNAPSHOT</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.logging.slf4j.Log4j2ToSlf4j</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-testing-frameworks</artifactId>\n                        <!-- Use whichever version is latest at the time of reading. This number is a placeholder. -->\n                        <version>1.1.0-SNAPSHOT</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n\n    <pluginRepositories>\n        <pluginRepository>\n            <id>ossrh-snapshots</id>\n            <url>https://central.sonatype.com/repository/maven-snapshots</url>\n        </pluginRepository>\n    </pluginRepositories>\n\n</project>\n```\n\n## Notes for developing and testing this plugin\n\nThis plugin uses the [`Maven Integration Testing Framework Extension`](https://github.com/khmarbaise/maven-it-extension) for tests.\n\nAll tests can be run from the command line using:\n\n```sh\n./mvnw verify\n```\n\nIf you're looking for more information on the output from a test, try checking the `target/maven-it/**/*IT/**` directory contents after running the tests. It will contain the project state output, including maven logs, etc. Check the [`Integration Testing Framework Users Guide`](https://khmarbaise.github.io/maven-it-extension/itf-documentation/usersguide/usersguide.html) for information, too. It's good.\n\n## Contributing\n\nWe appreciate all types of contributions. See the [contributing guide](https://github.com/openrewrite/.github/blob/main/CONTRIBUTING.md) for detailed instructions on how to get started.\n\n### Resource guides\n\n- https://blog.soebes.io/posts/2020/08/2020-08-17-itf-part-i/\n- https://carlosvin.github.io/posts/creating-custom-maven-plugin/en/#_dependency_injection\n- https://developer.okta.com/blog/2019/09/23/tutorial-build-a-maven-plugin\n- https://medium.com/swlh/step-by-step-guide-to-developing-a-custom-maven-plugin-b6e3a0e09966\n"
  },
  {
    "path": "mvnw",
    "content": "#!/bin/sh\n# ----------------------------------------------------------------------------\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n# ----------------------------------------------------------------------------\n\n# ----------------------------------------------------------------------------\n# Apache Maven Wrapper startup batch script, version 3.3.2\n#\n# Optional ENV vars\n# -----------------\n#   JAVA_HOME - location of a JDK home dir, required when download maven via java source\n#   MVNW_REPOURL - repo url base for downloading maven distribution\n#   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven\n#   MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output\n# ----------------------------------------------------------------------------\n\nset -euf\n[ \"${MVNW_VERBOSE-}\" != debug ] || set -x\n\n# OS specific support.\nnative_path() { printf %s\\\\n \"$1\"; }\ncase \"$(uname)\" in\nCYGWIN* | MINGW*)\n  [ -z \"${JAVA_HOME-}\" ] || JAVA_HOME=\"$(cygpath --unix \"$JAVA_HOME\")\"\n  native_path() { cygpath --path --windows \"$1\"; }\n  ;;\nesac\n\n# set JAVACMD and JAVACCMD\nset_java_home() {\n  # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched\n  if [ -n \"${JAVA_HOME-}\" ]; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ]; then\n      # IBM's JDK on AIX uses strange locations for the executables\n      JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n      JAVACCMD=\"$JAVA_HOME/jre/sh/javac\"\n    else\n      JAVACMD=\"$JAVA_HOME/bin/java\"\n      JAVACCMD=\"$JAVA_HOME/bin/javac\"\n\n      if [ ! -x \"$JAVACMD\" ] || [ ! -x \"$JAVACCMD\" ]; then\n        echo \"The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run.\" >&2\n        echo \"JAVA_HOME is set to \\\"$JAVA_HOME\\\", but \\\"\\$JAVA_HOME/bin/java\\\" or \\\"\\$JAVA_HOME/bin/javac\\\" does not exist.\" >&2\n        return 1\n      fi\n    fi\n  else\n    JAVACMD=\"$(\n      'set' +e\n      'unset' -f command 2>/dev/null\n      'command' -v java\n    )\" || :\n    JAVACCMD=\"$(\n      'set' +e\n      'unset' -f command 2>/dev/null\n      'command' -v javac\n    )\" || :\n\n    if [ ! -x \"${JAVACMD-}\" ] || [ ! -x \"${JAVACCMD-}\" ]; then\n      echo \"The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run.\" >&2\n      return 1\n    fi\n  fi\n}\n\n# hash string like Java String::hashCode\nhash_string() {\n  str=\"${1:-}\" h=0\n  while [ -n \"$str\" ]; do\n    char=\"${str%\"${str#?}\"}\"\n    h=$(((h * 31 + $(LC_CTYPE=C printf %d \"'$char\")) % 4294967296))\n    str=\"${str#?}\"\n  done\n  printf %x\\\\n $h\n}\n\nverbose() { :; }\n[ \"${MVNW_VERBOSE-}\" != true ] || verbose() { printf %s\\\\n \"${1-}\"; }\n\ndie() {\n  printf %s\\\\n \"$1\" >&2\n  exit 1\n}\n\ntrim() {\n  # MWRAPPER-139:\n  #   Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.\n  #   Needed for removing poorly interpreted newline sequences when running in more\n  #   exotic environments such as mingw bash on Windows.\n  printf \"%s\" \"${1}\" | tr -d '[:space:]'\n}\n\n# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties\nwhile IFS=\"=\" read -r key value; do\n  case \"${key-}\" in\n  distributionUrl) distributionUrl=$(trim \"${value-}\") ;;\n  distributionSha256Sum) distributionSha256Sum=$(trim \"${value-}\") ;;\n  esac\ndone <\"${0%/*}/.mvn/wrapper/maven-wrapper.properties\"\n[ -n \"${distributionUrl-}\" ] || die \"cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties\"\n\ncase \"${distributionUrl##*/}\" in\nmaven-mvnd-*bin.*)\n  MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/\n  case \"${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)\" in\n  *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;\n  :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;\n  :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;\n  :Linux*x86_64*) distributionPlatform=linux-amd64 ;;\n  *)\n    echo \"Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version\" >&2\n    distributionPlatform=linux-amd64\n    ;;\n  esac\n  distributionUrl=\"${distributionUrl%-bin.*}-$distributionPlatform.zip\"\n  ;;\nmaven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;\n*) MVN_CMD=\"mvn${0##*/mvnw}\" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;\nesac\n\n# apply MVNW_REPOURL and calculate MAVEN_HOME\n# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>\n[ -z \"${MVNW_REPOURL-}\" ] || distributionUrl=\"$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*\"$_MVNW_REPO_PATTERN\"}\"\ndistributionUrlName=\"${distributionUrl##*/}\"\ndistributionUrlNameMain=\"${distributionUrlName%.*}\"\ndistributionUrlNameMain=\"${distributionUrlNameMain%-bin}\"\nMAVEN_USER_HOME=\"${MAVEN_USER_HOME:-${HOME}/.m2}\"\nMAVEN_HOME=\"${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string \"$distributionUrl\")\"\n\nexec_maven() {\n  unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :\n  exec \"$MAVEN_HOME/bin/$MVN_CMD\" \"$@\" || die \"cannot exec $MAVEN_HOME/bin/$MVN_CMD\"\n}\n\nif [ -d \"$MAVEN_HOME\" ]; then\n  verbose \"found existing MAVEN_HOME at $MAVEN_HOME\"\n  exec_maven \"$@\"\nfi\n\ncase \"${distributionUrl-}\" in\n*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;\n*) die \"distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'\" ;;\nesac\n\n# prepare tmp dir\nif TMP_DOWNLOAD_DIR=\"$(mktemp -d)\" && [ -d \"$TMP_DOWNLOAD_DIR\" ]; then\n  clean() { rm -rf -- \"$TMP_DOWNLOAD_DIR\"; }\n  trap clean HUP INT TERM EXIT\nelse\n  die \"cannot create temp dir\"\nfi\n\nmkdir -p -- \"${MAVEN_HOME%/*}\"\n\n# Download and Install Apache Maven\nverbose \"Couldn't find MAVEN_HOME, downloading and installing it ...\"\nverbose \"Downloading from: $distributionUrl\"\nverbose \"Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName\"\n\n# select .zip or .tar.gz\nif ! command -v unzip >/dev/null; then\n  distributionUrl=\"${distributionUrl%.zip}.tar.gz\"\n  distributionUrlName=\"${distributionUrl##*/}\"\nfi\n\n# verbose opt\n__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''\n[ \"${MVNW_VERBOSE-}\" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v\n\n# normalize http auth\ncase \"${MVNW_PASSWORD:+has-password}\" in\n'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;\nhas-password) [ -n \"${MVNW_USERNAME-}\" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;\nesac\n\nif [ -z \"${MVNW_USERNAME-}\" ] && command -v wget >/dev/null; then\n  verbose \"Found wget ... using wget\"\n  wget ${__MVNW_QUIET_WGET:+\"$__MVNW_QUIET_WGET\"} \"$distributionUrl\" -O \"$TMP_DOWNLOAD_DIR/$distributionUrlName\" || die \"wget: Failed to fetch $distributionUrl\"\nelif [ -z \"${MVNW_USERNAME-}\" ] && command -v curl >/dev/null; then\n  verbose \"Found curl ... using curl\"\n  curl ${__MVNW_QUIET_CURL:+\"$__MVNW_QUIET_CURL\"} -f -L -o \"$TMP_DOWNLOAD_DIR/$distributionUrlName\" \"$distributionUrl\" || die \"curl: Failed to fetch $distributionUrl\"\nelif set_java_home; then\n  verbose \"Falling back to use Java to download\"\n  javaSource=\"$TMP_DOWNLOAD_DIR/Downloader.java\"\n  targetZip=\"$TMP_DOWNLOAD_DIR/$distributionUrlName\"\n  cat >\"$javaSource\" <<-END\n\tpublic class Downloader extends java.net.Authenticator\n\t{\n\t  protected java.net.PasswordAuthentication getPasswordAuthentication()\n\t  {\n\t    return new java.net.PasswordAuthentication( System.getenv( \"MVNW_USERNAME\" ), System.getenv( \"MVNW_PASSWORD\" ).toCharArray() );\n\t  }\n\t  public static void main( String[] args ) throws Exception\n\t  {\n\t    setDefault( new Downloader() );\n\t    java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );\n\t  }\n\t}\n\tEND\n  # For Cygwin/MinGW, switch paths to Windows format before running javac and java\n  verbose \" - Compiling Downloader.java ...\"\n  \"$(native_path \"$JAVACCMD\")\" \"$(native_path \"$javaSource\")\" || die \"Failed to compile Downloader.java\"\n  verbose \" - Running Downloader.java ...\"\n  \"$(native_path \"$JAVACMD\")\" -cp \"$(native_path \"$TMP_DOWNLOAD_DIR\")\" Downloader \"$distributionUrl\" \"$(native_path \"$targetZip\")\"\nfi\n\n# If specified, validate the SHA-256 sum of the Maven distribution zip file\nif [ -n \"${distributionSha256Sum-}\" ]; then\n  distributionSha256Result=false\n  if [ \"$MVN_CMD\" = mvnd.sh ]; then\n    echo \"Checksum validation is not supported for maven-mvnd.\" >&2\n    echo \"Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties.\" >&2\n    exit 1\n  elif command -v sha256sum >/dev/null; then\n    if echo \"$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName\" | sha256sum -c >/dev/null 2>&1; then\n      distributionSha256Result=true\n    fi\n  elif command -v shasum >/dev/null; then\n    if echo \"$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName\" | shasum -a 256 -c >/dev/null 2>&1; then\n      distributionSha256Result=true\n    fi\n  else\n    echo \"Checksum validation was requested but neither 'sha256sum' or 'shasum' are available.\" >&2\n    echo \"Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties.\" >&2\n    exit 1\n  fi\n  if [ $distributionSha256Result = false ]; then\n    echo \"Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised.\" >&2\n    echo \"If you updated your Maven version, you need to update the specified distributionSha256Sum property.\" >&2\n    exit 1\n  fi\nfi\n\n# unzip and move\nif command -v unzip >/dev/null; then\n  unzip ${__MVNW_QUIET_UNZIP:+\"$__MVNW_QUIET_UNZIP\"} \"$TMP_DOWNLOAD_DIR/$distributionUrlName\" -d \"$TMP_DOWNLOAD_DIR\" || die \"failed to unzip\"\nelse\n  tar xzf${__MVNW_QUIET_TAR:+\"$__MVNW_QUIET_TAR\"} \"$TMP_DOWNLOAD_DIR/$distributionUrlName\" -C \"$TMP_DOWNLOAD_DIR\" || die \"failed to untar\"\nfi\nprintf %s\\\\n \"$distributionUrl\" >\"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url\"\nmv -- \"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain\" \"$MAVEN_HOME\" || [ -d \"$MAVEN_HOME\" ] || die \"fail to move MAVEN_HOME\"\n\nclean || :\nexec_maven \"$@\"\n"
  },
  {
    "path": "mvnw.cmd",
    "content": "<# : batch portion\r\n@REM ----------------------------------------------------------------------------\r\n@REM Licensed to the Apache Software Foundation (ASF) under one\r\n@REM or more contributor license agreements.  See the NOTICE file\r\n@REM distributed with this work for additional information\r\n@REM regarding copyright ownership.  The ASF licenses this file\r\n@REM to you under the Apache License, Version 2.0 (the\r\n@REM \"License\"); you may not use this file except in compliance\r\n@REM with the License.  You may obtain a copy of the License at\r\n@REM\r\n@REM    http://www.apache.org/licenses/LICENSE-2.0\r\n@REM\r\n@REM Unless required by applicable law or agreed to in writing,\r\n@REM software distributed under the License is distributed on an\r\n@REM \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n@REM KIND, either express or implied.  See the License for the\r\n@REM specific language governing permissions and limitations\r\n@REM under the License.\r\n@REM ----------------------------------------------------------------------------\r\n\r\n@REM ----------------------------------------------------------------------------\r\n@REM Apache Maven Wrapper startup batch script, version 3.3.2\r\n@REM\r\n@REM Optional ENV vars\r\n@REM   MVNW_REPOURL - repo url base for downloading maven distribution\r\n@REM   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven\r\n@REM   MVNW_VERBOSE - true: enable verbose log; others: silence the output\r\n@REM ----------------------------------------------------------------------------\r\n\r\n@IF \"%__MVNW_ARG0_NAME__%\"==\"\" (SET __MVNW_ARG0_NAME__=%~nx0)\r\n@SET __MVNW_CMD__=\r\n@SET __MVNW_ERROR__=\r\n@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%\r\n@SET PSModulePath=\r\n@FOR /F \"usebackq tokens=1* delims==\" %%A IN (`powershell -noprofile \"& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}\"`) DO @(\r\n  IF \"%%A\"==\"MVN_CMD\" (set __MVNW_CMD__=%%B) ELSE IF \"%%B\"==\"\" (echo %%A) ELSE (echo %%A=%%B)\r\n)\r\n@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%\r\n@SET __MVNW_PSMODULEP_SAVE=\r\n@SET __MVNW_ARG0_NAME__=\r\n@SET MVNW_USERNAME=\r\n@SET MVNW_PASSWORD=\r\n@IF NOT \"%__MVNW_CMD__%\"==\"\" (%__MVNW_CMD__% %*)\r\n@echo Cannot start maven from wrapper >&2 && exit /b 1\r\n@GOTO :EOF\r\n: end batch / begin powershell #>\r\n\r\n$ErrorActionPreference = \"Stop\"\r\nif ($env:MVNW_VERBOSE -eq \"true\") {\r\n  $VerbosePreference = \"Continue\"\r\n}\r\n\r\n# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties\r\n$distributionUrl = (Get-Content -Raw \"$scriptDir/.mvn/wrapper/maven-wrapper.properties\" | ConvertFrom-StringData).distributionUrl\r\nif (!$distributionUrl) {\r\n  Write-Error \"cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties\"\r\n}\r\n\r\nswitch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {\r\n  \"maven-mvnd-*\" {\r\n    $USE_MVND = $true\r\n    $distributionUrl = $distributionUrl -replace '-bin\\.[^.]*$',\"-windows-amd64.zip\"\r\n    $MVN_CMD = \"mvnd.cmd\"\r\n    break\r\n  }\r\n  default {\r\n    $USE_MVND = $false\r\n    $MVN_CMD = $script -replace '^mvnw','mvn'\r\n    break\r\n  }\r\n}\r\n\r\n# apply MVNW_REPOURL and calculate MAVEN_HOME\r\n# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>\r\nif ($env:MVNW_REPOURL) {\r\n  $MVNW_REPO_PATTERN = if ($USE_MVND) { \"/org/apache/maven/\" } else { \"/maven/mvnd/\" }\r\n  $distributionUrl = \"$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')\"\r\n}\r\n$distributionUrlName = $distributionUrl -replace '^.*/',''\r\n$distributionUrlNameMain = $distributionUrlName -replace '\\.[^.]*$','' -replace '-bin$',''\r\n$MAVEN_HOME_PARENT = \"$HOME/.m2/wrapper/dists/$distributionUrlNameMain\"\r\nif ($env:MAVEN_USER_HOME) {\r\n  $MAVEN_HOME_PARENT = \"$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain\"\r\n}\r\n$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString(\"x2\")}) -join ''\r\n$MAVEN_HOME = \"$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME\"\r\n\r\nif (Test-Path -Path \"$MAVEN_HOME\" -PathType Container) {\r\n  Write-Verbose \"found existing MAVEN_HOME at $MAVEN_HOME\"\r\n  Write-Output \"MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD\"\r\n  exit $?\r\n}\r\n\r\nif (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {\r\n  Write-Error \"distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl\"\r\n}\r\n\r\n# prepare tmp dir\r\n$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile\r\n$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path \"$TMP_DOWNLOAD_DIR_HOLDER.dir\"\r\n$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null\r\ntrap {\r\n  if ($TMP_DOWNLOAD_DIR.Exists) {\r\n    try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }\r\n    catch { Write-Warning \"Cannot remove $TMP_DOWNLOAD_DIR\" }\r\n  }\r\n}\r\n\r\nNew-Item -Itemtype Directory -Path \"$MAVEN_HOME_PARENT\" -Force | Out-Null\r\n\r\n# Download and Install Apache Maven\r\nWrite-Verbose \"Couldn't find MAVEN_HOME, downloading and installing it ...\"\r\nWrite-Verbose \"Downloading from: $distributionUrl\"\r\nWrite-Verbose \"Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName\"\r\n\r\n$webclient = New-Object System.Net.WebClient\r\nif ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {\r\n  $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)\r\n}\r\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\r\n$webclient.DownloadFile($distributionUrl, \"$TMP_DOWNLOAD_DIR/$distributionUrlName\") | Out-Null\r\n\r\n# If specified, validate the SHA-256 sum of the Maven distribution zip file\r\n$distributionSha256Sum = (Get-Content -Raw \"$scriptDir/.mvn/wrapper/maven-wrapper.properties\" | ConvertFrom-StringData).distributionSha256Sum\r\nif ($distributionSha256Sum) {\r\n  if ($USE_MVND) {\r\n    Write-Error \"Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties.\"\r\n  }\r\n  Import-Module $PSHOME\\Modules\\Microsoft.PowerShell.Utility -Function Get-FileHash\r\n  if ((Get-FileHash \"$TMP_DOWNLOAD_DIR/$distributionUrlName\" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {\r\n    Write-Error \"Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property.\"\r\n  }\r\n}\r\n\r\n# unzip and move\r\nExpand-Archive \"$TMP_DOWNLOAD_DIR/$distributionUrlName\" -DestinationPath \"$TMP_DOWNLOAD_DIR\" | Out-Null\r\nRename-Item -Path \"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain\" -NewName $MAVEN_HOME_NAME | Out-Null\r\ntry {\r\n  Move-Item -Path \"$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME\" -Destination $MAVEN_HOME_PARENT | Out-Null\r\n} catch {\r\n  if (! (Test-Path -Path \"$MAVEN_HOME\" -PathType Container)) {\r\n    Write-Error \"fail to move MAVEN_HOME\"\r\n  }\r\n} finally {\r\n  try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }\r\n  catch { Write-Warning \"Cannot remove $TMP_DOWNLOAD_DIR\" }\r\n}\r\n\r\nWrite-Output \"MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD\"\r\n"
  },
  {
    "path": "pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>rewrite-maven-plugin</artifactId>\n    <version>6.40.0-SNAPSHOT</version>\n    <packaging>maven-plugin</packaging>\n\n    <name>rewrite-maven-plugin</name>\n    <description>Eliminate technical debt. At build time.</description>\n    <url>https://openrewrite.github.io/rewrite-maven-plugin/</url>\n\n    <inceptionYear>2020</inceptionYear>\n\n    <organization>\n        <name>Moderne, Inc.</name>\n        <url>https://moderne.io/</url>\n    </organization>\n\n    <licenses>\n        <license>\n            <name>The Apache Software License, Version 2.0</name>\n            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>\n        </license>\n    </licenses>\n\n    <developers>\n        <developer>\n            <name>Jonathan Schneider</name>\n            <url>https://github.com/jkschneider</url>\n            <id>jkschneider</id>\n        </developer>\n    </developers>\n\n    <prerequisites>\n        <maven>3.3.1</maven>\n    </prerequisites>\n\n    <scm>\n        <connection>scm:git:https://github.com/openrewrite/rewrite-maven-plugin.git</connection>\n        <developerConnection>${developerConnectionUrl}</developerConnection>\n        <url>https://github.com/openrewrite/rewrite-maven-plugin/tree/main</url>\n        <tag>HEAD</tag>\n    </scm>\n\n    <issueManagement>\n        <system>GitHub Issues</system>\n        <url>https://github.com/openrewrite/rewrite-maven-plugin/issues</url>\n    </issueManagement>\n\n    <distributionManagement>\n        <snapshotRepository>\n            <id>ossrh</id>\n            <url>https://central.sonatype.com/repository/maven-snapshots</url>\n        </snapshotRepository>\n        <repository>\n            <id>ossrh</id>\n            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>\n        </repository>\n    </distributionManagement>\n\n    <properties>\n        <!-- Pinned versions, as RELEASE would make it into the published pom.xml  -->\n        <rewrite.version>8.82.0-SNAPSHOT</rewrite.version>\n        <rewrite-polyglot.version>2.11.0-SNAPSHOT</rewrite-polyglot.version>\n\n        <!-- using 'ssh' url scheme by default, which assumes a human is performing git operations leveraging an ssh key -->\n        <developerConnectionUrl>scm:git:ssh://git@github.com/openrewrite/rewrite-maven-plugin.git\n        </developerConnectionUrl>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\n        <maven.compiler.source>8</maven.compiler.source>\n        <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>\n        <!-- a profile in the profiles section sets the maven.compiler.release property on supported JREs -->\n        <maven.compiler.testRelease>17</maven.compiler.testRelease>\n\n        <!-- dependencies and plugins -->\n        <jackson-bom.version>2.21.3</jackson-bom.version>\n        <rocksdbjni.version>8.8.1</rocksdbjni.version>\n        <itf-maven.version>0.13.1</itf-maven.version>\n        <maven-dependencies.version>3.9.15</maven-dependencies.version>\n        <maven-release-plugin.version>3.3.1</maven-release-plugin.version>\n        <maven-plugin-tools.version>3.15.2</maven-plugin-tools.version>\n    </properties>\n\n    <dependencyManagement>\n        <dependencies>\n            <dependency>\n                <groupId>com.fasterxml.jackson</groupId>\n                <artifactId>jackson-bom</artifactId>\n                <version>${jackson-bom.version}</version>\n                <type>pom</type>\n                <scope>import</scope>\n            </dependency>\n            <dependency>\n                <groupId>org.junit</groupId>\n                <artifactId>junit-bom</artifactId>\n                <version>6.0.3</version>\n                <scope>import</scope>\n                <type>pom</type>\n            </dependency>\n            <dependency>\n                <groupId>org.assertj</groupId>\n                <artifactId>assertj-bom</artifactId>\n                <version>3.27.7</version>\n                <scope>import</scope>\n                <type>pom</type>\n            </dependency>\n            <dependency>\n                <groupId>org.openrewrite</groupId>\n                <artifactId>rewrite-bom</artifactId>\n                <version>${rewrite.version}</version>\n                <scope>import</scope>\n                <type>pom</type>\n            </dependency>\n            <!-- Pin plexus-utils to fix GHSA-6fmv-xxpf-w3cw -->\n            <dependency>\n                <groupId>org.codehaus.plexus</groupId>\n                <artifactId>plexus-utils</artifactId>\n                <version>3.6.1</version>\n            </dependency>\n            <!-- Transitive through Plexus, but with provided scope -->\n            <dependency>\n                <groupId>org.apache.maven</groupId>\n                <artifactId>maven-api-meta</artifactId>\n                <version>4.0.0-rc-1</version>\n                <scope>provided</scope>\n            </dependency>\n            <dependency>\n                <groupId>org.apache.maven</groupId>\n                <artifactId>maven-api-xml</artifactId>\n                <version>4.0.0-rc-5</version>\n                <scope>provided</scope>\n            </dependency>\n            <dependency>\n                <groupId>org.apache.maven</groupId>\n                <artifactId>maven-xml-impl</artifactId>\n                <version>4.0.0-beta-5</version>\n                <scope>provided</scope>\n            </dependency>\n        </dependencies>\n    </dependencyManagement>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java-8</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java-11</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java-17</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java-21</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java-25</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-groovy</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-kotlin</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-xml</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-maven</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-polyglot</artifactId>\n            <version>${rewrite-polyglot.version}</version>\n        </dependency>\n        <dependency>\n            <groupId>org.codehaus.plexus</groupId>\n            <artifactId>plexus-xml</artifactId>\n            <version>4.1.1</version>\n        </dependency>\n        <dependency>\n            <groupId>io.micrometer</groupId>\n            <artifactId>micrometer-core</artifactId>\n            <version>1.16.5</version>\n        </dependency>\n        <dependency>\n            <groupId>org.rocksdb</groupId>\n            <artifactId>rocksdbjni</artifactId>\n            <version>${rocksdbjni.version}</version>\n        </dependency>\n\n        <dependency>\n            <!-- plugin interfaces and base classes -->\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-plugin-api</artifactId>\n            <version>${maven-dependencies.version}</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <!-- needed when injecting the Maven Project into a plugin -->\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-core</artifactId>\n            <version>${maven-dependencies.version}</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-settings</artifactId>\n            <version>${maven-dependencies.version}</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-model</artifactId>\n            <version>${maven-dependencies.version}</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <!-- annotations used to describe the plugin metadata -->\n            <groupId>org.apache.maven.plugin-tools</groupId>\n            <artifactId>maven-plugin-annotations</artifactId>\n            <version>${maven-plugin-tools.version}</version>\n            <scope>provided</scope>\n        </dependency>\n\n        <!-- JUnit Jupiter, and using itf-jupiter-extension to get itf support for executing everything as Maven tests -->\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-api</artifactId>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-params</artifactId>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>com.soebes.itf.jupiter.extension</groupId>\n            <artifactId>itf-jupiter-extension</artifactId>\n            <version>${itf-maven.version}</version>\n            <scope>test</scope>\n        </dependency>\n        <!-- Using assertj as well as custom assertions of AssertJ provided by itf-assertj -->\n        <dependency>\n            <groupId>org.assertj</groupId>\n            <artifactId>assertj-core</artifactId>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>com.soebes.itf.jupiter.extension</groupId>\n            <artifactId>itf-assertj</artifactId>\n            <version>${itf-maven.version}</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>com.soebes.itf.jupiter.extension</groupId>\n            <artifactId>itf-extension-maven</artifactId>\n            <version>${itf-maven.version}</version>\n            <scope>test</scope>\n        </dependency>\n    </dependencies>\n\n    <repositories>\n        <repository>\n            <!-- for consuming upstream openrewrite snapshot artifacts from ossrh during development -->\n            <id>ossrh-snapshots</id>\n            <url>https://central.sonatype.com/repository/maven-snapshots</url>\n            <snapshots>\n                <enabled>true</enabled>\n            </snapshots>\n            <releases>\n                <enabled>false</enabled>\n            </releases>\n        </repository>\n    </repositories>\n\n    <build>\n        <testResources>\n            <testResource>\n                <directory>src/test/resources</directory>\n                <filtering>false</filtering>\n            </testResource>\n            <testResource>\n                <directory>src/test/resources-its</directory>\n                <filtering>true</filtering>\n            </testResource>\n        </testResources>\n\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-enforcer-plugin</artifactId>\n                <version>3.6.2</version>\n                <configuration>\n                    <rules>\n                        <requireJavaVersion>\n                            <version>17</version>\n                        </requireJavaVersion>\n                        <requireMavenVersion>\n                            <version>3.9.6</version>\n                        </requireMavenVersion>\n                    </rules>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>enforce</id>\n                        <goals>\n                            <goal>enforce</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-site-plugin</artifactId>\n                <version>4.0.0-M16</version>\n            </plugin>\n            <!-- testing-related plugins -->\n            <plugin>\n                <groupId>com.soebes.itf.jupiter.extension</groupId>\n                <artifactId>itf-maven-plugin</artifactId>\n                <version>${itf-maven.version}</version>\n                <configuration>\n                    <!-- Prevents adding files like .DS_Store during resource-its filtering -->\n                    <addDefaultExcludes>true</addDefaultExcludes>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>installing</id>\n                        <phase>pre-integration-test</phase>\n                        <goals>\n                            <goal>install</goal>\n                            <goal>resources-its</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-failsafe-plugin</artifactId>\n                <version>3.5.5</version>\n                <executions>\n                    <execution>\n                        <goals>\n                            <goal>integration-test</goal>\n                            <goal>verify</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <!-- essential \"core\" plugins -->\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-plugin-plugin</artifactId>\n                <version>${maven-plugin-tools.version}</version>\n                <configuration>\n                    <goalPrefix>rewrite</goalPrefix>\n                    <requiredJavaVersion>8</requiredJavaVersion>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.ow2.asm</groupId>\n                        <artifactId>asm</artifactId>\n                        <version>9.9.1</version>\n                    </dependency>\n                </dependencies>\n                <executions>\n                    <execution>\n                        <id>generate-helpmojo</id>\n                        <goals>\n                            <goal>helpmojo</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.15.0</version>\n                <configuration>\n                    <compilerArgs>\n                        <arg>-Xlint:deprecation</arg>\n                        <arg>-Xlint:unchecked</arg>\n                    </compilerArgs>\n                    <proc>none</proc>\n                </configuration>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                <version>3.12.0</version>\n                <executions>\n                    <execution>\n                        <phase>prepare-package</phase>\n                        <goals>\n                            <goal>javadoc</goal>\n                            <goal>jar</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-source-plugin</artifactId>\n                <version>3.4.0</version>\n                <executions>\n                    <execution>\n                        <phase>prepare-package</phase>\n                        <goals>\n                            <goal>aggregate</goal>\n                            <goal>jar</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <!-- release-related plugins -->\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-release-plugin</artifactId>\n                <version>${maven-release-plugin.version}</version>\n                <configuration>\n                    <releaseProfiles>release</releaseProfiles>\n                    <tagNameFormat>v@{project.version}</tagNameFormat>\n                    <!-- \"SemVerVersionPolicy\" causes maven-release to increment the MINOR version when calculating the next development version. -->\n                    <!-- For example, if the current version is 4.6.3-SNAPSHOT, then we release, this will release 4.6.3, then set the next development version to 4.7.0-SNAPSHOT -->\n                    <!-- By contrast, the \"default\" policy increments the PATCH version. -->\n                    <projectVersionPolicyId>SemVerVersionPolicy</projectVersionPolicyId>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <!-- needed only for the SemVerVersionPolicy policy -->\n                        <groupId>org.apache.maven.release</groupId>\n                        <artifactId>maven-release-semver-policy</artifactId>\n                        <version>${maven-release-plugin.version}</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n\n            <plugin>\n                <groupId>com.mycila</groupId>\n                <artifactId>license-maven-plugin</artifactId>\n                <!-- 4.6 is the last version supporting Java 8 -->\n                <version>4.6</version>\n                <configuration>\n                    <licenseSets>\n                        <licenseSet>\n                            <header>.mvn/licenseHeader.txt</header>\n                            <excludes>\n                                <exclude>*.xml</exclude>\n                                <exclude>suppressions.xml</exclude>\n                                <exclude>**/README.md</exclude>\n                                <exclude>**/.sdkmanrc</exclude>\n                                <exclude>LICENSE/apache-license-v2.txt</exclude>\n                                <exclude>src/test/resources-its/**</exclude>\n                                <exclude>src/test/resources/**</exclude>\n                                <exclude>src/main/resources/**</exclude>\n                                <exclude>.moderne/</exclude>\n                                <exclude>.mvn/</exclude>\n                            </excludes>\n                        </licenseSet>\n                    </licenseSets>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>com.mycila</groupId>\n                        <artifactId>license-maven-plugin-git</artifactId>\n                        <!-- make sure you use the same version as license-maven-plugin -->\n                        <version>4.6</version>\n                    </dependency>\n                </dependencies>\n                <executions>\n                    <execution>\n                        <id>first</id>\n                        <goals>\n                            <goal>format</goal>\n                        </goals>\n                        <phase>process-sources</phase>\n                    </execution>\n                    <execution>\n                        <id>second</id>\n                        <goals>\n                            <goal>check</goal>\n                        </goals>\n                        <phase>verify</phase>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.owasp</groupId>\n                <artifactId>dependency-check-maven</artifactId>\n                <version>12.2.2</version>\n                <configuration>\n                    <nvdApiKey>${env.NVD_API_KEY}</nvdApiKey>\n                    <failBuildOnCVSS>9</failBuildOnCVSS>\n                    <suppressionFiles>\n                        <suppressionFile>suppressions.xml</suppressionFile>\n                    </suppressionFiles>\n                    <retireJsAnalyzerEnabled>false</retireJsAnalyzerEnabled>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n\n    <reporting>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-plugin-report-plugin</artifactId>\n                <version>${maven-plugin-tools.version}</version>\n            </plugin>\n        </plugins>\n    </reporting>\n\n    <profiles>\n        <profile>\n            <id>sign-artifacts</id>\n            <build>\n                <plugins>\n                    <plugin>\n                        <groupId>org.apache.maven.plugins</groupId>\n                        <artifactId>maven-gpg-plugin</artifactId>\n                        <version>3.2.8</version>\n                        <executions>\n                            <execution>\n                                <id>sign-artifacts</id>\n                                <phase>verify</phase>\n                                <goals>\n                                    <goal>sign</goal>\n                                </goals>\n                                <configuration>\n                                    <!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing failed: Inappropriate ioctl for device -->\n                                    <gpgArguments>\n                                        <arg>--pinentry-mode</arg>\n                                        <arg>loopback</arg>\n                                    </gpgArguments>\n                                </configuration>\n                            </execution>\n                        </executions>\n                    </plugin>\n                </plugins>\n            </build>\n        </profile>\n        <profile>\n            <id>release</id>\n            <build>\n                <plugins>\n                    <plugin>\n                        <groupId>org.sonatype.plugins</groupId>\n                        <artifactId>nexus-staging-maven-plugin</artifactId>\n                        <version>1.7.0</version>\n                        <extensions>true</extensions>\n                        <configuration>\n                            <!-- https://help.sonatype.com/repomanager2/staging-releases/configuring-your-project-for-deployment -->\n                            <serverId>ossrh</serverId>\n                            <nexusUrl>https://ossrh-staging-api.central.sonatype.com/</nexusUrl>\n                            <autoReleaseAfterClose>true</autoReleaseAfterClose>\n                            <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>\n                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>\n                        </configuration>\n                    </plugin>\n                </plugins>\n            </build>\n            <properties>\n                <!-- save time by skipping the tests during deploy -->\n                <maven.test.skip>true</maven.test.skip>\n            </properties>\n        </profile>\n        <profile>\n            <!-- generally should be stacked after the 'release' profile, but in some cases we may want to discern between a ci-cd system performing the release; and if the situation requires it, a human performing the release -->\n            <id>release-automation</id>\n            <properties>\n                <!-- automation via the maven-release-plugin uses a GITHUB_TOKEN which requires 'https' urls for git pushing -->\n                <developerConnectionUrl>scm:git:https://github.com/openrewrite/rewrite-maven-plugin.git\n                </developerConnectionUrl>\n            </properties>\n        </profile>\n        <profile>\n            <!-- set maven.compiler.release on JRE 9+ -->\n            <id>avoid-maven-compiler-warnings</id>\n            <activation>\n                <jdk>[9,)</jdk>\n            </activation>\n            <properties>\n                <maven.compiler.release>8</maven.compiler.release>\n            </properties>\n        </profile>\n    </profiles>\n</project>\n"
  },
  {
    "path": "rewrite.yml",
    "content": "#\n# Copyright 2020 the original author or authors.\n# <p>\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# <p>\n# https://www.apache.org/licenses/LICENSE-2.0\n# <p>\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n#./mvnw org.openrewrite.maven:rewrite-maven-plugin:LATEST:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-static-analysis:RELEASE -Drewrite.activeRecipes=org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPracticesSubset\n---\ntype: specs.openrewrite.org/v1beta/recipe\nname: org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPracticesSubset\ndisplayName: OpenRewrite best practices\ndescription: Best practices for OpenRewrite recipe development.\nrecipeList:\n  - org.openrewrite.java.OrderImports:\n      removeUnused: true\n  - org.openrewrite.java.format.EmptyNewlineAtEndOfFile\n  - org.openrewrite.java.format.RemoveTrailingWhitespace\n  - org.openrewrite.maven.BestPractices\n#  - org.openrewrite.staticanalysis.OperatorWrap:\n#      wrapOption: EOL\n#  - org.openrewrite.staticanalysis.CommonStaticAnalysis\n#  - org.openrewrite.staticanalysis.CompareEnumsWithEqualityOperator\n#  - org.openrewrite.staticanalysis.MissingOverrideAnnotation\n#  - org.openrewrite.staticanalysis.RemoveSystemOutPrintln\n#  - org.openrewrite.staticanalysis.RemoveUnusedLocalVariables\n#  - org.openrewrite.staticanalysis.RemoveUnusedPrivateFields\n#  - org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/AbstractRewriteBaseRunMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport io.micrometer.core.instrument.Metrics;\nimport org.apache.maven.artifact.DependencyResolutionRequiredException;\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.codehaus.plexus.classworlds.realm.ClassRealm;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.*;\nimport org.openrewrite.config.CompositeRecipe;\nimport org.openrewrite.config.DeclarativeRecipe;\nimport org.openrewrite.config.Environment;\nimport org.openrewrite.config.RecipeDescriptor;\nimport org.openrewrite.internal.InMemoryLargeSourceSet;\nimport org.openrewrite.internal.ListUtils;\nimport org.openrewrite.java.tree.J;\nimport org.openrewrite.kotlin.tree.K;\nimport org.openrewrite.marker.*;\nimport org.openrewrite.style.NamedStyles;\nimport org.openrewrite.xml.tree.Xml;\n\nimport java.io.IOException;\nimport java.io.UncheckedIOException;\nimport java.lang.reflect.Field;\nimport java.net.URL;\nimport java.net.URLClassLoader;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.time.Duration;\nimport java.time.LocalDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.*;\nimport java.util.function.UnaryOperator;\nimport java.util.stream.Stream;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.stream.Collectors.joining;\nimport static java.util.stream.Collectors.toList;\n\npublic abstract class AbstractRewriteBaseRunMojo extends AbstractRewriteMojo {\n\n    @Parameter(property = \"rewrite.exportDatatables\", defaultValue = \"false\")\n    protected boolean exportDatatables;\n\n    @Parameter(property = \"rewrite.options\")\n    @Nullable\n    protected LinkedHashSet<String> options;\n\n    /**\n     * The level used to log changes performed by recipes.\n     */\n    @Parameter(property = \"rewrite.recipeChangeLogLevel\", defaultValue = \"WARN\")\n    protected LogLevel recipeChangeLogLevel;\n\n    protected void log(LogLevel logLevel, CharSequence content) {\n        switch (logLevel) {\n            case DEBUG:\n                getLog().debug(content);\n                break;\n            case INFO:\n                getLog().info(content);\n                break;\n            case WARN:\n                getLog().warn(content);\n                break;\n            case ERROR:\n                getLog().error(content);\n                break;\n        }\n    }\n\n    /**\n     * Attempt to determine the root of the git repository for the given project.\n     * Many Gradle builds co-locate the build root with the git repository root, but that is not required.\n     * If no git repository can be located in any folder containing the build, the build root will be returned.\n     */\n    protected Path repositoryRoot() {\n        Path buildRoot = getBuildRoot();\n        Path maybeBaseDir = buildRoot;\n        while (maybeBaseDir != null && !Files.exists(maybeBaseDir.resolve(\".git\"))) {\n            maybeBaseDir = maybeBaseDir.getParent();\n        }\n        if (maybeBaseDir == null) {\n            return buildRoot;\n        }\n        return maybeBaseDir;\n    }\n\n    protected ResultsContainer listResults(ExecutionContext ctx) throws MojoExecutionException, MojoFailureException {\n        try (MeterRegistryProvider meterRegistryProvider = new MeterRegistryProvider(getLog(), null)) {\n            if (!Metrics.globalRegistry.getRegistries().contains(meterRegistryProvider.registry())) {\n                Metrics.addRegistry(meterRegistryProvider.registry());\n            }\n\n            Path repositoryRoot = repositoryRoot();\n            getLog().info(String.format(\"Using active recipe(s) %s\", getActiveRecipes()));\n            getLog().info(String.format(\"Using active styles(s) %s\", getActiveStyles()));\n            if (getActiveRecipes().isEmpty()) {\n                return new ResultsContainer(repositoryRoot, emptyList());\n            }\n\n            URLClassLoader recipeArtifactCoordinatesClassloader = getRecipeArtifactCoordinatesClassloader();\n            if (recipeArtifactCoordinatesClassloader != null) {\n                merge(getClass().getClassLoader(), recipeArtifactCoordinatesClassloader);\n            }\n            Environment env = environment(recipeArtifactCoordinatesClassloader);\n\n            Recipe recipe = env.activateRecipes(getActiveRecipes());\n            if (\"org.openrewrite.Recipe$Noop\".equals(recipe.getName())) {\n                getLog().warn(\"No recipes were activated.\" +\n                              \" Activate a recipe with <activeRecipes><recipe>com.fully.qualified.RecipeClassName</recipe></activeRecipes> in this plugin's <configuration> in your pom.xml,\" +\n                              \" or on the command line with -Drewrite.activeRecipes=com.fully.qualified.RecipeClassName\");\n                return new ResultsContainer(repositoryRoot, emptyList());\n            }\n\n            if (options != null && !options.isEmpty()) {\n                configureRecipeOptions(recipe, options);\n            }\n\n            getLog().info(\"Validating active recipes...\");\n            List<Validated<Object>> validations = new ArrayList<>();\n            recipe.validateAll(ctx, validations);\n            List<Validated.Invalid<Object>> failedValidations = validations.stream().map(Validated::failures)\n                    .flatMap(Collection::stream).collect(toList());\n            if (!failedValidations.isEmpty()) {\n                failedValidations.forEach(failedValidation -> getLog().error(\n                        String.format(\n                                \"Recipe validation error in %s for property %s: %s\",\n                                recipe.getName(),\n                                failedValidation.getProperty(),\n                                failedValidation.getMessage()),\n                        failedValidation.getException()));\n                if (failOnInvalidActiveRecipes) {\n                    throw new MojoExecutionException(\"Recipe validation errors detected as part of one or more activeRecipe(s). Please check error logs.\");\n                }\n                getLog().error(\"Recipe validation errors detected as part of one or more activeRecipe(s). Execution will continue regardless.\");\n            }\n\n            LargeSourceSet sourceSet = loadSourceSet(repositoryRoot, env, ctx);\n\n            List<Result> results = runRecipe(recipe, sourceSet, ctx);\n\n            Metrics.removeRegistry(meterRegistryProvider.registry());\n\n            return new ResultsContainer(repositoryRoot, results);\n        } catch (DependencyResolutionRequiredException e) {\n            throw new MojoExecutionException(\"Dependency resolution required\", e);\n        }\n    }\n\n    private static void configureRecipeOptions(Recipe recipe, Set<String> options) throws MojoExecutionException {\n        if (recipe instanceof CompositeRecipe ||\n            recipe instanceof DeclarativeRecipe ||\n            recipe instanceof Recipe.DelegatingRecipe ||\n            !recipe.getRecipeList().isEmpty()) {\n            // We don't (yet) support configuring potentially nested recipes, as recipes might occur more than once,\n            // and setting the same value twice might lead to unexpected behavior.\n            throw new MojoExecutionException(\n                    \"Recipes containing other recipes can not be configured from the command line: \" + recipe);\n        }\n\n        Map<String, String> optionValues = new HashMap<>();\n        for (String option : options) {\n            String[] parts = option.split(\"=\", 2);\n            if (parts.length == 2) {\n                optionValues.put(parts[0], parts[1]);\n            }\n        }\n        for (Field field : recipe.getClass().getDeclaredFields()) {\n            String removed = optionValues.remove(field.getName());\n            updateOption(recipe, field, removed);\n        }\n        if (!optionValues.isEmpty()) {\n            throw new MojoExecutionException(\n                    String.format(\"Unknown recipe options: %s\", String.join(\", \", optionValues.keySet())));\n        }\n    }\n\n    private static void updateOption(Recipe recipe, Field field, @Nullable String optionValue) throws MojoExecutionException {\n        Object convertedOptionValue = convertOptionValue(field.getName(), optionValue, field.getType());\n        if (convertedOptionValue == null) {\n            return;\n        }\n        try {\n            field.setAccessible(true);\n            field.set(recipe, convertedOptionValue);\n            field.setAccessible(false);\n        } catch (IllegalArgumentException | IllegalAccessException e) {\n            throw new MojoExecutionException(\n                    String.format(\"Unable to configure recipe '%s' option '%s' with value '%s'\",\n                            recipe.getClass().getSimpleName(), field.getName(), optionValue));\n        }\n    }\n\n    private static @Nullable Object convertOptionValue(String name, @Nullable String optionValue, Class<?> type)\n            throws MojoExecutionException {\n        if (optionValue == null) {\n            return null;\n        }\n        if (type.isAssignableFrom(String.class)) {\n            return optionValue;\n        }\n        if (type.isAssignableFrom(boolean.class) || type.isAssignableFrom(Boolean.class)) {\n            return Boolean.parseBoolean(optionValue);\n        }\n        if (type.isAssignableFrom(int.class) || type.isAssignableFrom(Integer.class)) {\n            return Integer.parseInt(optionValue);\n        }\n        if (type.isAssignableFrom(long.class) || type.isAssignableFrom(Long.class)) {\n            return Long.parseLong(optionValue);\n        }\n\n        throw new MojoExecutionException(\n                String.format(\"Unable to convert option: %s value: %s to type: %s\", name, optionValue, type));\n    }\n\n    protected LargeSourceSet loadSourceSet(Path repositoryRoot, Environment env, ExecutionContext ctx) throws DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException {\n        List<NamedStyles> styles = loadStyles(project, env);\n\n        //Parse and collect source files from each project in the maven session.\n        MavenMojoProjectParser projectParser = new MavenMojoProjectParser(getLog(), repositoryRoot, pomCacheEnabled, pomCacheDirectory, runtime, skipMavenParsing, getExclusions(), getPlainTextMasks(), sizeThresholdMb, mavenSession, settingsDecrypter, runPerSubmodule, true);\n\n        Stream<SourceFile> sourceFiles = projectParser.listSourceFiles(project, styles, ctx);\n        List<SourceFile> sourceFileList = sourcesWithAutoDetectedStyles(sourceFiles);\n        return new InMemoryLargeSourceSet(sourceFileList);\n    }\n\n    protected List<Result> runRecipe(Recipe recipe, LargeSourceSet sourceSet, ExecutionContext ctx) {\n        getLog().info(\"Running recipe(s)...\");\n\n        CsvDataTableStore csvDataTableStore = null;\n        if (exportDatatables) {\n            String timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd_HH-mm-ss-SSS\"));\n            Path datatableDirectoryPath = Paths.get(\"target\", \"rewrite\", \"datatables\", timestamp);\n            getLog().info(String.format(\"Printing available datatables to: %s\", datatableDirectoryPath));\n            csvDataTableStore = new CsvDataTableStore(datatableDirectoryPath);\n            DataTableExecutionContextView.view(ctx).setDataTableStore(csvDataTableStore);\n        }\n\n        RecipeRun recipeRun = recipe.run(sourceSet, ctx);\n\n        if (csvDataTableStore != null) {\n            csvDataTableStore.close();\n        }\n\n        return recipeRun.getChangeset().getAllResults().stream().filter(source -> {\n            // Remove ASTs originating from generated files\n            if (source.getBefore() != null) {\n                return !source.getBefore().getMarkers().findFirst(Generated.class).isPresent();\n            }\n            return true;\n        }).collect(toList());\n    }\n\n    private List<SourceFile> sourcesWithAutoDetectedStyles(Stream<SourceFile> sourceFiles) {\n        org.openrewrite.java.style.Autodetect.Detector javaDetector = org.openrewrite.java.style.Autodetect.detector();\n        org.openrewrite.kotlin.style.Autodetect.Detector kotlinDetector = org.openrewrite.kotlin.style.Autodetect.detector();\n        org.openrewrite.xml.style.Autodetect.Detector xmlDetector = org.openrewrite.xml.style.Autodetect.detector();\n\n        List<SourceFile> sourceFileList = sourceFiles\n                .peek(s -> {\n                    if (s instanceof K.CompilationUnit) {\n                        kotlinDetector.sample(s);\n                    } else if (s instanceof J.CompilationUnit) {\n                        javaDetector.sample(s);\n                    }\n                })\n                .peek(xmlDetector::sample)\n                .collect(toList());\n\n        Map<Class<? extends Tree>, NamedStyles> stylesByType = new HashMap<>();\n        stylesByType.put(J.CompilationUnit.class, javaDetector.build());\n        stylesByType.put(K.CompilationUnit.class, kotlinDetector.build());\n        stylesByType.put(Xml.Document.class, xmlDetector.build());\n\n        return ListUtils.map(sourceFileList, applyAutodetectedStyle(stylesByType));\n    }\n\n    private UnaryOperator<SourceFile> applyAutodetectedStyle(Map<Class<? extends Tree>, NamedStyles> stylesByType) {\n        return before -> {\n            for (Map.Entry<Class<? extends Tree>, NamedStyles> styleTypeEntry : stylesByType.entrySet()) {\n                if (styleTypeEntry.getKey().isAssignableFrom(before.getClass())) {\n                    before = before.withMarkers(before.getMarkers().add(styleTypeEntry.getValue()));\n                }\n            }\n            return before;\n        };\n    }\n\n    private void merge(ClassLoader targetClassLoader, URLClassLoader sourceClassLoader) {\n        ClassRealm targetClassRealm;\n        try {\n            targetClassRealm = (ClassRealm) targetClassLoader;\n        } catch (ClassCastException e) {\n            getLog().warn(\"Could not merge ClassLoaders due to unexpected targetClassLoader type\", e);\n            return;\n        }\n        Set<String> existingVersionlessJars = new HashSet<>();\n        for (URL existingUrl : targetClassRealm.getURLs()) {\n            existingVersionlessJars.add(stripVersion(existingUrl));\n        }\n        for (URL newUrl : sourceClassLoader.getURLs()) {\n            if (!existingVersionlessJars.contains(stripVersion(newUrl))) {\n                targetClassRealm.addURL(newUrl);\n            }\n        }\n    }\n\n    private String stripVersion(URL jarUrl) {\n        return jarUrl.toString().replaceAll(\"/[^/]+/[^/]+\\\\.jar\", \"\");\n    }\n\n    public static class ResultsContainer {\n        final Path projectRoot;\n        final List<Result> generated = new ArrayList<>();\n        final List<Result> deleted = new ArrayList<>();\n        final List<Result> moved = new ArrayList<>();\n        final List<Result> refactoredInPlace = new ArrayList<>();\n\n        public ResultsContainer(Path projectRoot, Collection<Result> results) {\n            this.projectRoot = projectRoot;\n            for (Result result : results) {\n                if (result.getBefore() == null && result.getAfter() == null) {\n                    // This situation shouldn't happen / makes no sense, log and skip\n                    continue;\n                }\n                if (result.getBefore() == null && result.getAfter() != null) {\n                    generated.add(result);\n                } else if (result.getBefore() != null && result.getAfter() == null) {\n                    deleted.add(result);\n                } else if (result.getBefore() != null && result.getAfter() != null && !result.getBefore().getSourcePath().equals(result.getAfter().getSourcePath())) {\n                    moved.add(result);\n                } else {\n                    FencedMarkerPrinter markerPrinter = new FencedMarkerPrinter();\n                    String beforePrint = result.getBefore().printAll(new PrintOutputCapture<>(0, markerPrinter));\n                    String afterPrint = result.getAfter().printAll(new PrintOutputCapture<>(0, markerPrinter));\n                    if (!beforePrint.equals(afterPrint)) {\n                        refactoredInPlace.add(result);\n                    }\n                }\n            }\n        }\n\n        public @Nullable RuntimeException getFirstException() {\n            for (Result result : generated) {\n                for (RuntimeException error : getRecipeErrors(result)) {\n                    return error;\n                }\n            }\n            for (Result result : deleted) {\n                for (RuntimeException error : getRecipeErrors(result)) {\n                    return error;\n                }\n            }\n            for (Result result : moved) {\n                for (RuntimeException error : getRecipeErrors(result)) {\n                    return error;\n                }\n            }\n            for (Result result : refactoredInPlace) {\n                for (RuntimeException error : getRecipeErrors(result)) {\n                    return error;\n                }\n            }\n            return null;\n        }\n\n        private List<RuntimeException> getRecipeErrors(Result result) {\n            List<RuntimeException> exceptions = new ArrayList<>();\n            new TreeVisitor<Tree, Integer>() {\n                @Override\n                public Tree preVisit(Tree tree, Integer integer) {\n                    Markers markers = tree.getMarkers();\n                    markers.findFirst(Markup.Error.class).ifPresent(e -> {\n                        Optional<SourceFile> sourceFile = Optional.ofNullable(getCursor().firstEnclosing(SourceFile.class));\n                        String sourcePath = sourceFile.map(SourceFile::getSourcePath).map(Path::toString).orElse(\"<unknown>\");\n                        exceptions.add(new RuntimeException(\"Error while visiting \" + sourcePath + \": \" + e.getDetail()));\n                    });\n                    return tree;\n                }\n            }.visit(result.getAfter(), 0);\n            return exceptions;\n        }\n\n        public Path getProjectRoot() {\n            return projectRoot;\n        }\n\n        public boolean isNotEmpty() {\n            return !generated.isEmpty() || !deleted.isEmpty() || !moved.isEmpty() || !refactoredInPlace.isEmpty();\n        }\n\n        /**\n         * List directories that are empty as a result of applying recipe changes\n         */\n        public List<Path> newlyEmptyDirectories() {\n            Set<Path> maybeEmptyDirectories = new LinkedHashSet<>();\n            for (Result result : moved) {\n                assert result.getBefore() != null;\n                maybeEmptyDirectories.add(projectRoot.resolve(result.getBefore().getSourcePath()).getParent());\n            }\n            for (Result result : deleted) {\n                assert result.getBefore() != null;\n                maybeEmptyDirectories.add(projectRoot.resolve(result.getBefore().getSourcePath()).getParent());\n            }\n            if (maybeEmptyDirectories.isEmpty()) {\n                return emptyList();\n            }\n            List<Path> emptyDirectories = new ArrayList<>(maybeEmptyDirectories.size());\n            for (Path maybeEmptyDirectory : maybeEmptyDirectories) {\n                try (Stream<Path> contents = Files.list(maybeEmptyDirectory)) {\n                    if (contents.findAny().isPresent()) {\n                        continue;\n                    }\n                    Files.delete(maybeEmptyDirectory);\n                } catch (IOException e) {\n                    throw new UncheckedIOException(e);\n                }\n            }\n            return emptyDirectories;\n        }\n\n        /**\n         * Only retains output for markers of type {@code SearchResult} and {@code Markup}.\n         */\n        private static class FencedMarkerPrinter implements PrintOutputCapture.MarkerPrinter {\n            @Override\n            public String beforeSyntax(Marker marker, Cursor cursor, UnaryOperator<String> commentWrapper) {\n                return marker instanceof SearchResult || marker instanceof Markup ? \"{{\" + marker.getId() + \"}}\" : \"\";\n            }\n\n            @Override\n            public String afterSyntax(Marker marker, Cursor cursor, UnaryOperator<String> commentWrapper) {\n                return marker instanceof SearchResult || marker instanceof Markup ? \"{{\" + marker.getId() + \"}}\" : \"\";\n            }\n        }\n    }\n\n    protected void logRecipesThatMadeChanges(Result result) {\n        String indent = \"    \";\n        String prefix = \"    \";\n        for (RecipeDescriptor recipeDescriptor : result.getRecipeDescriptorsThatMadeChanges()) {\n            logRecipe(recipeDescriptor, prefix);\n            prefix = prefix + indent;\n        }\n    }\n\n    private void logRecipe(RecipeDescriptor rd, String prefix) {\n        StringBuilder recipeString = new StringBuilder(prefix + rd.getName());\n        if (!rd.getOptions().isEmpty()) {\n            String opts = rd.getOptions().stream().map(option -> {\n                        if (option.getValue() != null) {\n                            return option.getName() + \"=\" + option.getValue();\n                        }\n                        return null;\n                    }\n            ).filter(Objects::nonNull).collect(joining(\", \"));\n            if (!opts.isEmpty()) {\n                recipeString.append(\": {\").append(opts).append(\"}\");\n            }\n        }\n        log(recipeChangeLogLevel, recipeString.toString());\n        for (RecipeDescriptor rchild : rd.getRecipeList()) {\n            logRecipe(rchild, prefix + \"    \");\n        }\n    }\n\n    protected Duration estimateTimeSavedSum(Result result, Duration timeSaving) {\n        if (null != result.getTimeSavings()) {\n            return timeSaving.plus(result.getTimeSavings());\n        }\n        return timeSaving;\n    }\n\n    protected String formatDuration(Duration duration) {\n        return duration.toString()\n                .substring(2)\n                .replaceAll(\"(\\\\d[HMS])(?!$)\", \"$1 \")\n                .toLowerCase()\n                .trim();\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/AbstractRewriteDryRunMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.ExecutionContext;\nimport org.openrewrite.Result;\n\nimport java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.time.Duration;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.stream.Stream;\n\n/**\n * Base mojo for rewrite:dryRun and rewrite:dryRunNoFork.\n * <p>\n * Generate warnings to the console for any recipe that would make changes, but do not make changes.\n */\npublic class AbstractRewriteDryRunMojo extends AbstractRewriteBaseRunMojo {\n\n    @Parameter(property = \"reportOutputDirectory\")\n    @Nullable\n    private String reportOutputDirectory;\n\n    /**\n     * Whether to throw an exception if there are any result changes produced.\n     */\n    @Parameter(property = \"failOnDryRunResults\", defaultValue = \"false\")\n    private boolean failOnDryRunResults;\n\n    @Override\n    public void execute() throws MojoExecutionException, MojoFailureException {\n        if (rewriteSkip) {\n            getLog().info(\"Skipping execution\");\n            putState(State.SKIPPED);\n            return;\n        }\n        putState(State.TO_BE_PROCESSED);\n\n        // If the plugin is configured to run over all projects (at the end of the build) only proceed if the plugin\n        // is being run on the last project.\n        if (!runPerSubmodule && !allProjectsMarked()) {\n            getLog().info(\"REWRITE: Delaying execution to the end of multi-module project for \" +\n                project.getGroupId() + \":\" +\n                project.getArtifactId()+ \":\" +\n                project.getVersion());\n            return;\n        }\n\n        List<Throwable> throwables = new ArrayList<>();\n        ExecutionContext ctx = executionContext(throwables);\n\n        ResultsContainer results = listResults(ctx);\n\n        RuntimeException firstException = results.getFirstException();\n        if (firstException != null) {\n            getLog().error(\"The recipe produced an error. Please report this to the recipe author.\");\n            throw firstException;\n        }\n        if (!throwables.isEmpty()) {\n            getLog().warn(\"The recipe produced \" + throwables.size() + \" warning(s). Please report this to the recipe author.\");\n            if (!getLog().isDebugEnabled() && !exportDatatables) {\n                getLog().warn(\"Run with `--debug` or `-Drewrite.exportDatatables=true` to see all warnings.\", throwables.get(0));\n            }\n        }\n\n        if (results.isNotEmpty()) {\n            Duration estimateTimeSaved = Duration.ZERO;\n            for (Result result : results.generated) {\n                assert result.getAfter() != null;\n                getLog().warn(\"These recipes would generate a new file \" +\n                              result.getAfter().getSourcePath() +\n                              \":\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n            for (Result result : results.deleted) {\n                assert result.getBefore() != null;\n                getLog().warn(\"These recipes would delete a file \" +\n                              result.getBefore().getSourcePath() +\n                              \":\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n            for (Result result : results.moved) {\n                assert result.getBefore() != null;\n                assert result.getAfter() != null;\n                getLog().warn(\"These recipes would move a file from \" +\n                              result.getBefore().getSourcePath() + \" to \" +\n                              result.getAfter().getSourcePath() + \":\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n            for (Result result : results.refactoredInPlace) {\n                assert result.getBefore() != null;\n                getLog().warn(\"These recipes would make changes to \" +\n                              result.getBefore().getSourcePath() +\n                              \":\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n\n            Path outPath;\n            if (reportOutputDirectory != null) {\n                outPath = Paths.get(reportOutputDirectory);\n            } else if (runPerSubmodule) {\n                outPath = Paths.get(project.getBuild().getDirectory()).resolve(\"rewrite\");\n            } else {\n                outPath = Paths.get(mavenSession.getTopLevelProject().getBuild().getDirectory()).resolve(\"rewrite\");\n            }\n            try {\n                Files.createDirectories(outPath);\n            } catch (IOException e) {\n                throw new RuntimeException(\"Could not create the folder [ \" + outPath + \"].\", e);\n            }\n\n            Path patchFile = outPath.resolve(\"rewrite.patch\");\n            try (BufferedWriter writer = Files.newBufferedWriter(patchFile)) {\n                Stream.concat(\n                                Stream.concat(results.generated.stream(), results.deleted.stream()),\n                                Stream.concat(results.moved.stream(), results.refactoredInPlace.stream())\n                        )\n                        .map(Result::diff)\n                        .forEach(diff -> {\n                            try {\n                                writer.write(diff + \"\\n\");\n                            } catch (IOException e) {\n                                throw new RuntimeException(e);\n                            }\n                        });\n\n            } catch (Exception e) {\n                throw new MojoExecutionException(\"Unable to generate rewrite result.\", e);\n            }\n            getLog().warn(\"Patch file available:\");\n            getLog().warn(\"    \" + patchFile.normalize());\n            getLog().warn(\"Estimate time saved: \" + formatDuration(estimateTimeSaved));\n            getLog().warn(\"Run 'mvn rewrite:run' to apply the recipes.\");\n\n            if (failOnDryRunResults) {\n                throw new MojoExecutionException(\"Applying recipes would make changes. See logs for more details.\");\n            }\n        } else {\n            getLog().info(\"Applying recipes would make no changes. No patch file generated.\");\n        }\n        putState(State.PROCESSED);\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.maven.rtinfo.RuntimeInformation;\nimport org.apache.maven.settings.crypto.SettingsDecrypter;\nimport org.eclipse.aether.RepositorySystem;\nimport org.eclipse.aether.artifact.Artifact;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.ExecutionContext;\nimport org.openrewrite.InMemoryExecutionContext;\nimport org.openrewrite.config.ClasspathScanningLoader;\nimport org.openrewrite.config.Environment;\nimport org.openrewrite.config.YamlResourceLoader;\nimport org.openrewrite.ipc.http.HttpSender;\nimport org.openrewrite.ipc.http.HttpUrlConnectionSender;\n\nimport javax.inject.Inject;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.*;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.*;\n\nimport static java.util.Collections.sort;\n\n@SuppressWarnings(\"NotNullFieldNotInitialized\")\npublic abstract class AbstractRewriteMojo extends ConfigurableRewriteMojo {\n\n    @Parameter(defaultValue = \"${project}\", readonly = true, required = true)\n    protected MavenProject project;\n\n    /**\n     * Whether to resolve properties in YAML configuration files, like{@code ${project.artifactId} }.\n     * Default true; set to false to disable.\n     */\n    @Parameter(property = \"rewrite.resolvePropertiesInYaml\", defaultValue = \"true\")\n    protected boolean resolvePropertiesInYaml;\n\n    @Inject\n    protected RuntimeInformation runtime;\n\n    @Inject\n    protected SettingsDecrypter settingsDecrypter;\n\n    @Inject\n    protected RepositorySystem repositorySystem;\n\n    protected Environment environment() throws MojoExecutionException {\n        return environment(getRecipeArtifactCoordinatesClassloader());\n    }\n\n    static class Config {\n        final InputStream inputStream;\n        final URI uri;\n\n        Config(InputStream inputStream, URI uri) {\n            this.inputStream = inputStream;\n            this.uri = uri;\n        }\n    }\n\n    @Nullable\n    Config getConfig() throws IOException {\n        try {\n            URI uri = new URI(configLocation);\n            if (uri.getScheme() != null && uri.getScheme().startsWith(\"http\")) {\n                HttpSender httpSender = new HttpUrlConnectionSender();\n                //noinspection resource\n                return new Config(httpSender.get(configLocation).send().getBody(), uri);\n            }\n        } catch (URISyntaxException e) {\n            // Try to load as a path\n        }\n\n        Path absoluteConfigLocation = Paths.get(configLocation);\n        if (!absoluteConfigLocation.isAbsolute()) {\n            absoluteConfigLocation = project.getBasedir().toPath().resolve(configLocation);\n        }\n        File rewriteConfig = absoluteConfigLocation.toFile();\n\n        if (rewriteConfig.exists()) {\n            return new Config(Files.newInputStream(rewriteConfig.toPath()), rewriteConfig.toURI());\n        }\n        getLog().debug(\"No rewrite configuration found at \" + absoluteConfigLocation);\n\n        return null;\n    }\n\n    protected Environment environment(@Nullable ClassLoader recipeClassLoader) throws MojoExecutionException {\n        @Nullable Properties propertiesToResolve;\n        if (resolvePropertiesInYaml) {\n            Properties userProperties = mavenSession.getUserProperties();\n            if (userProperties.isEmpty()) {\n                propertiesToResolve = project.getProperties();\n            } else {\n                propertiesToResolve = new Properties(project.getProperties());\n                for (Map.Entry<Object, Object> entry : userProperties.entrySet()) {\n                    propertiesToResolve.put(entry.getKey(), entry.getValue());\n                }\n            }\n        } else {\n            propertiesToResolve = null;\n        }\n        Environment.Builder env = Environment.builder(propertiesToResolve);\n        if (recipeClassLoader == null) {\n            env.scanRuntimeClasspath()\n                    .scanUserHome();\n        } else {\n            env.load(new ClasspathScanningLoader(propertiesToResolve, recipeClassLoader));\n        }\n\n        try {\n            Config rewriteConfig = getConfig();\n            if (rewriteConfig != null) {\n                try (InputStream is = rewriteConfig.inputStream) {\n                    env.load(new YamlResourceLoader(is, rewriteConfig.uri, propertiesToResolve));\n                }\n            }\n        } catch (IOException e) {\n            throw new MojoExecutionException(\"Unable to load rewrite configuration\", e);\n        }\n\n        return env.build();\n    }\n\n    protected ExecutionContext executionContext(List<Throwable> throwables) {\n        return new InMemoryExecutionContext(t -> {\n            getLog().debug(t);\n            throwables.add(t);\n        });\n    }\n\n    protected Path getBuildRoot() {\n        Path localRepositoryFolder = Paths.get(mavenSession.getLocalRepository().getBasedir()).normalize();\n        Set<Path> baseFolders = new HashSet<>();\n\n        for (MavenProject project : mavenSession.getAllProjects()) {\n            collectBasePaths(project, baseFolders, localRepositoryFolder);\n        }\n\n        if (!baseFolders.isEmpty()) {\n            List<Path> sortedPaths = new ArrayList<>(baseFolders);\n            sort(sortedPaths);\n            return sortedPaths.get(0);\n        }\n        return Paths.get(mavenSession.getExecutionRootDirectory());\n    }\n\n    private void collectBasePaths(MavenProject project, Set<Path> paths, Path localRepository) {\n        Path baseDir = project.getBasedir() == null ? null : project.getBasedir().toPath().normalize();\n        if (baseDir == null || baseDir.startsWith(localRepository) || paths.contains(baseDir)) {\n            return;\n        }\n\n        paths.add(baseDir);\n\n        MavenProject parent = project.getParent();\n        while (parent != null && parent.getBasedir() != null) {\n            collectBasePaths(parent, paths, localRepository);\n            parent = parent.getParent();\n        }\n    }\n\n    protected @Nullable URLClassLoader getRecipeArtifactCoordinatesClassloader() throws MojoExecutionException {\n        if (getRecipeArtifactCoordinates().isEmpty()) {\n            return null;\n        }\n        ArtifactResolver resolver = new ArtifactResolver(repositorySystem, mavenSession);\n\n        Set<Artifact> artifacts = new HashSet<>();\n        for (String coordinate : getRecipeArtifactCoordinates()) {\n            artifacts.add(resolver.createArtifact(coordinate));\n        }\n\n        Set<Artifact> resolvedArtifacts = resolver.resolveArtifactsAndDependencies(artifacts);\n        URL[] urls = resolvedArtifacts.stream()\n                .map(Artifact::getFile)\n                .map(File::toURI)\n                .map(uri -> {\n                    try {\n                        return uri.toURL();\n                    } catch (MalformedURLException e) {\n                        throw new RuntimeException(\"Failed to resolve artifacts from rewrite.recipeArtifactCoordinates\", e);\n                    }\n                })\n                .toArray(URL[]::new);\n\n        return new URLClassLoader(\n                urls,\n                AbstractRewriteMojo.class.getClassLoader()\n        );\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/AbstractRewriteRunMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.openrewrite.ExecutionContext;\nimport org.openrewrite.FileAttributes;\nimport org.openrewrite.PrintOutputCapture;\nimport org.openrewrite.Result;\nimport org.openrewrite.binary.Binary;\nimport org.openrewrite.quark.Quark;\nimport org.openrewrite.remote.Remote;\n\nimport java.io.*;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Run the configured recipes and apply the changes locally.\n * <p>\n * Base mojo for rewrite:run and rewrite:runNoFork.\n */\npublic class AbstractRewriteRunMojo extends AbstractRewriteBaseRunMojo {\n\n    @Override\n    public void execute() throws MojoExecutionException, MojoFailureException {\n        if (rewriteSkip) {\n            getLog().info(\"Skipping execution\");\n            putState(State.SKIPPED);\n            return;\n        }\n        putState(State.TO_BE_PROCESSED);\n\n        // If the plugin is configured to run over all projects (at the end of the build) only proceed if the plugin\n        // is being run on the last project.\n        if (!runPerSubmodule && !allProjectsMarked()) {\n            getLog().info(\"REWRITE: Delaying execution to the end of multi-module project for \" +\n                project.getGroupId() + \":\" +\n                project.getArtifactId()+ \":\" +\n                project.getVersion());\n            return;\n        }\n\n        List<Throwable> throwables = new ArrayList<>();\n        ExecutionContext ctx = executionContext(throwables);\n\n        ResultsContainer results = listResults(ctx);\n\n        RuntimeException firstException = results.getFirstException();\n        if (firstException != null) {\n            getLog().error(\"The recipe produced an error. Please report this to the recipe author.\");\n            throw firstException;\n        }\n        if (!throwables.isEmpty()) {\n            getLog().warn(\"The recipe produced \" + throwables.size() + \" warning(s). Please report this to the recipe author.\");\n            if (!getLog().isDebugEnabled() && !exportDatatables) {\n                getLog().warn(\"Run with `--debug` or `-Drewrite.exportDatatables=true` to see all warnings.\", throwables.get(0));\n            }\n        }\n\n        if (results.isNotEmpty()) {\n            Duration estimateTimeSaved = Duration.ZERO;\n            for (Result result : results.generated) {\n                assert result.getAfter() != null;\n                log(recipeChangeLogLevel, \"Generated new file \" +\n                                          result.getAfter().getSourcePath().normalize() +\n                                          \" by:\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n            for (Result result : results.deleted) {\n                assert result.getBefore() != null;\n                log(recipeChangeLogLevel, \"Deleted file \" +\n                                          result.getBefore().getSourcePath().normalize() +\n                                          \" by:\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n            for (Result result : results.moved) {\n                assert result.getAfter() != null;\n                assert result.getBefore() != null;\n                log(recipeChangeLogLevel, \"File has been moved from \" +\n                                          result.getBefore().getSourcePath().normalize() + \" to \" +\n                                          result.getAfter().getSourcePath().normalize() + \" by:\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n            for (Result result : results.refactoredInPlace) {\n                assert result.getBefore() != null;\n                log(recipeChangeLogLevel, \"Changes have been made to \" +\n                                          result.getBefore().getSourcePath().normalize() +\n                                          \" by:\");\n                logRecipesThatMadeChanges(result);\n                estimateTimeSaved = estimateTimeSavedSum(result, estimateTimeSaved);\n            }\n\n            log(recipeChangeLogLevel, \"Please review and commit the results.\");\n            log(recipeChangeLogLevel, \"Estimate time saved: \" + formatDuration(estimateTimeSaved));\n\n            try {\n                for (Result result : results.generated) {\n                    assert result.getAfter() != null;\n                    writeAfter(results.getProjectRoot(), result, ctx);\n                }\n                for (Result result : results.deleted) {\n                    assert result.getBefore() != null;\n                    Path originalLocation = results.getProjectRoot().resolve(result.getBefore().getSourcePath()).normalize();\n                    boolean deleteSucceeded = originalLocation.toFile().delete();\n                    if (!deleteSucceeded) {\n                        throw new IOException(\"Unable to delete file \" + originalLocation.toAbsolutePath());\n                    }\n                }\n                for (Result result : results.moved) {\n                    // Should we try to use git to move the file first, and only if that fails fall back to this?\n                    assert result.getBefore() != null;\n                    Path originalLocation = results.getProjectRoot().resolve(result.getBefore().getSourcePath());\n                    File originalParentDir = originalLocation.toFile().getParentFile();\n\n                    assert result.getAfter() != null;\n                    // Ensure directories exist in case something was moved into a hitherto non-existent package\n                    Path afterLocation = results.getProjectRoot().resolve(result.getAfter().getSourcePath());\n                    File afterParentDir = afterLocation.toFile().getParentFile();\n                    // Rename the directory if its name case has been changed, e.g. camel case to lower case.\n                    if (afterParentDir.exists() &&\n                        afterParentDir.getAbsolutePath().equalsIgnoreCase((originalParentDir.getAbsolutePath())) &&\n                        !afterParentDir.getAbsolutePath().equals(originalParentDir.getAbsolutePath())) {\n                        if (!originalParentDir.renameTo(afterParentDir)) {\n                            throw new RuntimeException(\"Unable to rename directory from \" + originalParentDir.getAbsolutePath() + \" To: \" + afterParentDir.getAbsolutePath());\n                        }\n                    } else if (!afterParentDir.exists() && !afterParentDir.mkdirs()) {\n                        throw new RuntimeException(\"Unable to create directory \" + afterParentDir.getAbsolutePath());\n                    }\n                    if (result.getAfter() instanceof Quark) {\n                        // We don't know the contents of a Quark, but we can move it\n                        Files.move(originalLocation, results.getProjectRoot().resolve(result.getAfter().getSourcePath()));\n                    } else {\n                        // On Mac this can return \"false\" even when the file was deleted, so skip the check\n                        //noinspection ResultOfMethodCallIgnored\n                        originalLocation.toFile().delete();\n                        writeAfter(results.getProjectRoot(), result, ctx);\n                    }\n                }\n                for (Result result : results.refactoredInPlace) {\n                    assert result.getBefore() != null;\n                    assert result.getAfter() != null;\n                    writeAfter(results.getProjectRoot(), result, ctx);\n                }\n                List<Path> emptyDirectories = results.newlyEmptyDirectories();\n                if (!emptyDirectories.isEmpty()) {\n                    getLog().info(\"Removing \" + emptyDirectories.size() + \" newly empty directories:\");\n                    for (Path emptyDirectory : emptyDirectories) {\n                        getLog().info(\"  \" + emptyDirectory);\n                        Files.delete(emptyDirectory);\n                    }\n                }\n            } catch (IOException e) {\n                throw new RuntimeException(\"Unable to rewrite source files\", e);\n            }\n        }\n        putState(State.PROCESSED);\n    }\n\n    private static void writeAfter(Path root, Result result, ExecutionContext ctx) {\n        if (result.getAfter() == null || result.getAfter() instanceof Quark) {\n            return;\n        }\n        Path targetPath = root.resolve(result.getAfter().getSourcePath());\n        File targetFile = targetPath.toFile();\n        if (!targetFile.getParentFile().exists()) {\n            //noinspection ResultOfMethodCallIgnored\n            targetFile.getParentFile().mkdirs();\n        }\n        if (result.getAfter() instanceof Binary) {\n            try (FileOutputStream sourceFileWriter = new FileOutputStream(targetFile)) {\n                sourceFileWriter.write(((Binary) result.getAfter()).getBytes());\n            } catch (IOException e) {\n                throw new UncheckedIOException(\"Unable to rewrite source files\", e);\n            }\n        } else if (result.getAfter() instanceof Remote) {\n            Remote remote = (Remote) result.getAfter();\n            try (FileOutputStream sourceFileWriter = new FileOutputStream(targetFile)) {\n                InputStream source = remote.getInputStream(ctx);\n                byte[] buf = new byte[4096];\n                int length;\n                while ((length = source.read(buf)) > 0) {\n                    sourceFileWriter.write(buf, 0, length);\n                }\n            } catch (IOException e) {\n                throw new UncheckedIOException(\"Unable to rewrite source files\", e);\n            }\n        } else if (!(result.getAfter() instanceof Quark)) {\n            // Don't attempt to write to a Quark; it has already been logged as change that has been made\n            Charset charset = result.getAfter().getCharset() == null ? StandardCharsets.UTF_8 : result.getAfter().getCharset();\n            try (BufferedWriter sourceFileWriter = Files.newBufferedWriter(targetPath, charset)) {\n                sourceFileWriter.write(result.getAfter().printAll(new PrintOutputCapture<>(0, new SanitizedMarkerPrinter())));\n            } catch (IOException e) {\n                throw new UncheckedIOException(\"Unable to rewrite source files\", e);\n            }\n        }\n        if (result.getAfter().getFileAttributes() != null) {\n            FileAttributes fileAttributes = result.getAfter().getFileAttributes();\n            if (targetFile.canRead() != fileAttributes.isReadable()) {\n                //noinspection ResultOfMethodCallIgnored\n                targetFile.setReadable(fileAttributes.isReadable());\n            }\n            if (targetFile.canWrite() != fileAttributes.isWritable()) {\n                //noinspection ResultOfMethodCallIgnored\n                targetFile.setWritable(fileAttributes.isWritable());\n            }\n            if (targetFile.canExecute() != fileAttributes.isExecutable()) {\n                //noinspection ResultOfMethodCallIgnored\n                targetFile.setExecutable(fileAttributes.isExecutable());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/ArtifactResolver.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.RepositoryUtils;\nimport org.apache.maven.execution.MavenSession;\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.eclipse.aether.RepositorySystem;\nimport org.eclipse.aether.RepositorySystemSession;\nimport org.eclipse.aether.artifact.Artifact;\nimport org.eclipse.aether.artifact.DefaultArtifact;\nimport org.eclipse.aether.collection.CollectRequest;\nimport org.eclipse.aether.graph.Dependency;\nimport org.eclipse.aether.repository.RemoteRepository;\nimport org.eclipse.aether.resolution.ArtifactResult;\nimport org.eclipse.aether.resolution.DependencyRequest;\nimport org.eclipse.aether.resolution.DependencyResolutionException;\nimport org.eclipse.aether.resolution.DependencyResult;\nimport org.eclipse.aether.util.artifact.JavaScopes;\n\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptySet;\nimport static java.util.stream.Collectors.toList;\n\npublic class ArtifactResolver {\n    private final RepositorySystem repositorySystem;\n    private final RepositorySystemSession repositorySystemSession;\n    private final List<RemoteRepository> remoteRepositories;\n\n    public ArtifactResolver(RepositorySystem repositorySystem, MavenSession session) {\n        this.repositorySystem = repositorySystem;\n        this.repositorySystemSession = session.getRepositorySession();\n        this.remoteRepositories = RepositoryUtils.toRepos(session.getCurrentProject().getRemoteArtifactRepositories());\n    }\n\n    public Artifact createArtifact(String coordinates) throws MojoExecutionException {\n        String[] parts = coordinates.split(\":\");\n        if (parts.length < 3) {\n            throw new MojoExecutionException(\"Must include at least groupId:artifactId:version in artifact coordinates\" + coordinates);\n        }\n\n        return new DefaultArtifact(parts[0], parts[1], null, \"jar\", parts[2]);\n    }\n\n    public Set<Artifact> resolveArtifactsAndDependencies(Set<Artifact> artifacts) throws MojoExecutionException {\n        if (artifacts.isEmpty()) {\n            return emptySet();\n        }\n\n        Set<Artifact> elements = new HashSet<>();\n        try {\n            List<Dependency> dependencies = artifacts.stream().map(a -> new Dependency(a, JavaScopes.RUNTIME)).collect(toList());\n            CollectRequest collectRequest =\n                    new CollectRequest(dependencies, emptyList(), remoteRepositories);\n            DependencyRequest dependencyRequest = new DependencyRequest();\n            dependencyRequest.setCollectRequest(collectRequest);\n            DependencyResult dependencyResult =\n                    repositorySystem.resolveDependencies(repositorySystemSession, dependencyRequest);\n\n            for (ArtifactResult resolved : dependencyResult.getArtifactResults()) {\n                elements.add(resolved.getArtifact());\n            }\n            return elements;\n        } catch (DependencyResolutionException e) {\n            throw new MojoExecutionException(\"Failed to resolve requested artifacts transitive dependencies.\", e);\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/ConfigurableRewriteMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.execution.MavenSession;\nimport org.apache.maven.model.Plugin;\nimport org.apache.maven.plugin.AbstractMojo;\nimport org.apache.maven.plugin.descriptor.PluginDescriptor;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.apache.maven.project.MavenProject;\nimport org.codehaus.plexus.util.xml.Xpp3Dom;\nimport org.codehaus.plexus.util.xml.pull.MXSerializer;\nimport org.intellij.lang.annotations.Language;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.config.Environment;\nimport org.openrewrite.style.NamedStyles;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.StringWriter;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.*;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.emptySet;\nimport static java.util.Collections.unmodifiableSet;\nimport static java.util.stream.Collectors.toCollection;\nimport static org.openrewrite.java.style.CheckstyleConfigLoader.loadCheckstyleConfig;\n\n@SuppressWarnings(\"FieldMayBeFinal\")\npublic abstract class ConfigurableRewriteMojo extends AbstractMojo {\n\n    private static final String CHECKSTYLE_DOCTYPE = \"module PUBLIC \" +\n                                                     \"\\\"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN\\\" \" +\n                                                     \"\\\"https://checkstyle.org/dtds/configuration_1_3.dtd\\\"\";\n\n    @Parameter(property = \"rewrite.configLocation\", alias = \"configLocation\", defaultValue = \"${maven.multiModuleProjectDirectory}/rewrite.yml\")\n    protected String configLocation;\n\n    @Parameter(property = \"rewrite.activeRecipes\")\n    @Nullable\n    protected LinkedHashSet<String> activeRecipes;\n\n    @Parameter(property = \"rewrite.activeStyles\")\n    @Nullable\n    protected LinkedHashSet<String> activeStyles;\n\n    @Parameter(property = \"rewrite.pomCacheEnabled\", alias = \"pomCacheEnabled\", defaultValue = \"true\")\n    protected boolean pomCacheEnabled;\n\n    @Parameter(property = \"rewrite.pomCacheDirectory\", alias = \"pomCacheDirectory\")\n    @Nullable\n    protected String pomCacheDirectory;\n\n    @Parameter(property = \"rewrite.skip\", defaultValue = \"false\")\n    protected boolean rewriteSkip;\n\n    /**\n     * When enabled, skip parsing Maven `pom.xml`s, and any transitive poms, as source files.\n     * This can be an efficiency improvement in certain situations.\n     */\n    @Parameter(property = \"skipMavenParsing\", defaultValue = \"false\")\n    protected boolean skipMavenParsing;\n\n    @Parameter(property = \"rewrite.checkstyleConfigFile\", alias = \"checkstyleConfigFile\")\n    @Nullable\n    protected String checkstyleConfigFile;\n\n    @Parameter(property = \"rewrite.checkstyleDetectionEnabled\", alias = \"checkstyleDetectionEnabled\", defaultValue = \"true\")\n    protected boolean checkstyleDetectionEnabled;\n\n    @Parameter(property = \"rewrite.exclusions\")\n    @Nullable\n    private LinkedHashSet<String> exclusions;\n\n    protected Set<String> getExclusions() {\n        return getCleanedSet(exclusions);\n    }\n\n    /**\n     * Override default plain text masks. If this is specified,\n     * {@code rewrite.additionalPlainTextMasks} will have no effect.\n     */\n    @Parameter(property = \"rewrite.plainTextMasks\")\n    @Nullable\n    private LinkedHashSet<String> plainTextMasks;\n\n    /**\n     * Allows adding additional plain text masks without overriding\n     * the defaults.\n     */\n    @Parameter(property = \"rewrite.additionalPlainTextMasks\")\n    @Nullable\n    private LinkedHashSet<String> additionalPlainTextMasks;\n\n    protected Set<String> getPlainTextMasks() {\n        Set<String> masks = getCleanedSet(plainTextMasks);\n        if (!masks.isEmpty()) {\n            return masks;\n        }\n        //If not defined, use a default set of masks\n        masks = new HashSet<>(Arrays.asList(\n                \"**/*.adoc\",\n                \"**/*.aj\",\n                \"**/*.bash\",\n                \"**/*.bat\",\n                \"**/CODEOWNERS\",\n                \"**/*.css\",\n                \"**/*.config\",\n                \"**/[dD]ockerfile*\",\n                \"**/*.[dD]ockerfile\",\n                \"**/*[cC]ontainerfile*\",\n                \"**/*.[cC]ontainerfile\",\n                \"**/*.env\",\n                \"**/.gitattributes\",\n                \"**/.gitignore\",\n                \"**/*.htm*\",\n                \"**/gradlew\",\n                \"**/.java-version\",\n                \"**/*.jelly\",\n                \"**/*.jsp\",\n                \"**/*.ksh\",\n                \"**/*.lock\",\n                \"**/lombok.config\",\n                \"**/[mM]akefile\",\n                \"**/*.md\",\n                \"**/*.mf\",\n                \"**/META-INF/services/**\",\n                \"**/META-INF/spring/**\",\n                \"**/META-INF/spring.factories\",\n                \"**/mvnw\",\n                \"**/mvnw.cmd\",\n                \"**/*.qute.java\",\n                \"**/.sdkmanrc\",\n                \"**/*.sh\",\n                \"**/*.sql\",\n                \"**/*.svg\",\n                \"**/*.tsx\",\n                \"**/*.txt\",\n                \"**/*.py\"\n        ));\n        masks.addAll(getCleanedSet(additionalPlainTextMasks));\n        return unmodifiableSet(masks);\n    }\n\n    @Parameter(property = \"sizeThresholdMb\", defaultValue = \"10\")\n    protected int sizeThresholdMb;\n\n    /**\n     * Whether to throw an exception if an activeRecipe fails configuration validation.\n     * This may happen if the activeRecipe is improperly configured, or any downstream recipes are improperly configured.\n     * <p>\n     * For the time, this default is \"false\" to prevent one improper recipe from failing the build.\n     * In the future, this default may be changed to \"true\" to be more restrictive.\n     */\n    @Parameter(property = \"rewrite.failOnInvalidActiveRecipes\", alias = \"failOnInvalidActiveRecipes\", defaultValue = \"false\")\n    protected boolean failOnInvalidActiveRecipes;\n\n    @Parameter(property = \"rewrite.runPerSubmodule\", alias = \"runPerSubmodule\", defaultValue = \"false\")\n    protected boolean runPerSubmodule;\n\n    @Parameter(defaultValue = \"${session}\", readonly = true)\n    protected MavenSession mavenSession;\n\n    @Parameter(defaultValue = \"${plugin}\", required = true, readonly = true)\n    protected PluginDescriptor pluginDescriptor;\n\n    protected enum State {\n        SKIPPED,\n        PROCESSED,\n        TO_BE_PROCESSED\n    }\n\n    private static final String OPENREWRITE_PROCESSED_MARKER = \"openrewrite.processed\";\n\n    protected void putState(State state) {\n        //noinspection unchecked\n        getPluginContext().put(OPENREWRITE_PROCESSED_MARKER, state.name());\n    }\n\n    private boolean hasState(MavenProject project) {\n        Map<String, Object> pluginContext = mavenSession.getPluginContext(pluginDescriptor, project);\n        return pluginContext.containsKey(OPENREWRITE_PROCESSED_MARKER);\n    }\n\n    protected boolean allProjectsMarked() {\n        return mavenSession.getProjects().stream().allMatch(this::hasState);\n    }\n\n    @Parameter(property = \"rewrite.recipeArtifactCoordinates\")\n    @Nullable\n    private LinkedHashSet<String> recipeArtifactCoordinates;\n\n    @Nullable\n    private volatile Set<String> computedRecipes;\n\n    @Nullable\n    private volatile Set<String> computedStyles;\n\n    @Nullable\n    private volatile Set<String> computedRecipeArtifactCoordinates;\n\n    protected Set<String> getActiveRecipes() {\n        if (computedRecipes == null) {\n            synchronized (this) {\n                if (computedRecipes == null) {\n                    computedRecipes = getCleanedSet(activeRecipes);\n                }\n            }\n        }\n        //noinspection ConstantConditions\n        return computedRecipes;\n    }\n\n    protected Set<String> getActiveStyles() {\n        if (computedStyles == null) {\n            synchronized (this) {\n                if (computedStyles == null) {\n                    computedStyles = getCleanedSet(activeStyles);\n                }\n            }\n        }\n        //noinspection ConstantConditions\n        return computedStyles;\n    }\n\n    protected List<NamedStyles> loadStyles(MavenProject project, Environment env) {\n        List<NamedStyles> styles = env.activateStyles(getActiveStyles());\n        try {\n            Plugin checkstylePlugin = project.getPlugin(\"org.apache.maven.plugins:maven-checkstyle-plugin\");\n            if (checkstyleConfigFile != null && !checkstyleConfigFile.isEmpty()) {\n                styles.add(loadCheckstyleConfig(Paths.get(checkstyleConfigFile), emptyMap()));\n            } else if (checkstyleDetectionEnabled && checkstylePlugin != null) {\n                Object checkstyleConfRaw = checkstylePlugin.getConfiguration();\n                if (checkstyleConfRaw instanceof Xpp3Dom) {\n                    Xpp3Dom xmlCheckstyleConf = (Xpp3Dom) checkstyleConfRaw;\n                    Xpp3Dom xmlConfigLocation = xmlCheckstyleConf.getChild(\"configLocation\");\n                    Xpp3Dom xmlCheckstyleRules = xmlCheckstyleConf.getChild(\"checkstyleRules\");\n                    if (xmlConfigLocation != null) {\n                        // resolve location against plugin location (could be in parent pom)\n                        Path configPath = Paths.get(checkstylePlugin.getLocation(\"\").getSource().getLocation())\n                                .resolveSibling(xmlConfigLocation.getValue());\n                        if (configPath.toFile().exists()) {\n                            styles.add(loadCheckstyleConfig(configPath, emptyMap()));\n                        }\n                    } else if (xmlCheckstyleRules != null && xmlCheckstyleRules.getChildCount() > 0) {\n                        styles.add(loadCheckstyleConfig(toCheckStyleDocument(xmlCheckstyleRules.getChild(0)), emptyMap()));\n                    } else {\n                        // When no config location is specified, the maven-checkstyle-plugin falls back on sun_checks.xml\n                        try (InputStream is = org.openrewrite.tools.checkstyle.Checker.class.getResourceAsStream(\"/sun_checks.xml\")) {\n                            if (is != null) {\n                                styles.add(loadCheckstyleConfig(is, emptyMap()));\n                            }\n                        }\n                    }\n                }\n            }\n        } catch (Exception e) {\n            getLog().warn(\"Unable to parse checkstyle configuration. Checkstyle will not inform rewrite execution.\", e);\n        }\n        return styles;\n    }\n\n    private @Language(\"XML\") String toCheckStyleDocument(final Xpp3Dom dom) throws IOException {\n        StringWriter stringWriter = new StringWriter();\n\n        MXSerializer serializer = new MXSerializer();\n        serializer.setOutput(stringWriter);\n        serializer.docdecl(CHECKSTYLE_DOCTYPE);\n\n        dom.writeToSerializer(\"\", serializer);\n\n        return stringWriter.toString();\n    }\n\n    protected Set<String> getRecipeArtifactCoordinates() {\n        if (computedRecipeArtifactCoordinates == null) {\n            synchronized (this) {\n                if (computedRecipeArtifactCoordinates == null) {\n                    computedRecipeArtifactCoordinates = getCleanedSet(recipeArtifactCoordinates);\n                }\n            }\n        }\n        //noinspection ConstantConditions\n        return computedRecipeArtifactCoordinates;\n    }\n\n    private static Set<String> getCleanedSet(@Nullable Set<@Nullable String> set) {\n        if (set == null) {\n            return emptySet();\n        }\n        Set<String> cleaned = set.stream()\n                .filter(Objects::nonNull)\n                .map(String::trim)\n                .filter(s -> !s.isEmpty())\n                .collect(toCollection(LinkedHashSet::new));\n        return unmodifiableSet(cleaned);\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/LogLevel.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\npublic enum LogLevel {\n    DEBUG,\n    INFO,\n    WARN,\n    ERROR\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/MavenLoggingMeterRegistry.java",
    "content": "/*\r\n * Copyright 2020 the original author or authors.\r\n * <p>\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * <p>\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n * <p>\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\npackage org.openrewrite.maven;\r\n\r\nimport io.micrometer.core.instrument.*;\r\nimport io.micrometer.core.instrument.binder.BaseUnits;\r\nimport io.micrometer.core.instrument.cumulative.*;\r\nimport io.micrometer.core.instrument.distribution.DistributionStatisticConfig;\r\nimport io.micrometer.core.instrument.distribution.HistogramSnapshot;\r\nimport io.micrometer.core.instrument.distribution.pause.PauseDetector;\r\nimport io.micrometer.core.instrument.internal.DefaultGauge;\r\nimport io.micrometer.core.instrument.internal.DefaultLongTaskTimer;\r\nimport io.micrometer.core.instrument.internal.DefaultMeter;\r\nimport io.micrometer.core.instrument.util.TimeUtils;\r\nimport org.apache.maven.plugin.logging.Log;\nimport org.jspecify.annotations.NullMarked;\nimport org.jspecify.annotations.Nullable;\r\n\r\nimport java.time.Duration;\r\nimport java.util.concurrent.TimeUnit;\r\nimport java.util.function.ToDoubleFunction;\r\nimport java.util.function.ToLongFunction;\r\nimport java.util.stream.StreamSupport;\r\n\r\nimport static io.micrometer.core.instrument.util.DoubleFormat.decimalOrNan;\r\nimport static java.util.stream.Collectors.joining;\n\n@NullMarked\npublic class MavenLoggingMeterRegistry extends MeterRegistry {\r\n    private final Log log;\r\n\r\n    public MavenLoggingMeterRegistry(Log log) {\r\n        super(Clock.SYSTEM);\r\n        this.log = log;\r\n    }\n\n    @Override\n    public void close() {\r\n        getMeters().stream()\r\n                .sorted((m1, m2) -> {\r\n                    int typeComp = m1.getId().getType().compareTo(m2.getId().getType());\r\n                    if (typeComp == 0) {\r\n                        return m1.getId().getName().compareTo(m2.getId().getName());\r\n                    }\r\n                    return typeComp;\r\n                })\r\n                .forEach(m -> {\r\n                    Printer print = new Printer(m);\r\n                    m.use(\r\n                            gauge -> log.info(print.id() + \" value=\" + print.value(gauge.value())),\r\n                            counter -> {\r\n                                double count = counter.count();\r\n                                log.info(print.id() + \" count=\" + print.count(count));\r\n                            },\r\n                            timer -> {\r\n                                HistogramSnapshot snapshot = timer.takeSnapshot();\r\n                                long count = snapshot.count();\r\n                                log.info(print.id() + \" count=\" + print.unitlessCount(count) +\r\n                                        \" mean=\" + print.time(snapshot.mean(getBaseTimeUnit())) +\r\n                                        \" max=\" + print.time(snapshot.max(getBaseTimeUnit())));\r\n                            },\r\n                            summary -> {\r\n                                HistogramSnapshot snapshot = summary.takeSnapshot();\r\n                                long count = snapshot.count();\r\n                                log.info(print.id() + \" count=\" + print.unitlessCount(count) +\r\n                                        \" mean=\" + print.value(snapshot.mean()) +\r\n                                        \" max=\" + print.value(snapshot.max()));\r\n                            },\r\n                            longTaskTimer -> {\r\n                                int activeTasks = longTaskTimer.activeTasks();\r\n                                log.info(print.id() +\r\n                                        \" active=\" + print.value(activeTasks) +\r\n                                        \" duration=\" + print.time(longTaskTimer.duration(getBaseTimeUnit())));\r\n                            },\r\n                            timeGauge -> {\r\n                                double value = timeGauge.value(getBaseTimeUnit());\r\n                                log.info(print.id() + \" value=\" + print.time(value));\r\n                            },\r\n                            counter -> {\r\n                                double count = counter.count();\r\n                                log.info(print.id() + \" count=\" + print.count(count));\r\n                            },\r\n                            timer -> {\r\n                                double count = timer.count();\r\n                                log.info(print.id() + \" count=\" + print.count(count) +\r\n                                        \" mean=\" + print.time(timer.mean(getBaseTimeUnit())));\r\n                            },\r\n                            meter -> log.info(writeMeter(meter, print))\r\n                    );\r\n                });\r\n    }\r\n\r\n    String writeMeter(Meter meter, Printer print) {\r\n        return StreamSupport.stream(meter.measure().spliterator(), false)\r\n                .map(ms -> {\r\n                    String msLine = ms.getStatistic().getTagValueRepresentation() + \"=\";\r\n                    switch (ms.getStatistic()) {\r\n                        case TOTAL:\r\n                        case MAX:\r\n                        case VALUE:\r\n                            return msLine + print.value(ms.getValue());\r\n                        case TOTAL_TIME:\r\n                        case DURATION:\r\n                            return msLine + print.time(ms.getValue());\r\n                        case COUNT:\r\n                            return \"count=\" + print.count(ms.getValue());\r\n                        default:\r\n                            return msLine + decimalOrNan(ms.getValue());\r\n                    }\r\n                })\r\n                .collect(joining(\", \", print.id() + \" \", \"\"));\r\n    }\r\n\r\n    @Override\r\n    protected Timer newTimer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetector) {\r\n        return new CumulativeTimer(id, clock, distributionStatisticConfig, pauseDetector, getBaseTimeUnit(), false);\r\n    }\r\n\r\n    @Override\r\n    protected DistributionSummary newDistributionSummary(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, double scale) {\r\n        return new CumulativeDistributionSummary(id, clock, distributionStatisticConfig, scale, false);\r\n    }\r\n\r\n    @Override\r\n    protected Counter newCounter(Meter.Id id) {\r\n        return new CumulativeCounter(id);\r\n    }\r\n\r\n    @Override\r\n    protected <T> Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {\r\n        return new DefaultGauge<>(id, obj, valueFunction);\r\n    }\r\n\r\n    @Override\r\n    protected <T> FunctionTimer newFunctionTimer(Meter.Id id, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalTimeFunction, TimeUnit totalTimeFunctionUnit) {\r\n        return new CumulativeFunctionTimer<>(id, obj, countFunction, totalTimeFunction, totalTimeFunctionUnit, getBaseTimeUnit());\r\n    }\r\n\r\n    @Override\r\n    protected <T> FunctionCounter newFunctionCounter(Meter.Id id, T obj, ToDoubleFunction<T> countFunction) {\r\n        return new CumulativeFunctionCounter<>(id, obj, countFunction);\r\n    }\r\n\r\n    @Override\r\n    protected LongTaskTimer newLongTaskTimer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig) {\r\n        return new DefaultLongTaskTimer(id, clock, getBaseTimeUnit(), distributionStatisticConfig, false);\r\n    }\r\n\r\n    @Override\r\n    protected Meter newMeter(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements) {\r\n        return new DefaultMeter(id, type, measurements);\r\n    }\r\n\r\n    @Override\r\n    protected DistributionStatisticConfig defaultHistogramConfig() {\r\n        return DistributionStatisticConfig.builder()\r\n                .expiry(Duration.ofMinutes(1))\r\n                .bufferLength(3)\r\n                .build();\r\n    }\r\n\r\n    class Printer {\r\n        private final Meter meter;\r\n\r\n        Printer(Meter meter) {\r\n            this.meter = meter;\r\n        }\r\n\r\n        String id() {\r\n            return getConventionName(meter.getId()) + getConventionTags(meter.getId()).stream()\r\n                    .map(t -> t.getKey() + \"=\" + t.getValue())\r\n                    .collect(joining(\",\", \"{\", \"}\"));\r\n        }\r\n\r\n        String count(double count) {\r\n            return humanReadableBaseUnit(count);\r\n        }\r\n\r\n        String unitlessCount(double count) {\r\n            return decimalOrNan(count);\r\n        }\r\n\r\n        String time(double time) {\r\n            return TimeUtils.format(Duration.ofNanos((long) TimeUtils.convert(time, getBaseTimeUnit(), TimeUnit.NANOSECONDS)));\r\n        }\r\n\r\n        String value(double value) {\r\n            return humanReadableBaseUnit(value);\r\n        }\r\n\r\n        // see https://stackoverflow.com/a/3758880/510017\r\n        @SuppressWarnings(\"StringConcatenationMissingWhitespace\")\r\n        String humanReadableByteCount(double bytes) {\r\n            int unit = 1024;\r\n            if (bytes < unit || Double.isNaN(bytes)) {\r\n                return decimalOrNan(bytes) + \" B\";\r\n            }\r\n            int exp = (int) (Math.log(bytes) / Math.log(unit));\r\n            String pre = \"KMGTPE\".charAt(exp - 1) + \"i\";\r\n            return decimalOrNan(bytes / Math.pow(unit, exp)) + \" \" + pre + \"B\";\r\n        }\r\n\r\n        String humanReadableBaseUnit(double value) {\r\n            String baseUnit = meter.getId().getBaseUnit();\r\n            if (BaseUnits.BYTES.equals(baseUnit)) {\r\n                return humanReadableByteCount(value);\r\n            }\r\n            return decimalOrNan(value) + (baseUnit != null ? \" \" + baseUnit : \"\");\r\n        }\r\n    }\r\n\r\n    @Override\r\n    protected TimeUnit getBaseTimeUnit() {\r\n        return TimeUnit.MILLISECONDS;\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/MavenLoggingResolutionEventListener.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.logging.Log;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.maven.tree.*;\n\nimport java.util.List;\n\nclass MavenLoggingResolutionEventListener implements ResolutionEventListener {\n\n    private final Log logger;\n\n    public MavenLoggingResolutionEventListener(Log logger) {\n        this.logger = logger;\n    }\n\n    @Override\n    public void downloadSuccess(ResolvedGroupArtifactVersion gav, @Nullable ResolvedPom containing) {\n        if (logger.isDebugEnabled()) {\n            logger.debug(\"Downloaded \" + gav + pomContaining(containing));\n        }\n    }\n\n    @Override\n    public void downloadError(GroupArtifactVersion gav, List<String> attemptedUris, @Nullable Pom containing) {\n        StringBuilder sb = new StringBuilder(\"Failed to download \" + gav + pomContaining(containing) + \". Attempted URIs:\");\n        attemptedUris.forEach(uri -> sb.append(\"\\n  - \").append(uri));\n        logger.warn(sb);\n    }\n\n    @Override\n    public void repositoryAccessFailed(String uri, Throwable e) {\n        logger.warn(\"Failed to access maven repository \" + uri + \" due to: \" + e.getMessage());\n        logger.debug(e);\n    }\n\n    private static String pomContaining(@Nullable Pom containing) {\n        return containing != null ? \" from \" + containing.getGav() : \"\";\n    }\n\n    private static String pomContaining(@Nullable ResolvedPom containing) {\n        return containing != null ? \" from \" + containing.getGav() : \"\";\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport org.apache.maven.artifact.DependencyResolutionRequiredException;\nimport org.apache.maven.execution.MavenExecutionRequest;\nimport org.apache.maven.execution.MavenSession;\nimport org.apache.maven.model.Plugin;\nimport org.apache.maven.model.PluginExecution;\nimport org.apache.maven.model.PluginManagement;\nimport org.apache.maven.model.Repository;\nimport org.apache.maven.model.Resource;\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.apache.maven.plugin.logging.Log;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.maven.rtinfo.RuntimeInformation;\nimport org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;\nimport org.apache.maven.settings.crypto.SettingsDecrypter;\nimport org.apache.maven.settings.crypto.SettingsDecryptionRequest;\nimport org.apache.maven.settings.crypto.SettingsDecryptionResult;\nimport org.codehaus.plexus.util.xml.Xpp3Dom;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.ExecutionContext;\nimport org.openrewrite.HttpSenderExecutionContextView;\nimport org.openrewrite.ParseExceptionResult;\nimport org.openrewrite.PathUtils;\nimport org.openrewrite.SourceFile;\nimport org.openrewrite.groovy.GroovyParser;\nimport org.openrewrite.internal.GitIgnore;\nimport org.openrewrite.internal.StringUtils;\nimport org.openrewrite.ipc.http.HttpUrlConnectionSender;\nimport org.openrewrite.java.JavaParser;\nimport org.openrewrite.java.internal.JavaTypeCache;\nimport org.openrewrite.java.marker.JavaProject;\nimport org.openrewrite.java.marker.JavaSourceSet;\nimport org.openrewrite.java.marker.JavaVersion;\nimport org.openrewrite.jgit.api.Git;\nimport org.openrewrite.jgit.lib.ObjectId;\nimport org.openrewrite.jgit.revwalk.RevCommit;\nimport org.openrewrite.jgit.revwalk.RevWalk;\nimport org.openrewrite.jgit.treewalk.TreeWalk;\nimport org.openrewrite.jgit.treewalk.filter.PathFilter;\nimport org.openrewrite.kotlin.KotlinParser;\nimport org.openrewrite.marker.*;\nimport org.openrewrite.marker.ci.BuildEnvironment;\nimport org.openrewrite.maven.cache.InMemoryMavenPomCache;\nimport org.openrewrite.maven.cache.MavenPomCache;\nimport org.openrewrite.maven.internal.MavenXmlMapper;\nimport org.openrewrite.maven.internal.RawPom;\nimport org.openrewrite.maven.internal.RawRepositories;\nimport org.openrewrite.maven.tree.Pom;\nimport org.openrewrite.maven.tree.ProfileActivation;\nimport org.openrewrite.maven.tree.ResolvedGroupArtifactVersion;\nimport org.openrewrite.maven.utilities.MavenWrapper;\nimport org.openrewrite.polyglot.OmniParser;\nimport org.openrewrite.quark.QuarkParser;\nimport org.openrewrite.style.NamedStyles;\nimport org.openrewrite.text.PlainTextParser;\nimport org.openrewrite.xml.tree.Xml;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.UncheckedIOException;\nimport java.net.Authenticator;\nimport java.net.InetSocketAddress;\nimport java.net.PasswordAuthentication;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.*;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.time.Duration;\nimport java.util.*;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.function.Function;\nimport java.util.function.Supplier;\nimport java.util.function.UnaryOperator;\nimport java.util.regex.Pattern;\nimport java.util.stream.Stream;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonList;\nimport static java.util.Collections.singletonMap;\nimport static java.util.stream.Collectors.joining;\nimport static java.util.stream.Collectors.toList;\nimport static java.util.stream.Collectors.toMap;\nimport static java.util.stream.Collectors.toSet;\nimport static org.openrewrite.PathUtils.separatorsToUnix;\nimport static org.openrewrite.Tree.randomId;\nimport static org.openrewrite.maven.MavenMojoProjectParser.MavenScope.MAIN;\nimport static org.openrewrite.maven.MavenMojoProjectParser.MavenScope.TEST;\nimport static org.openrewrite.tree.ParsingExecutionContextView.view;\n\n// -----------------------------------------------------------------------------------------------------------------\n// Notes About Provenance Information:\n//\n// There are always three markers applied to each source file and there can potentially be up to five provenance markers\n// total:\n//\n// BuildTool     - What build tool was used to compile the source file (This will always be Maven)\n// JavaVersion   - What Java version/vendor was used when compiling the source file.\n// JavaProject   - For each maven module/submodule, the same JavaProject will be associated with ALL source files belonging to that module.\n//\n// Optional:\n//\n// GitProvenance - If the project exists in the context of a git repository, all source files (for all modules) will have the same GitProvenance.\n// JavaSourceSet - All Java source files and all resource files that exist in src/main or src/test will have a JavaSourceSet marker assigned to them.\n// -----------------------------------------------------------------------------------------------------------------\npublic class MavenMojoProjectParser {\n\n    private static final String MVN_JVM_CONFIG = \".mvn/jvm.config\";\n    private static final String MVN_MAVEN_CONFIG = \".mvn/maven.config\";\n    private static final String MAVEN_COMPILER_PLUGIN = \"org.apache.maven.plugins:maven-compiler-plugin\";\n\n    @Nullable\n    public static MavenPomCache POM_CACHE;\n\n    private final Log logger;\n    private final AtomicBoolean firstWarningLogged = new AtomicBoolean(false);\n    private final Path baseDir;\n    private final org.openrewrite.jgit.lib.@Nullable Repository repository;\n    private final boolean pomCacheEnabled;\n\n    @Nullable\n    private final String pomCacheDirectory;\n\n    private final boolean skipMavenParsing;\n\n    private final BuildTool buildTool;\n\n    private final Collection<String> exclusions;\n    private final Collection<String> plainTextMasks;\n    private final int sizeThresholdMb;\n    private final MavenSession mavenSession;\n    private final SettingsDecrypter settingsDecrypter;\n    private final boolean runPerSubmodule;\n    private final boolean parseAdditionalResources;\n\n    @SuppressWarnings(\"BooleanParameter\")\n    public MavenMojoProjectParser(Log logger, Path baseDir, boolean pomCacheEnabled, @Nullable String pomCacheDirectory, RuntimeInformation runtime, boolean skipMavenParsing, Collection<String> exclusions, Collection<String> plainTextMasks, int sizeThresholdMb, MavenSession session, SettingsDecrypter settingsDecrypter, boolean runPerSubmodule, boolean parseAdditionalResources) {\n        this.logger = logger;\n        this.baseDir = baseDir;\n        this.repository = getRepository(baseDir);\n        this.pomCacheEnabled = pomCacheEnabled;\n        this.pomCacheDirectory = pomCacheDirectory;\n        this.skipMavenParsing = skipMavenParsing;\n        this.buildTool = new BuildTool(randomId(), BuildTool.Type.Maven, runtime.getMavenVersion());\n        this.exclusions = exclusions;\n        this.plainTextMasks = plainTextMasks;\n        this.sizeThresholdMb = sizeThresholdMb;\n        this.mavenSession = session;\n        this.settingsDecrypter = settingsDecrypter;\n        this.runPerSubmodule = runPerSubmodule;\n        this.parseAdditionalResources = parseAdditionalResources;\n    }\n\n    protected JavaTypeCache createTypeCache() {\n        return new JavaTypeCache();\n    }\n\n    public Stream<SourceFile> listSourceFiles(MavenProject mavenProject, List<NamedStyles> styles,\n                                              ExecutionContext ctx) throws DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException {\n        if (runPerSubmodule) {\n            //If running per submodule, parse the source files for only the current project.\n            List<Marker> projectProvenance = generateProvenance(mavenProject);\n            Xml.Document maven = parseMaven(mavenProject, projectProvenance, ctx);\n            return listSourceFiles(mavenProject, maven, projectProvenance, styles, ctx);\n        }\n        //If running across all projects, iterate and parse source files from each project\n        Map<MavenProject, List<Marker>> projectProvenances = mavenSession.getProjects().stream()\n          .collect(toMap(Function.identity(), this::generateProvenance));\n        Map<MavenProject, Xml.Document> projectMap = parseMaven(mavenSession.getProjects(), projectProvenances, ctx);\n        return mavenSession.getProjects().stream()\n          .flatMap(project -> {\n              List<Marker> projectProvenance = projectProvenances.get(project);\n              try {\n                  return listSourceFiles(project, projectMap.get(project), projectProvenance, styles, ctx);\n              } catch (DependencyResolutionRequiredException | MojoExecutionException e) {\n                  throw sneakyThrow(e);\n              }\n          });\n    }\n\n    public Stream<SourceFile> listSourceFiles(MavenProject mavenProject, Xml.@Nullable Document maven, List<Marker> projectProvenance, List<NamedStyles> styles,\n                                              ExecutionContext ctx) throws DependencyResolutionRequiredException, MojoExecutionException {\n        return listSourceFiles(mavenProject, maven, projectProvenance, Arrays.asList(MAIN, TEST),  styles, ctx);\n    }\n\n    public Stream<SourceFile> listSourceFiles(MavenProject mavenProject, Xml.@Nullable Document maven, List<Marker> projectProvenance, List<MavenScope> scopes,\n                List<NamedStyles> styles, ExecutionContext ctx) throws DependencyResolutionRequiredException, MojoExecutionException {\n        Stream<SourceFile> sourceFiles = Stream.empty();\n        Set<Path> parsedPaths = new HashSet<>();\n\n        if (maven != null) {\n            sourceFiles = Stream.of(maven);\n            parsedPaths.add(baseDir.resolve(maven.getSourcePath()));\n        }\n\n        JavaParser.Builder<? extends JavaParser, ?> javaParserBuilder = JavaParser.fromJavaVersion()\n                .styles(styles)\n                .logCompilationWarningsAndErrors(false);\n\n        // todo, add styles from autoDetect\n        KotlinParser.Builder kotlinParserBuilder = KotlinParser.builder();\n        GroovyParser.Builder groovyParserBuilder = GroovyParser.builder();\n\n        // Pre-populate parsedPaths with all source paths from both scopes (including generated sources)\n        // to prevent resource parsers from claiming these as PlainText\n        parsedPaths.addAll(listJavaSources(mavenProject, mavenProject.getExecutionProject().getCompileSourceRoots()));\n        parsedPaths.addAll(listKotlinSources(mavenProject, \"compile\", mavenProject.getBuild().getSourceDirectory()));\n        parsedPaths.addAll(listGroovySources(mavenProject, mavenProject.getExecutionProject().getCompileSourceRoots()));\n        parsedPaths.addAll(listJavaSources(mavenProject, mavenProject.getExecutionProject().getTestCompileSourceRoots()));\n        parsedPaths.addAll(listKotlinSources(mavenProject, \"test-compile\", mavenProject.getBuild().getTestSourceDirectory()));\n        parsedPaths.addAll(listGroovySources(mavenProject, mavenProject.getExecutionProject().getTestCompileSourceRoots()));\n\n        if (scopes.contains(MAIN)) {\n            sourceFiles = Stream.concat(sourceFiles, processMainSources(mavenProject, javaParserBuilder.clone(), kotlinParserBuilder.clone(), groovyParserBuilder.clone(), parsedPaths, ctx));\n        }\n        if (scopes.contains(TEST)) {\n            sourceFiles = Stream.concat(sourceFiles, processTestSources(mavenProject, javaParserBuilder.clone(), kotlinParserBuilder.clone(), groovyParserBuilder.clone(), parsedPaths, ctx));\n        }\n        Collection<PathMatcher> exclusionMatchers = exclusions.stream()\n                .map(pattern -> baseDir.getFileSystem().getPathMatcher(\"glob:\" + pattern))\n                .collect(toList());\n        Path buildDirectory = baseDir.relativize(Paths.get(mavenProject.getBuild().getDirectory()));\n        sourceFiles = sourceFiles\n                .filter(sourceFile -> !sourceFile.getSourcePath().startsWith(buildDirectory) && !isExcluded(repository, exclusionMatchers, sourceFile.getSourcePath()));\n\n        Stream<SourceFile> mavenWrapperFiles = parseMavenWrapperFiles(mavenProject, exclusionMatchers, parsedPaths, ctx);\n        sourceFiles = Stream.concat(sourceFiles, mavenWrapperFiles);\n\n        Stream<SourceFile> nonProjectResources = parseNonProjectResources(mavenProject, parsedPaths, ctx);\n        sourceFiles = Stream.concat(sourceFiles, nonProjectResources);\n\n        return sourceFiles.map(addProvenance(projectProvenance))\n                .map(addGitTreeEntryInformation())\n                .map(this::logParseErrors);\n    }\n\n    static boolean isExcluded(org.openrewrite.jgit.lib.@Nullable Repository repository, Collection<PathMatcher> exclusionMatchers, Path path) {\n        for (PathMatcher excluded : exclusionMatchers) {\n            if (excluded.matches(path)) {\n                return true;\n            }\n        }\n        // PathMatcher will not evaluate the path \"pom.xml\" to be matched by the pattern \"**/pom.xml\"\n        // This is counter-intuitive for most users and would otherwise require separate exclusions for files at the root and files in subdirectories\n        if (!path.isAbsolute() && !path.startsWith(File.separator)) {\n            Path prefixed = Paths.get(\"/\" + path);\n            for (PathMatcher excluded : exclusionMatchers) {\n                if (excluded.matches(prefixed)) {\n                    return true;\n                }\n            }\n        }\n\n        if (repository != null) {\n            return GitIgnore.isIgnoredAndUntracked(repository, separatorsToUnix(path.toString()));\n        }\n        return false;\n    }\n\n    public enum MavenScope {\n        MAIN,\n        TEST\n    }\n\n    static Optional<Charset> getCharset(MavenProject mavenProject) {\n        String compilerPluginKey = MAVEN_COMPILER_PLUGIN;\n        Plugin plugin = Optional.ofNullable(mavenProject.getPlugin(compilerPluginKey))\n                .orElseGet(() -> {\n                    PluginManagement pluginManagement = mavenProject.getPluginManagement();\n                    return pluginManagement != null ? pluginManagement.getPluginsAsMap().get(compilerPluginKey) : null;\n                });\n        if (plugin != null && plugin.getConfiguration() instanceof Xpp3Dom) {\n            Xpp3Dom encoding = ((Xpp3Dom) plugin.getConfiguration()).getChild(\"encoding\");\n            if (encoding != null && StringUtils.isNotEmpty(encoding.getValue())) {\n                String resolved = resolveProperty(encoding.getValue(), mavenProject);\n                if (resolved != null) {\n                    return Optional.of(Charset.forName(resolved));\n                }\n            }\n        }\n\n        Object mavenSourceEncoding = mavenProject.getProperties().get(\"project.build.sourceEncoding\");\n        if (mavenSourceEncoding != null) {\n            String resolved = resolveProperty(mavenSourceEncoding.toString(), mavenProject);\n            if (resolved != null) {\n                return Optional.of(Charset.forName(resolved));\n            }\n        }\n        return Optional.empty();\n    }\n\n    private static @Nullable String resolveProperty(String value, MavenProject mavenProject) {\n        if (value.startsWith(\"${\") && value.endsWith(\"}\")) {\n            String propertyName = value.substring(2, value.length() - 1);\n            String resolved = mavenProject.getProperties().getProperty(propertyName);\n            if (resolved != null && !resolved.contains(\"${\")) {\n                return resolved;\n            }\n            return null;\n        }\n        return value.contains(\"${\") ? null : value;\n    }\n\n    static org.openrewrite.jgit.lib.@Nullable Repository getRepository(Path rootDir) {\n        try (Git git = Git.open(rootDir.toFile())) {\n            return git.getRepository();\n        } catch (IOException e) {\n            // no git\n            return null;\n        }\n    }\n\n    private SourceFile logParseErrors(SourceFile source) {\n        source.getMarkers().findFirst(ParseExceptionResult.class).ifPresent(e -> {\n            if (firstWarningLogged.compareAndSet(false, true)) {\n                logger.warn(\"There were problems parsing some source files\" +\n                        (mavenSession.getRequest().isShowErrors() ? \"\" : \", run with --errors to see full stack traces\"));\n            }\n            logger.warn(\"There were problems parsing \" + source.getSourcePath());\n            if (mavenSession.getRequest().isShowErrors()) {\n                logger.warn(e.getMessage());\n            }\n        });\n        return source;\n    }\n\n    public List<Marker> generateProvenance(MavenProject mavenProject) {\n        BuildEnvironment buildEnvironment = BuildEnvironment.build(System::getenv);\n        return Stream.of(\n                        buildEnvironment,\n                        gitProvenance(baseDir, buildEnvironment),\n                        OperatingSystemProvenance.current(),\n                        buildTool,\n                        new JavaProject(randomId(), mavenProject.getName(), new JavaProject.Publication(\n                                mavenProject.getGroupId(),\n                                mavenProject.getArtifactId(),\n                                mavenProject.getVersion()\n                        )))\n                .filter(Objects::nonNull)\n                .collect(toList());\n    }\n\n    private static JavaVersion getSrcMainJavaVersion(MavenProject mavenProject) {\n        String sourceCompatibility = null;\n        String targetCompatibility = null;\n\n        Plugin compilerPlugin = mavenProject.getPlugin(MAVEN_COMPILER_PLUGIN);\n        if (compilerPlugin != null && compilerPlugin.getConfiguration() instanceof Xpp3Dom) {\n            Xpp3Dom dom = (Xpp3Dom) compilerPlugin.getConfiguration();\n            Xpp3Dom release = dom.getChild(\"release\");\n            if (release != null && StringUtils.isNotEmpty(release.getValue()) && !release.getValue().contains(\"${\")) {\n                sourceCompatibility = release.getValue();\n                targetCompatibility = release.getValue();\n            } else {\n                Xpp3Dom source = dom.getChild(\"source\");\n                if (source != null && StringUtils.isNotEmpty(source.getValue()) && !source.getValue().contains(\"${\")) {\n                    sourceCompatibility = source.getValue();\n                }\n                Xpp3Dom target = dom.getChild(\"target\");\n                if (target != null && StringUtils.isNotEmpty(target.getValue()) && !target.getValue().contains(\"${\")) {\n                    targetCompatibility = target.getValue();\n                }\n            }\n        }\n\n        if (sourceCompatibility == null || targetCompatibility == null) {\n            String propertiesReleaseCompatibility = (String) mavenProject.getProperties().get(\"maven.compiler.release\");\n            if (propertiesReleaseCompatibility != null) {\n                sourceCompatibility = propertiesReleaseCompatibility;\n                targetCompatibility = propertiesReleaseCompatibility;\n            } else {\n                String propertiesSourceCompatibility = (String) mavenProject.getProperties().get(\"maven.compiler.source\");\n                if (sourceCompatibility == null && propertiesSourceCompatibility != null) {\n                    sourceCompatibility = propertiesSourceCompatibility;\n                }\n                String propertiesTargetCompatibility = (String) mavenProject.getProperties().get(\"maven.compiler.target\");\n                if (targetCompatibility == null && propertiesTargetCompatibility != null) {\n                    targetCompatibility = propertiesTargetCompatibility;\n                }\n            }\n        }\n\n        return getJavaVersionMarker(sourceCompatibility, targetCompatibility);\n    }\n\n    static JavaVersion getSrcTestJavaVersion(MavenProject mavenProject) {\n        String sourceCompatibility = null;\n        String targetCompatibility = null;\n\n        Plugin compilerPlugin = mavenProject.getPlugin(MAVEN_COMPILER_PLUGIN);\n        if (compilerPlugin != null && compilerPlugin.getConfiguration() instanceof Xpp3Dom) {\n            Xpp3Dom dom = (Xpp3Dom) compilerPlugin.getConfiguration();\n            Xpp3Dom release = dom.getChild(\"testRelease\");\n            if (release != null && StringUtils.isNotEmpty(release.getValue()) && !release.getValue().contains(\"${\")) {\n                sourceCompatibility = release.getValue();\n                targetCompatibility = release.getValue();\n            } else {\n                Xpp3Dom source = dom.getChild(\"testSource\");\n                if (source != null && StringUtils.isNotEmpty(source.getValue()) && !source.getValue().contains(\"${\")) {\n                    sourceCompatibility = source.getValue();\n                }\n                Xpp3Dom target = dom.getChild(\"testTarget\");\n                if (target != null && StringUtils.isNotEmpty(target.getValue()) && !target.getValue().contains(\"${\")) {\n                    targetCompatibility = target.getValue();\n                }\n            }\n        }\n\n        if (sourceCompatibility == null || targetCompatibility == null) {\n            String propertiesReleaseCompatibility = (String) mavenProject.getProperties().get(\"maven.compiler.testRelease\");\n            if (propertiesReleaseCompatibility != null) {\n                sourceCompatibility = propertiesReleaseCompatibility;\n                targetCompatibility = propertiesReleaseCompatibility;\n            } else {\n                String propertiesSourceCompatibility = (String) mavenProject.getProperties().get(\"maven.compiler.testSource\");\n                if (sourceCompatibility == null && propertiesSourceCompatibility != null) {\n                    sourceCompatibility = propertiesSourceCompatibility;\n                }\n                String propertiesTargetCompatibility = (String) mavenProject.getProperties().get(\"maven.compiler.testTarget\");\n                if (targetCompatibility == null && propertiesTargetCompatibility != null) {\n                    targetCompatibility = propertiesTargetCompatibility;\n                }\n            }\n        }\n\n        // Fall back to main source compatibility if test source compatibility is not set, or only partially set.\n        if (sourceCompatibility == null || targetCompatibility == null) {\n            JavaVersion srcMainJavaVersion = getSrcMainJavaVersion(mavenProject);\n            if (sourceCompatibility == null && targetCompatibility == null) {\n                return srcMainJavaVersion;\n            }\n            sourceCompatibility = sourceCompatibility == null ? srcMainJavaVersion.getSourceCompatibility() : sourceCompatibility;\n            targetCompatibility = targetCompatibility == null ? srcMainJavaVersion.getTargetCompatibility() : targetCompatibility;\n        }\n\n        return getJavaVersionMarker(sourceCompatibility, targetCompatibility);\n    }\n\n    private static JavaVersion getJavaVersionMarker(@Nullable String sourceCompatibility, @Nullable String targetCompatibility) {\n        String javaRuntimeVersion = System.getProperty(\"java.specification.version\");\n        String javaVendor = System.getProperty(\"java.vm.vendor\");\n        if (sourceCompatibility == null) {\n            sourceCompatibility = javaRuntimeVersion;\n        }\n        if (targetCompatibility == null) {\n            targetCompatibility = sourceCompatibility;\n        }\n        return new JavaVersion(randomId(), javaRuntimeVersion, javaVendor, sourceCompatibility, targetCompatibility);\n    }\n\n    private Stream<SourceFile> processMainSources(\n            MavenProject mavenProject,\n            JavaParser.Builder<? extends JavaParser, ?> javaParserBuilder,\n            KotlinParser.Builder kotlinParserBuilder,\n            GroovyParser.Builder groovyParserBuilder,\n            Set<Path> parsedPaths,\n            ExecutionContext ctx) throws DependencyResolutionRequiredException, MojoExecutionException {\n\n        Stream<SourceFile> sourceFiles = Stream.of();\n\n        // Skip generated source roots under the build directory; their compiled classes are\n        // already on the classpath via getCompileClasspathElements() and available for type attribution.\n        List<String> sourceRoots = filterGeneratedSourceRoots(mavenProject, mavenProject.getExecutionProject().getCompileSourceRoots());\n\n        // scan Java files\n        Collection<Path> mainJavaSources = listJavaSources(mavenProject, sourceRoots);\n\n        // scan Kotlin files\n        List<Path> mainKotlinSources = listKotlinSources(mavenProject, \"compile\", mavenProject.getBuild().getSourceDirectory());\n\n        // scan Groovy files\n        List<Path> mainGroovySources = listGroovySources(mavenProject, sourceRoots);\n\n        logInfo(mavenProject, \"Parsing source files\");\n        List<Path> dependencies = mavenProject.getCompileClasspathElements().stream()\n                .distinct()\n                .map(Paths::get)\n                .collect(toList());\n        JavaTypeCache typeCache = createTypeCache();\n        javaParserBuilder.classpath(dependencies).typeCache(typeCache);\n        kotlinParserBuilder.classpath(dependencies).typeCache(typeCache);\n        groovyParserBuilder.classpath(dependencies).typeCache(typeCache);\n\n        if (!mainJavaSources.isEmpty()) {\n            Stream<SourceFile> parsedJava = Stream.of((Supplier<JavaParser>) javaParserBuilder::build)\n                    .map(Supplier::get)\n                    .flatMap(jp -> {\n                        view(ctx).setCharset(getCharset(mavenProject).orElse(null));\n                        return jp.parse(mainJavaSources, baseDir, ctx).onClose(() -> view(ctx).setCharset(null));\n                    });\n            sourceFiles = Stream.concat(sourceFiles, parsedJava);\n            logDebug(mavenProject, \"Scanned \" + mainJavaSources.size() + \" java source files in main scope.\");\n        }\n\n        if (!mainKotlinSources.isEmpty()) {\n            Stream<SourceFile> parsedKotlin = Stream.of((Supplier<KotlinParser>) kotlinParserBuilder::build)\n                    .map(Supplier::get)\n                    .flatMap(kp -> {\n                        view(ctx).setCharset(StandardCharsets.UTF_8); // Kotlin requires UTF-8\n                        return kp.parse(mainKotlinSources, baseDir, ctx).onClose(() -> view(ctx).setCharset(null));\n                    });\n            sourceFiles = Stream.concat(sourceFiles, parsedKotlin);\n            logDebug(mavenProject, \"Scanned \" + mainKotlinSources.size() + \" kotlin source files in main scope.\");\n        }\n\n        if (!mainGroovySources.isEmpty()) {\n            Stream<SourceFile> parsedGroovy = Stream.of((Supplier<GroovyParser>) groovyParserBuilder::build)\n                    .map(Supplier::get)\n                    .flatMap(gp -> gp.parse(mainGroovySources, baseDir, ctx));\n            sourceFiles = Stream.concat(sourceFiles, parsedGroovy);\n            logDebug(mavenProject, \"Scanned \" + mainGroovySources.size() + \" groovy source files in main scope.\");\n        }\n\n        OmniParser omniParser = omniParser(parsedPaths, mavenProject);\n        for (Resource resource : mavenProject.getResources()) {\n            Path resourcePath = mavenProject.getBasedir().toPath().resolve(resource.getDirectory());\n            if (Files.exists(resourcePath) && !parsedPaths.contains(resourcePath)) {\n                List<Path> accepted = omniParser.acceptedPaths(baseDir, resourcePath);\n                parsedPaths.add(resourcePath);\n                sourceFiles = Stream.concat(sourceFiles, omniParser.parse(accepted, baseDir, ctx));\n                parsedPaths.addAll(accepted);\n            }\n        }\n\n        // Also parse webapp resources (e.g., web.xml) for WAR projects\n        if (\"war\".equals(mavenProject.getPackaging())) {\n            Path webappPath = mavenProject.getBasedir().toPath().resolve(\"src/main/webapp\");\n            if (Files.exists(webappPath) && !parsedPaths.contains(webappPath)) {\n                List<Path> accepted = omniParser.acceptedPaths(baseDir, webappPath);\n                parsedPaths.add(webappPath);\n                sourceFiles = Stream.concat(sourceFiles, omniParser.parse(accepted, baseDir, ctx));\n                parsedPaths.addAll(accepted);\n            }\n        }\n\n        List<Marker> mainProjectProvenance = new ArrayList<>();\n        mainProjectProvenance.add(JavaSourceSet.build(\"main\", dependencies));\n        mainProjectProvenance.add(getSrcMainJavaVersion(mavenProject));\n\n        return sourceFiles\n                .map(addProvenance(mainProjectProvenance));\n    }\n\n    private Stream<SourceFile> processTestSources(\n            MavenProject mavenProject,\n            JavaParser.Builder<? extends JavaParser, ?> javaParserBuilder,\n            KotlinParser.Builder kotlinParserBuilder,\n            GroovyParser.Builder groovyParserBuilder,\n            Set<Path> parsedPaths,\n            ExecutionContext ctx) throws DependencyResolutionRequiredException, MojoExecutionException {\n\n        Stream<SourceFile> sourceFiles = Stream.of();\n\n        // Skip generated source roots under the build directory; their compiled classes are\n        // already on the classpath via getTestClasspathElements() and available for type attribution.\n        List<String> testSourceRoots = filterGeneratedSourceRoots(mavenProject, mavenProject.getExecutionProject().getTestCompileSourceRoots());\n\n        // scan Java files\n        Collection<Path> testJavaSources = listJavaSources(mavenProject, testSourceRoots);\n\n        // scan Kotlin files\n        List<Path> testKotlinSources = listKotlinSources(mavenProject, \"test-compile\", mavenProject.getBuild().getTestSourceDirectory());\n\n        // scan Groovy files\n        List<Path> testGroovySources = listGroovySources(mavenProject, testSourceRoots);\n\n        List<Path> testDependencies = mavenProject.getTestClasspathElements().stream()\n                .distinct()\n                .map(Paths::get)\n                .collect(toList());\n        JavaTypeCache typeCache = createTypeCache();\n        javaParserBuilder.classpath(testDependencies).typeCache(typeCache);\n        kotlinParserBuilder.classpath(testDependencies).typeCache(typeCache);\n        groovyParserBuilder.classpath(testDependencies).typeCache(typeCache);\n\n        if (!testJavaSources.isEmpty()) {\n            Stream<SourceFile> parsedJava = Stream.of((Supplier<JavaParser>) javaParserBuilder::build)\n                    .map(Supplier::get)\n                    .flatMap(jp -> {\n                        view(ctx).setCharset(getCharset(mavenProject).orElse(null));\n                        return jp.parse(testJavaSources, baseDir, ctx).onClose(() -> view(ctx).setCharset(null));\n                    });\n            sourceFiles = Stream.concat(sourceFiles, parsedJava);\n            logDebug(mavenProject, \"Scanned \" + testJavaSources.size() + \" java source files in test scope.\");\n        }\n\n        if (!testKotlinSources.isEmpty()) {\n            Stream<SourceFile> parsedKotlin = Stream.of((Supplier<KotlinParser>) kotlinParserBuilder::build)\n                    .map(Supplier::get)\n                    .flatMap(kp -> {\n                        view(ctx).setCharset(StandardCharsets.UTF_8); // Kotlin requires UTF-8\n                        return kp.parse(testKotlinSources, baseDir, ctx).onClose(() -> view(ctx).setCharset(null));\n                    });\n            sourceFiles = Stream.concat(sourceFiles, parsedKotlin);\n            logDebug(mavenProject, \"Scanned \" + testKotlinSources.size() + \" kotlin source files in test scope.\");\n        }\n\n        if (!testGroovySources.isEmpty()) {\n            Stream<SourceFile> parsedGroovy = Stream.of((Supplier<GroovyParser>) groovyParserBuilder::build)\n                    .map(Supplier::get)\n                    .flatMap(gp -> gp.parse(testGroovySources, baseDir, ctx));\n            sourceFiles = Stream.concat(sourceFiles, parsedGroovy);\n            logDebug(mavenProject, \"Scanned \" + testGroovySources.size() + \" groovy source files in test scope.\");\n        }\n\n        OmniParser omniParser = omniParser(parsedPaths, mavenProject);\n        for (Resource resource : mavenProject.getTestResources()) {\n            Path resourcePath = mavenProject.getBasedir().toPath().resolve(resource.getDirectory());\n            if (Files.exists(resourcePath) && !parsedPaths.contains(resourcePath)) {\n                List<Path> accepted = omniParser.acceptedPaths(baseDir, resourcePath);\n                parsedPaths.add(resourcePath);\n                sourceFiles = Stream.concat(sourceFiles, omniParser.parse(accepted, baseDir, ctx));\n                parsedPaths.addAll(accepted);\n            }\n        }\n\n        List<Marker> testProjectProvenance = new ArrayList<>();\n        testProjectProvenance.add(JavaSourceSet.build(\"test\", testDependencies));\n        testProjectProvenance.add(getSrcTestJavaVersion(mavenProject));\n\n        return sourceFiles\n                .map(addProvenance(testProjectProvenance));\n    }\n\n    public Xml.@Nullable Document parseMaven(MavenProject mavenProject, List<Marker> projectProvenance, ExecutionContext ctx) throws MojoFailureException {\n        return parseMaven(singletonList(mavenProject), singletonMap(mavenProject, projectProvenance), ctx).get(mavenProject);\n    }\n\n    public Map<MavenProject, Xml.Document> parseMaven(List<MavenProject> mavenProjects, Map<MavenProject, List<Marker>> projectProvenances, ExecutionContext ctx) throws MojoFailureException {\n        if (skipMavenParsing) {\n            logger.info(\"Skipping Maven parsing...\");\n            return emptyMap();\n        }\n\n        MavenSettings settings = buildSettings();\n        MavenExecutionContextView mavenExecutionContext = MavenExecutionContextView.view(ctx);\n        mavenExecutionContext.setMavenSettings(settings);\n        mavenExecutionContext.setResolutionListener(new MavenLoggingResolutionEventListener(logger));\n        configureProxy(settings, ctx);\n\n        // The default pom cache is enabled as a two-layer cache L1 == in-memory and L2 == RocksDb\n        // If the flag is set to false, only the default, in-memory cache is used.\n        MavenPomCache pomCache = pomCacheEnabled ? getPomCache(pomCacheDirectory, logger) : mavenExecutionContext.getPomCache();\n        mavenExecutionContext.setPomCache(pomCache);\n\n        MavenProject topLevelProject = mavenSession.getTopLevelProject();\n        logInfo(topLevelProject, \"Resolving Poms...\");\n\n        Set<Path> allPoms = new LinkedHashSet<>();\n        mavenProjects.forEach(p -> collectPoms(p, allPoms, mavenExecutionContext));\n        for (MavenProject mavenProject : mavenProjects) {\n            mavenSession.getProjectDependencyGraph().getUpstreamProjects(mavenProject, true).forEach(p -> collectPoms(p, allPoms, mavenExecutionContext));\n        }\n\n        MavenParser.Builder mavenParserBuilder = MavenParser.builder();\n        mavenParserBuilder.property(\"basedir\", topLevelProject.getBasedir().getAbsoluteFile().getParent());\n        mavenParserBuilder.property(\"project.basedir\", topLevelProject.getBasedir().getAbsoluteFile().getParent());\n        topLevelProject.getActiveProfiles().forEach(it -> mavenParserBuilder.activeProfiles(it.getId()));\n        topLevelProject.getInjectedProfileIds().forEach((gav, profiles) -> mavenParserBuilder.activeProfiles(profiles.toArray(new String[0])));\n        mavenSession.getRequest().getActiveProfiles().forEach(mavenParserBuilder::activeProfiles);\n        mavenSession.getUserProperties().forEach((key, value) ->\n                mavenParserBuilder.property((String) key, (String) value));\n\n        List<SourceFile> mavens = mavenParserBuilder.build()\n                .parse(allPoms, baseDir, ctx)\n                .collect(toList());\n\n        if (logger.isDebugEnabled()) {\n            logDebug(topLevelProject, \"Base directory : '\" + baseDir + \"'\");\n            if (allPoms.isEmpty()) {\n                logDebug(topLevelProject, \"There were no collected pom paths.\");\n            } else {\n                for (Path path : allPoms) {\n                    logDebug(topLevelProject, \"  Collected Maven POM : '\" + path + \"'\");\n                }\n            }\n            if (mavens.isEmpty()) {\n                logDebug(topLevelProject, \"There were no parsed maven source files.\");\n            } else {\n                for (SourceFile source : mavens) {\n                    logDebug(topLevelProject, \"  Maven Source : '\" + baseDir.resolve(source.getSourcePath()) + \"'\");\n                }\n            }\n        }\n\n        Map<Path, MavenProject> projectsByPath = mavenProjects.stream().collect(toMap(MavenMojoProjectParser::pomPath, Function.identity()));\n        Map<MavenProject, Xml.Document> projectMap = new HashMap<>();\n        for (SourceFile document : mavens) {\n            Path path = baseDir.resolve(document.getSourcePath());\n            MavenProject mavenProject = projectsByPath.get(path);\n            if (mavenProject != null) {\n                Optional<ParseExceptionResult> parseExceptionResult = document.getMarkers().findFirst(ParseExceptionResult.class);\n                if (parseExceptionResult.isPresent()) {\n                    throw new MojoFailureException(\n                            mavenProject,\n                            \"Failed to parse or resolve the Maven POM file or one of its dependencies; \" +\n                                    \"We can not reliably continue without this information.\",\n                            parseExceptionResult.get().getMessage());\n                }\n                projectMap.put(mavenProject, (Xml.Document) document);\n            }\n        }\n        for (MavenProject mavenProject : mavenProjects) {\n            if (projectMap.get(mavenProject) == null) {\n                logError(mavenProject, \"Parse resulted in no Maven source files. Maven Project File '\" + mavenProject.getFile().toPath() + \"'\");\n                return emptyMap();\n            }\n        }\n\n        // assign provenance markers\n        for (MavenProject mavenProject : mavenProjects) {\n            Xml.Document document = projectMap.get(mavenProject);\n            List<Marker> provenance = projectProvenances.getOrDefault(mavenProject, emptyList());\n            Markers markers = document.getMarkers();\n            for (Marker marker : provenance) {\n                markers = markers.addIfAbsent(marker);\n            }\n            projectMap.put(mavenProject, document.withMarkers(markers));\n        }\n\n        return projectMap;\n    }\n\n    /**\n     * Recursively navigate the maven project to collect any poms that are local (on disk)\n     *\n     * @param project A maven project to examine for any children/parent poms.\n     * @param paths   A list of paths to poms that have been collected so far.\n     * @param ctx     The execution context for the current project.\n     */\n    private void collectPoms(MavenProject project, Set<Path> paths, MavenExecutionContextView ctx) {\n        if (!paths.add(pomPath(project))) {\n            return;\n        }\n\n        ResolvedGroupArtifactVersion gav = createResolvedGAV(project, ctx);\n        ctx.getPomCache().putPom(gav, createPom(project));\n\n        // children\n        if (project.getCollectedProjects() != null) {\n            for (MavenProject child : project.getCollectedProjects()) {\n                Path path = pomPath(child);\n                if (!paths.contains(path)) {\n                    collectPoms(child, paths, ctx);\n                }\n            }\n        }\n\n        MavenProject parent = project.getParent();\n        while (parent != null && parent.getFile() != null) {\n            Path path = pomPath(parent);\n            if (!paths.contains(path)) {\n                collectPoms(parent, paths, ctx);\n            }\n            parent = parent.getParent();\n        }\n    }\n\n    private static Path pomPath(MavenProject mavenProject) {\n        Path pomPath = mavenProject.getFile().toPath();\n        if (pomPath.endsWith(\".flattened-pom.xml\") ||// org.codehaus.mojo:flatten-maven-plugin\n                pomPath.endsWith(\"dependency-reduced-pom.xml\") || // org.apache.maven.plugins:maven-shade-plugin\n                pomPath.endsWith(\".ci-friendly-pom.xml\") || // com.outbrain.swinfra:ci-friendly-flatten-maven-plugin\n                pomPath.endsWith(\".tycho-consumer-pom.xml\")) { // org.eclipse.tycho:tycho-packaging-plugin:update-consumer-pom\n            Path normalPom = mavenProject.getBasedir().toPath().resolve(\"pom.xml\");\n            // check for the existence of the POM, since Tycho can work pom-less\n            if (Files.isReadable(normalPom) && Files.isRegularFile(normalPom)) {\n                return normalPom;\n            }\n        }\n        return pomPath;\n    }\n\n    private static MavenPomCache getPomCache(@Nullable String pomCacheDirectory, Log logger) {\n        if (POM_CACHE == null) {\n            POM_CACHE = new MavenPomCacheBuilder(logger).build(pomCacheDirectory);\n        }\n        if (POM_CACHE == null) {\n            POM_CACHE = new InMemoryMavenPomCache();\n        }\n        return POM_CACHE;\n    }\n\n    public MavenSettings buildSettings() {\n        MavenExecutionRequest mer = mavenSession.getRequest();\n\n        MavenSettings.Profiles profiles = new MavenSettings.Profiles();\n        profiles.setProfiles(\n                mer.getProfiles().stream().map(p -> new MavenSettings.Profile(\n                                p.getId(),\n                                p.getActivation() == null ? null : new ProfileActivation(\n                                        p.getActivation().isActiveByDefault(),\n                                        p.getActivation().getJdk(),\n                                        p.getActivation().getProperty() == null ? null : new ProfileActivation.Property(\n                                                p.getActivation().getProperty().getName(),\n                                                p.getActivation().getProperty().getValue()\n                                        )\n                                ),\n                                buildRawRepositories(p.getRepositories())\n                        )\n                ).collect(toList()));\n\n        MavenSettings.ActiveProfiles activeProfiles = new MavenSettings.ActiveProfiles();\n        activeProfiles.setActiveProfiles(mer.getActiveProfiles());\n\n        MavenSettings.Mirrors mirrors = new MavenSettings.Mirrors();\n        mirrors.setMirrors(\n                mer.getMirrors().stream().map(m -> new MavenSettings.Mirror(\n                        m.getId(),\n                        m.getUrl(),\n                        m.getMirrorOf(),\n                        null,\n                        null\n                )).collect(toList())\n        );\n\n        MavenSettings.Servers servers = new MavenSettings.Servers();\n        servers.setServers(mer.getServers().stream().map(s -> {\n            SettingsDecryptionRequest decryptionRequest = new DefaultSettingsDecryptionRequest(s);\n            SettingsDecryptionResult decryptionResult = settingsDecrypter.decrypt(decryptionRequest);\n            MavenSettings.ServerConfiguration configuration = null;\n            if (s.getConfiguration() != null) {\n                try {\n                    // No need to interpolate in property placeholders like ${env.Foo}, Maven has already done this\n                    configuration = MavenXmlMapper.readMapper().readValue(s.getConfiguration().toString(), MavenSettings.ServerConfiguration.class);\n                } catch (JsonProcessingException e) {\n                    throw new RuntimeException(e);\n                }\n            }\n            return new MavenSettings.Server(\n                    s.getId(),\n                    s.getUsername(),\n                    decryptionResult.getServer().getPassword(),\n                    configuration\n            );\n        }).collect(toList()));\n\n        MavenSettings.Proxies proxies = new MavenSettings.Proxies();\n        proxies.setProxies(mer.getProxies().stream().map(p -> {\n            SettingsDecryptionRequest decryptionRequest = new DefaultSettingsDecryptionRequest();\n            decryptionRequest.setProxies(singletonList(p));\n            SettingsDecryptionResult decryptionResult = settingsDecrypter.decrypt(decryptionRequest);\n            org.apache.maven.settings.Proxy decryptedProxy = decryptionResult.getProxies().isEmpty() ? p : decryptionResult.getProxies().get(0);\n            return new MavenSettings.Proxy(\n                    p.getId(),\n                    p.isActive(),\n                    p.getProtocol(),\n                    p.getHost(),\n                    p.getPort(),\n                    p.getUsername(),\n                    decryptedProxy.getPassword(),\n                    p.getNonProxyHosts()\n            );\n        }).collect(toList()));\n\n        return new MavenSettings(mer.getLocalRepositoryPath().toString(), profiles, activeProfiles, mirrors, servers, proxies);\n    }\n\n    private void configureProxy(MavenSettings settings, ExecutionContext ctx) {\n        if (settings.getProxies() == null || settings.getProxies().getProxies().isEmpty()) {\n            return;\n        }\n        // Use the first active proxy\n        MavenSettings.Proxy activeProxy = settings.getProxies().getProxies().stream()\n                .filter(p -> p.getActive() == null || p.getActive())\n                .findFirst()\n                .orElse(null);\n        if (activeProxy == null) {\n            return;\n        }\n\n        java.net.Proxy proxy = new java.net.Proxy(\n                java.net.Proxy.Type.HTTP,\n                new InetSocketAddress(activeProxy.getHost(), activeProxy.getPort())\n        );\n\n        if (activeProxy.getUsername() != null && !activeProxy.getUsername().isEmpty()) {\n            Authenticator.setDefault(new Authenticator() {\n                @Override\n                protected PasswordAuthentication getPasswordAuthentication() {\n                    if (getRequestorType() == RequestorType.PROXY) {\n                        return new PasswordAuthentication(\n                                activeProxy.getUsername(),\n                                activeProxy.getPassword() != null ? activeProxy.getPassword().toCharArray() : new char[0]\n                        );\n                    }\n                    return null;\n                }\n            });\n        }\n\n        HttpUrlConnectionSender proxiedSender = new HttpUrlConnectionSender(\n                Duration.ofSeconds(1), Duration.ofSeconds(10), proxy);\n        HttpUrlConnectionSender directSender = new HttpUrlConnectionSender(\n                Duration.ofSeconds(1), Duration.ofSeconds(10));\n\n        String nonProxyHosts = activeProxy.getNonProxyHosts();\n        if (nonProxyHosts == null || nonProxyHosts.isEmpty()) {\n            HttpSenderExecutionContextView.view(ctx).setHttpSender(proxiedSender);\n        } else {\n            // Parse nonProxyHosts patterns (pipe-delimited, * wildcards) into a regex\n            String regex = Arrays.stream(nonProxyHosts.split(\"\\\\|\"))\n                    .map(String::trim)\n                    .filter(s -> !s.isEmpty())\n                    .map(pattern -> pattern.replace(\".\", \"\\\\.\").replace(\"*\", \".*\"))\n                    .collect(joining(\"|\"));\n            Pattern nonProxyPattern = Pattern.compile(regex);\n            HttpSenderExecutionContextView.view(ctx).setHttpSender(request -> {\n                String host = request.getUrl().getHost();\n                if (nonProxyPattern.matcher(host).matches()) {\n                    return directSender.send(request);\n                }\n                return proxiedSender.send(request);\n            });\n        }\n    }\n\n    private static @Nullable RawRepositories buildRawRepositories(@Nullable List<Repository> repositoriesToMap) {\n        if (repositoriesToMap == null) {\n            return null;\n        }\n\n        RawRepositories rawRepositories = new RawRepositories();\n        List<RawRepositories.Repository> transformedRepositories = repositoriesToMap.stream().map(r -> new RawRepositories.Repository(\n                r.getId(),\n                r.getUrl(),\n                r.getReleases() == null ? null : new RawRepositories.ArtifactPolicy(Boolean.toString(r.getReleases().isEnabled())),\n                r.getSnapshots() == null ? null : new RawRepositories.ArtifactPolicy(Boolean.toString(r.getSnapshots().isEnabled()))\n        )).collect(toList());\n        rawRepositories.setRepositories(transformedRepositories);\n        return rawRepositories;\n    }\n\n    /**\n     * Used to scope `Files.walkFileTree` to the current maven project by skipping the subtrees of other MavenProjects.\n     */\n    private Set<Path> pathsToOtherMavenProjects(MavenProject mavenProject) {\n        return mavenSession.getProjects().stream()\n                .filter(o -> o != mavenProject)\n                .map(o -> o.getBasedir().toPath())\n                .collect(toSet());\n    }\n\n    private <T extends SourceFile> UnaryOperator<T> addProvenance(List<Marker> provenance) {\n        return s -> {\n            Markers markers = s.getMarkers();\n            for (Marker marker : provenance) {\n                markers = markers.addIfAbsent(marker);\n            }\n            return s.withMarkers(markers);\n        };\n    }\n\n    private <T extends SourceFile> UnaryOperator<T> addGitTreeEntryInformation() {\n        return s -> {\n            if (repository == null) {\n                return s;\n            }\n\n            try {\n                ObjectId head = repository.resolve(\"HEAD\");\n                if (head == null) {\n                    return s;\n                }\n\n                try (RevWalk revWalk = new RevWalk(repository);\n                     TreeWalk treeWalk = new TreeWalk(repository)) {\n                    RevCommit commit = revWalk.parseCommit(head);\n                    treeWalk.addTree(commit.getTree());\n                    treeWalk.setRecursive(true);\n                    treeWalk.setFilter(PathFilter.create(PathUtils.separatorsToUnix(s.getSourcePath().toString())));\n\n                    if (treeWalk.next()) {\n                        return s.withMarkers(s.getMarkers().add(new GitTreeEntry(randomId(), treeWalk.getObjectId(0).name(), treeWalk.getRawMode(0))));\n                    }\n                    return s;\n                }\n            } catch (IOException e) {\n                throw new UncheckedIOException(e);\n            }\n        };\n    }\n\n    private static List<String> filterGeneratedSourceRoots(MavenProject mavenProject, List<String> sourceRoots) {\n        Path buildDirectory = Paths.get(mavenProject.getBuild().getDirectory());\n        return sourceRoots.stream()\n                .filter(root -> !Paths.get(root).startsWith(buildDirectory))\n                .collect(toList());\n    }\n\n    private static Collection<Path> listJavaSources(MavenProject mavenProject, List<String> compileSourceRoots) throws MojoExecutionException {\n        Set<Path> javaSources = new LinkedHashSet<>();\n        for (String compileSourceRoot : compileSourceRoots) {\n            javaSources.addAll(listSources(mavenProject.getBasedir().toPath().resolve(compileSourceRoot), \".java\"));\n        }\n        return javaSources;\n    }\n\n    private List<Path> listKotlinSources(MavenProject mavenProject, String executionId, String fallbackSourceDirectory) throws MojoExecutionException {\n        Plugin kotlinPlugin = mavenProject.getPlugin(\"org.jetbrains.kotlin:kotlin-maven-plugin\");\n        if (kotlinPlugin == null) {\n            return emptyList();\n        }\n\n        PluginExecution execution = kotlinPlugin.getExecutionsAsMap().get(executionId);\n        if (execution != null && execution.getConfiguration() instanceof Xpp3Dom) {\n            Xpp3Dom configuration = (Xpp3Dom) execution.getConfiguration();\n            Xpp3Dom sourceDirs = configuration.getChild(\"sourceDirs\");\n            if (sourceDirs != null) {\n                List<Path> kotlinSources = new ArrayList<>();\n                for (Xpp3Dom sourceDir : sourceDirs.getChildren(\"sourceDir\")) {\n                    Path sourceDirectory = mavenProject.getBasedir().toPath().resolve(sourceDir.getValue());\n                    kotlinSources.addAll(listSources(sourceDirectory, \".kt\"));\n                }\n                return kotlinSources;\n            }\n        }\n\n        return listSources(mavenProject.getBasedir().toPath().resolve(fallbackSourceDirectory), \".kt\");\n    }\n\n    private static List<Path> listGroovySources(MavenProject mavenProject, List<String> compileSourceRoots) throws MojoExecutionException {\n        List<Path> groovySources = new ArrayList<>();\n        for (String compileSourceRoot : compileSourceRoots) {\n            groovySources.addAll(listSources(mavenProject.getBasedir().toPath().resolve(compileSourceRoot), \".groovy\"));\n        }\n        // Also check conventional Groovy source directories\n        Path basedir = mavenProject.getBasedir().toPath();\n        for (String compileSourceRoot : compileSourceRoots) {\n            Path javaRoot = basedir.resolve(compileSourceRoot);\n            // If the source root is src/main/java, also check src/main/groovy\n            if (javaRoot.endsWith(\"java\")) {\n                Path groovyRoot = javaRoot.resolveSibling(\"groovy\");\n                if (Files.exists(groovyRoot)) {\n                    groovySources.addAll(listSources(groovyRoot, \".groovy\"));\n                }\n            }\n        }\n        return groovySources;\n    }\n\n    private static List<Path> listSources(Path sourceDirectory, String extension) throws MojoExecutionException {\n        if (!Files.exists(sourceDirectory)) {\n            return emptyList();\n        }\n        try {\n            List<Path> result = new ArrayList<>();\n            Files.walkFileTree(sourceDirectory, new SimpleFileVisitor<Path>() {\n                @Override\n                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {\n                    if (file.toString().endsWith(extension)) {\n                        result.add(file);\n                    }\n                    return FileVisitResult.CONTINUE;\n                }\n            });\n            return result;\n        } catch (IOException e) {\n            throw new MojoExecutionException(\"Unable to list source files of \" + extension, e);\n        }\n    }\n\n    private Stream<SourceFile> parseMavenWrapperFiles(MavenProject mavenProject, Collection<PathMatcher> exclusions, Set<Path> parsedPaths, ExecutionContext ctx) {\n        Stream<SourceFile> sourceFiles = Stream.empty();\n        if (mavenProject.getParent() == null) {\n            OmniParser omniParser = omniParser(parsedPaths, mavenProject);\n            List<Path> mavenWrapperFiles = Stream.of(\n                            Paths.get(MVN_JVM_CONFIG),\n                            Paths.get(MVN_MAVEN_CONFIG),\n                            MavenWrapper.WRAPPER_BATCH_LOCATION,\n                            MavenWrapper.WRAPPER_JAR_LOCATION,\n                            MavenWrapper.WRAPPER_PROPERTIES_LOCATION,\n                            MavenWrapper.WRAPPER_SCRIPT_LOCATION)\n                    .map(Path::toAbsolutePath)\n                    .filter(Files::exists)\n                    .filter(it -> !isExcluded(repository, exclusions, it))\n                    .filter(omniParser::accept)\n                    .collect(toList());\n            sourceFiles = omniParser.parse(mavenWrapperFiles, baseDir, ctx);\n        }\n        return sourceFiles;\n    }\n\n    protected Stream<SourceFile> parseNonProjectResources(MavenProject mavenProject, Set<Path> parsedPaths, ExecutionContext ctx) {\n        if (!parseAdditionalResources) {\n            return Stream.empty();\n        }\n        //Collect any additional yaml/properties/xml files that are NOT already in a source set.\n        OmniParser omniParser = omniParser(parsedPaths, mavenProject);\n        List<Path> accepted = omniParser.acceptedPaths(baseDir, mavenProject.getBasedir().toPath());\n        return omniParser.parse(accepted, baseDir, ctx);\n    }\n\n    private OmniParser omniParser(Set<Path> parsedPaths, MavenProject mavenProject) {\n        return OmniParser.builder(\n                        OmniParser.defaultResourceParsers(),\n                        PlainTextParser.builder()\n                                .plainTextMasks(baseDir, plainTextMasks)\n                                .build(),\n                        QuarkParser.builder().build()\n                )\n                .exclusionMatchers(pathMatchers(baseDir, mergeExclusions(mavenProject)))\n                .exclusions(parsedPaths)\n                .sizeThresholdMb(sizeThresholdMb)\n                .build();\n    }\n\n    private Collection<String> mergeExclusions(MavenProject mavenProject) {\n        Path projectPath = mavenProject.getBasedir().toPath();\n        return Stream.concat(\n                pathsToOtherMavenProjects(mavenProject).stream()\n                        .filter(otherProjectPath -> !projectPath.startsWith(otherProjectPath))\n                        .map(subproject -> separatorsToUnix(baseDir.relativize(subproject).toString())),\n                exclusions.stream()\n        ).collect(toList());\n    }\n\n    private Collection<PathMatcher> pathMatchers(Path basePath, Collection<String> pathExpressions) {\n        return pathExpressions.stream()\n                .map(o -> basePath.getFileSystem().getPathMatcher(\"glob:\" + o))\n                .collect(toList());\n    }\n\n    private static final Map<Path, GitProvenance> REPO_ROOT_TO_PROVENANCE = new HashMap<>();\n\n    private @Nullable GitProvenance gitProvenance(Path baseDir, @Nullable BuildEnvironment buildEnvironment) {\n        try {\n            // Computing git provenance can be expensive for repositories with many commits, ensure we do it only once\n            return REPO_ROOT_TO_PROVENANCE.computeIfAbsent(baseDir, dir -> GitProvenance.fromProjectDirectory(dir, buildEnvironment));\n        } catch (Exception e) {\n            // Logging at a low level as this is unlikely to happen except in non-git projects, where it is expected\n            logger.debug(\"Unable to determine git provenance\", e);\n        }\n        return null;\n    }\n\n    private void logError(MavenProject mavenProject, String message) {\n        logger.error(\"Project [\" + mavenProject.getName() + \"] \" + message);\n    }\n\n    private void logInfo(MavenProject mavenProject, String message) {\n        logger.info(\"Project [\" + mavenProject.getName() + \"] \" + message);\n    }\n\n    private void logDebug(MavenProject mavenProject, String message) {\n        logger.debug(\"Project [\" + mavenProject.getName() + \"] \" + message);\n    }\n\n    @SuppressWarnings({\"RedundantThrows\", \"unchecked\"})\n    private static <E extends Throwable> E sneakyThrow(Throwable e) throws E {\n        return (E) e;\n    }\n\n    private static ResolvedGroupArtifactVersion createResolvedGAV(MavenProject project, MavenExecutionContextView ctx) {\n        return new ResolvedGroupArtifactVersion(\n                ctx.getLocalRepository().getUri(),\n                project.getGroupId(),\n                project.getArtifactId(),\n                project.getVersion(),\n                project.getVersion().endsWith(\"-SNAPSHOT\") ? null : project.getVersion()\n        );\n    }\n\n    private static @Nullable Pom createPom(MavenProject project) {\n        Path pomPath = project.getFile().toPath();\n        try (InputStream is = Files.newInputStream(pomPath)) {\n            RawPom rawPom = RawPom.parse(is, null);\n            return rawPom.toPom(project.getBasedir().toPath().relativize(pomPath), null);\n        } catch (IOException e) {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/MavenPomCacheBuilder.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.logging.Log;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.maven.cache.CompositeMavenPomCache;\nimport org.openrewrite.maven.cache.InMemoryMavenPomCache;\nimport org.openrewrite.maven.cache.MavenPomCache;\nimport org.openrewrite.maven.cache.RocksdbMavenPomCache;\n\nimport java.nio.file.Paths;\n\npublic class MavenPomCacheBuilder {\n    private final Log logger;\n\n    public MavenPomCacheBuilder(Log logger) {\n        this.logger = logger;\n    }\n\n    public @Nullable MavenPomCache build(@Nullable String pomCacheDirectory) {\n        if (isJvm64Bit()) {\n            try {\n                if (pomCacheDirectory == null) {\n                    //Default directory in the RocksdbMavenPomCache is \".rewrite-cache\"\n                    return new CompositeMavenPomCache(\n                      new InMemoryMavenPomCache(),\n                      new RocksdbMavenPomCache(Paths.get(System.getProperty(\"user.home\")))\n                    );\n                }\n                return new CompositeMavenPomCache(\n                  new InMemoryMavenPomCache(),\n                  new RocksdbMavenPomCache(Paths.get(pomCacheDirectory))\n                );\n            } catch (Throwable e) {\n                logger.warn(\"Unable to initialize RocksdbMavenPomCache, falling back to InMemoryMavenPomCache\");\n                logger.debug(e);\n            }\n        } else {\n            logger.warn(\"RocksdbMavenPomCache is not supported on 32-bit JVM. falling back to InMemoryMavenPomCache\");\n        }\n\n        return null;\n    }\n\n    private static boolean isJvm64Bit() {\n        //It appears most JVM vendors set this property. Only return false if the\n        //property has been set AND it is set to 32.\n        return !\"32\".equals(System.getProperty(\"sun.arch.data.model\", \"64\"));\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/MeterRegistryProvider.java",
    "content": "/*\r\n * Copyright 2020 the original author or authors.\r\n * <p>\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * <p>\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n * <p>\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\npackage org.openrewrite.maven;\r\n\r\nimport io.micrometer.core.instrument.MeterRegistry;\r\nimport io.micrometer.core.instrument.composite.CompositeMeterRegistry;\r\nimport org.apache.maven.plugin.logging.Log;\r\nimport org.jspecify.annotations.Nullable;\r\n\r\npublic class MeterRegistryProvider implements AutoCloseable {\r\n    private final Log log;\r\n\r\n    @Nullable\r\n    private final String destination;\r\n\r\n    @Nullable\r\n    private MeterRegistry registry;\r\n\r\n    public MeterRegistryProvider(Log log, @Nullable String destination) {\r\n        this.log = log;\r\n        this.destination = destination;\r\n    }\r\n\r\n    public MeterRegistry registry() {\r\n        if (this.registry == null) {\r\n            this.registry = buildRegistry();\r\n        }\r\n        return this.registry;\r\n    }\r\n\r\n    private MeterRegistry buildRegistry() {\r\n       if (\"LOG\".equals(destination)) {\r\n            return new MavenLoggingMeterRegistry(log);\r\n        }\r\n\r\n        return new CompositeMeterRegistry();\r\n    }\r\n\r\n    @Override\r\n    public void close() {\r\n        if (registry != null) {\r\n            registry.close();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RecipeCsvGenerateMojo.java",
    "content": "/*\n * Copyright 2026 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugins.annotations.Execute;\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\nimport org.openrewrite.marketplace.RecipeMarketplace;\nimport org.openrewrite.marketplace.RecipeMarketplaceReader;\nimport org.openrewrite.marketplace.RecipeMarketplaceWriter;\nimport org.openrewrite.maven.marketplace.MavenRecipeMarketplaceGenerator;\nimport org.openrewrite.maven.tree.GroupArtifact;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Generate a {@code recipes.csv} marketplace file from the recipes found in this project.\n * Scans compiled classes and resources in {@code target/classes/} for recipe definitions\n * (both Java class-based and YAML declarative recipes) and writes the result to\n * {@code src/main/resources/META-INF/rewrite/recipes.csv}.\n * <p>\n * If an existing {@code recipes.csv} is present, generated data is merged into it,\n * preserving any manually added entries.\n * <p>\n * {@code ./mvnw rewrite:recipeCsvGenerate}\n */\n@Execute(phase = LifecyclePhase.PROCESS_CLASSES)\n@Mojo(name = \"recipeCsvGenerate\", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true)\npublic class RecipeCsvGenerateMojo extends AbstractRewriteMojo {\n\n    @Override\n    public void execute() throws MojoExecutionException {\n        if (rewriteSkip) {\n            getLog().info(\"Skipping execution\");\n            return;\n        }\n\n        if (\"pom\".equals(project.getPackaging())) {\n            getLog().info(\"Skipping pom-packaging project\");\n            return;\n        }\n\n        Path classesDir = Paths.get(project.getBuild().getOutputDirectory());\n        if (!Files.exists(classesDir)) {\n            getLog().warn(\"No compiled classes found at \" + classesDir + \". Skipping.\");\n            return;\n        }\n\n        String groupId = project.getGroupId();\n        String artifactId = project.getArtifactId();\n\n        List<Path> classpath;\n        try {\n            classpath = new ArrayList<>();\n            for (String element : project.getRuntimeClasspathElements()) {\n                Path p = Paths.get(element);\n                if (!p.equals(classesDir)) {\n                    classpath.add(p);\n                }\n            }\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Failed to resolve runtime classpath\", e);\n        }\n\n        getLog().info(\"Generating recipe CSV from: \" + classesDir);\n        getLog().info(\"Using GAV: \" + groupId + \":\" + artifactId);\n\n        MavenRecipeMarketplaceGenerator generator = new MavenRecipeMarketplaceGenerator(\n                new GroupArtifact(groupId, artifactId),\n                classesDir,\n                classpath\n        );\n        RecipeMarketplace generated = generator.generate();\n\n        Path outputPath = project.getBasedir().toPath()\n                .resolve(\"src/main/resources/META-INF/rewrite/recipes.csv\");\n\n        RecipeMarketplace marketplace = generated;\n        if (Files.exists(outputPath)) {\n            getLog().info(\"Found existing recipes.csv, merging...\");\n            RecipeMarketplaceReader reader = new RecipeMarketplaceReader();\n            RecipeMarketplace existing = reader.fromCsv(outputPath);\n            existing.getRoot().merge(generated.getRoot());\n            marketplace = existing;\n        }\n\n        RecipeMarketplaceWriter writer = new RecipeMarketplaceWriter();\n        String csv = writer.toCsv(marketplace);\n\n        // Skip if CSV has only a header line (no actual recipes)\n        int lineCount = 0;\n        for (int i = 0; i < csv.length(); i++) {\n            if (csv.charAt(i) == '\\n') {\n                lineCount++;\n            }\n        }\n        if (lineCount <= 1) {\n            getLog().info(\"No recipes found, skipping recipes.csv generation\");\n            return;\n        }\n\n        try {\n            Files.createDirectories(outputPath.getParent());\n            Files.write(outputPath, csv.getBytes(StandardCharsets.UTF_8));\n        } catch (IOException e) {\n            throw new MojoExecutionException(\"Failed to write recipes.csv\", e);\n        }\n\n        getLog().info(\"Generated recipes.csv at: \" + outputPath.toAbsolutePath());\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RewriteDiscoverMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.jspecify.annotations.Nullable;\nimport org.openrewrite.config.Environment;\nimport org.openrewrite.config.OptionDescriptor;\nimport org.openrewrite.config.RecipeDescriptor;\nimport org.openrewrite.internal.StringUtils;\nimport org.openrewrite.style.NamedStyles;\n\nimport java.util.*;\n\n/**\n * Generate a report of the available recipes and styles found on the classpath.<br>\n * <br>\n * Can also be used to display information about a specific recipe. For example:<br>\n * {@code ./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat}\n */\n@Mojo(name = \"discover\", threadSafe = true, requiresProject = false, aggregator = true)\n@SuppressWarnings(\"unused\")\npublic class RewriteDiscoverMojo extends AbstractRewriteMojo {\n\n    /**\n     * The name of a specific recipe to show details for. For example:<br>\n     * {@code ./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat}\n     */\n    @Parameter(property = \"recipe\")\n    @Nullable\n    String recipe;\n\n    /**\n     * Whether to display recipe details such as displayName, description, and configuration options.\n     */\n    @Parameter(property = \"detail\", defaultValue = \"false\")\n    boolean detail;\n\n    /**\n     * The maximum level of recursion to display recipe descriptors under recipeList.\n     */\n    @Parameter(property = \"recursion\", defaultValue = \"0\")\n    int recursion;\n\n\n    @Override\n    public void execute() throws MojoExecutionException {\n        Environment env = environment();\n        Collection<RecipeDescriptor> availableRecipeDescriptors = env.listRecipeDescriptors();\n        if (recipe != null) {\n            RecipeDescriptor rd = getRecipeDescriptor(recipe, availableRecipeDescriptors);\n            writeRecipeDescriptor(rd, detail, 0, 0);\n        } else {\n            Collection<RecipeDescriptor> activeRecipeDescriptors = new HashSet<>();\n            for (String activeRecipe : getActiveRecipes()) {\n                RecipeDescriptor rd = getRecipeDescriptor(activeRecipe, availableRecipeDescriptors);\n                activeRecipeDescriptors.add(rd);\n            }\n            writeDiscovery(availableRecipeDescriptors, activeRecipeDescriptors, env.listStyles());\n        }\n    }\n\n    private static final String RECIPE_NOT_FOUND_EXCEPTION_MSG = \"Could not find recipe '%s' among available recipes\";\n\n    private static RecipeDescriptor getRecipeDescriptor(String recipe, Collection<RecipeDescriptor> recipeDescriptors) throws MojoExecutionException {\n        return recipeDescriptors.stream()\n                .filter(r -> r.getName().equalsIgnoreCase(recipe))\n                .findAny()\n                .orElseThrow(() -> new MojoExecutionException(String.format(RECIPE_NOT_FOUND_EXCEPTION_MSG, recipe)));\n    }\n\n    private void writeDiscovery(Collection<RecipeDescriptor> availableRecipeDescriptors, Collection<RecipeDescriptor> activeRecipeDescriptors, Collection<NamedStyles> availableStyles) {\n        List<RecipeDescriptor> availableRecipesSorted = new ArrayList<>(availableRecipeDescriptors);\n        availableRecipesSorted.sort(Comparator.comparing(RecipeDescriptor::getName, String.CASE_INSENSITIVE_ORDER));\n        getLog().info(\"Available Recipes:\");\n        for (RecipeDescriptor recipeDescriptor : availableRecipesSorted) {\n            writeRecipeDescriptor(recipeDescriptor, detail, 0, 1);\n        }\n\n        List<NamedStyles> availableStylesSorted = new ArrayList<>(availableStyles);\n        availableStylesSorted.sort(Comparator.comparing(NamedStyles::getName, String.CASE_INSENSITIVE_ORDER));\n        getLog().info(\"\");\n        getLog().info(\"Available Styles:\");\n        for (NamedStyles style : availableStylesSorted) {\n            getLog().info(\"    \" + style.getName());\n        }\n\n        List<String> activeStylesSorted = new ArrayList<>(getActiveStyles());\n        activeStylesSorted.sort(String.CASE_INSENSITIVE_ORDER);\n        getLog().info(\"\");\n        getLog().info(\"Active Styles:\");\n        for (String activeStyle : activeStylesSorted) {\n            getLog().info(\"    \" + activeStyle);\n        }\n\n        List<RecipeDescriptor> activeRecipesSorted = new ArrayList<>(activeRecipeDescriptors);\n        activeRecipesSorted.sort(Comparator.comparing(RecipeDescriptor::getName, String.CASE_INSENSITIVE_ORDER));\n        getLog().info(\"\");\n        getLog().info(\"Active Recipes:\");\n        for (RecipeDescriptor recipeDescriptor : activeRecipesSorted) {\n            writeRecipeDescriptor(recipeDescriptor, detail, 0, 1);\n        }\n\n        getLog().info(\"\");\n        getLog().info(\"Found \" + availableRecipeDescriptors.size() + \" available recipes and \" + availableStyles.size() + \" available styles.\");\n        getLog().info(\"Configured with \" + activeRecipeDescriptors.size() + \" active recipes and \" + getActiveStyles().size() + \" active styles.\");\n    }\n\n    private void writeRecipeDescriptor(RecipeDescriptor rd, boolean verbose, int currentRecursionLevel, int indentLevel) {\n        String indent = StringUtils.repeat(\"    \", indentLevel);\n        if (currentRecursionLevel <= recursion) {\n            if (verbose) {\n\n                getLog().info(indent + rd.getDisplayName());\n                getLog().info(indent + \"    \" + rd.getName());\n                // Recipe parsed from yaml might have null description, even though that isn't technically allowed\n                //noinspection ConstantConditions\n                if (rd.getDescription() != null && !rd.getDescription().isEmpty()) {\n                    getLog().info(indent + \"    \" + rd.getDescription());\n                }\n\n                if (!rd.getOptions().isEmpty()) {\n                    getLog().info(indent + \"options: \");\n                    for (OptionDescriptor od : rd.getOptions()) {\n                        getLog().info(indent + \"    \" + od.getName() + \": \" + od.getType() + (od.isRequired() ? \"!\" : \"\"));\n                        if (od.getDescription() != null && !od.getDescription().isEmpty()) {\n                            getLog().info(indent + \"    \" + \"    \" + od.getDescription());\n                        }\n                    }\n                }\n            } else {\n                getLog().info(indent + rd.getName());\n            }\n\n            if (!rd.getRecipeList().isEmpty() && (currentRecursionLevel + 1 <= recursion)) {\n                getLog().info(indent + \"recipeList:\");\n                for (RecipeDescriptor r : rd.getRecipeList()) {\n                    writeRecipeDescriptor(r, verbose, currentRecursionLevel + 1, indentLevel + 1);\n                }\n            }\n\n            if (verbose) {\n                getLog().info(\"\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RewriteDryRunMojo.java",
    "content": "/*\r\n * Copyright 2020 the original author or authors.\r\n * <p>\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * <p>\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n * <p>\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\npackage org.openrewrite.maven;\r\n\r\nimport org.apache.maven.plugins.annotations.Execute;\r\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\r\nimport org.apache.maven.plugins.annotations.Mojo;\r\nimport org.apache.maven.plugins.annotations.ResolutionScope;\r\n\r\n/**\r\n * Generate warnings to the console for any recipe that would make changes, but do not make changes.\r\n * <p>\r\n * This variant of rewrite:dryRun will fork the maven life cycle and can be run as a \"stand-alone\" goal. It will\r\n * execute the maven build up to the process-test-classes phase.\r\n */\r\n@Execute(phase = LifecyclePhase.PROCESS_TEST_CLASSES)\r\n@Mojo(name = \"dryRun\", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true,\r\n        defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES)\r\npublic class RewriteDryRunMojo extends AbstractRewriteDryRunMojo {\r\n}\r\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RewriteDryRunNoForkMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\n\n/**\n * Generate warnings to the console for any recipe that would make changes, but do not make changes.\n * <p>\n * This variant of rewrite:dryRun will not fork the maven life cycle and can be used (along with other goals) without\n * triggering repeated life-cycle events. It will execute the maven build up to the process-test-classes phase.\n */\n@Mojo(name = \"dryRunNoFork\", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true,\n        defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES)\npublic class RewriteDryRunNoForkMojo extends AbstractRewriteDryRunMojo {\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RewriteRunMojo.java",
    "content": "/*\r\n * Copyright 2020 the original author or authors.\r\n * <p>\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * <p>\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n * <p>\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\npackage org.openrewrite.maven;\r\n\r\nimport org.apache.maven.plugins.annotations.Execute;\r\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\r\nimport org.apache.maven.plugins.annotations.Mojo;\r\nimport org.apache.maven.plugins.annotations.ResolutionScope;\r\n\r\n/**\r\n * Run the configured recipes and apply the changes locally.\r\n * <p>\r\n * This variant of rewrite:run will fork the maven life cycle and can be run as a \"stand-alone\" goal. It will\r\n * execute the maven build up to the process-test-classes phase.\r\n */\r\n@Execute(phase = LifecyclePhase.PROCESS_TEST_CLASSES)\r\n@Mojo(name = \"run\", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true,\r\n        defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES)\r\npublic class RewriteRunMojo extends AbstractRewriteRunMojo {\r\n}\r\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RewriteRunNoForkMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\n\n/**\n * Run the configured recipes and apply the changes locally.\n * <p>\n * This variant of rewrite:run will not fork the maven life cycle and can be used (along with other goals) without\n * triggering repeated life-cycle events.\n */\n@Mojo(name = \"runNoFork\", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true,\n        defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES)\npublic class RewriteRunNoForkMojo extends AbstractRewriteRunMojo {\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/RewriteTypeTableMojo.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugins.annotations.Execute;\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\nimport org.eclipse.aether.artifact.Artifact;\nimport org.openrewrite.java.internal.parser.TypeTable;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Set;\n\nimport static java.nio.file.Files.exists;\nimport static java.util.Collections.singleton;\n\n/**\n * Create a TypeTable in `src/main/resources/META-INF/rewrite/classpath.tsv.zip` for `rewrite.recipeArtifactCoordinates`.\n * {@code ./mvnw rewrite:typetable}\n */\n@Execute(phase = LifecyclePhase.GENERATE_RESOURCES)\n@Mojo(name = \"typetable\", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.GENERATE_RESOURCES)\npublic class RewriteTypeTableMojo extends AbstractRewriteMojo {\n\n    @Override\n    public void execute() throws MojoExecutionException {\n        Set<String> recipeArtifactCoordinates = getRecipeArtifactCoordinates();\n        String srcMainResources = project.getResources().get(0).getDirectory();\n        Path tsvFile = Paths.get(srcMainResources).resolve(TypeTable.DEFAULT_RESOURCE_PATH);\n        Path parentFile = tsvFile.getParent();\n        if (!parentFile.toFile().mkdirs() && !exists(parentFile)) {\n            throw new MojoExecutionException(\"Unable to create \" + parentFile);\n        }\n\n        try (TypeTable.Writer writer = TypeTable.newWriter(Files.newOutputStream(tsvFile))) {\n            for (String recipeArtifactCoordinate : recipeArtifactCoordinates) {\n                // Resolve per GAV, to handle multiple versions of the same artifact\n                for (Artifact artifact : resolveArtifacts(recipeArtifactCoordinate)) {\n                    writer.jar(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion())\n                            .write(artifact.getFile().toPath());\n                    getLog().info(String.format(\"Wrote %s\", artifact));\n                }\n            }\n            getLog().info(\"Wrote \" + project.getBasedir().toPath().relativize(tsvFile));\n\n        } catch (IOException e) {\n            throw new MojoExecutionException(\"Unable to generate TypeTable\", e);\n        }\n    }\n\n    private Set<Artifact> resolveArtifacts(String recipeArtifactCoordinate) throws MojoExecutionException {\n        ArtifactResolver resolver = new ArtifactResolver(repositorySystem, mavenSession);\n        Artifact artifact = resolver.createArtifact(recipeArtifactCoordinate);\n        return resolver.resolveArtifactsAndDependencies(singleton(artifact));\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/SanitizedMarkerPrinter.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.openrewrite.Cursor;\nimport org.openrewrite.PrintOutputCapture;\nimport org.openrewrite.marker.Marker;\nimport org.openrewrite.marker.SearchResult;\n\nimport java.util.function.UnaryOperator;\n\n/**\n * A {@link PrintOutputCapture} that sanitizes the diff of informational markers,\n * so these aren't accidentally committed to source control.\n */\npublic class SanitizedMarkerPrinter implements PrintOutputCapture.MarkerPrinter {\n    @Override\n    public String beforeSyntax(Marker marker, Cursor cursor, UnaryOperator<String> commentWrapper) {\n        if (marker instanceof SearchResult) {\n            return DEFAULT.beforeSyntax(marker, cursor, commentWrapper);\n        }\n        return \"\";\n    }\n\n    @Override\n    public String afterSyntax(Marker marker, Cursor cursor, UnaryOperator<String> commentWrapper) {\n        if (marker instanceof SearchResult) {\n            return DEFAULT.afterSyntax(marker, cursor, commentWrapper);\n        }\n        return \"\";\n    }\n}\n"
  },
  {
    "path": "src/main/java/org/openrewrite/maven/package-info.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n@org.jspecify.annotations.NullMarked\npackage org.openrewrite.maven;\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/AbstractRewriteMojoTest.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.execution.DefaultMavenExecutionRequest;\nimport org.apache.maven.execution.DefaultMavenExecutionResult;\nimport org.apache.maven.execution.MavenSession;\nimport org.apache.maven.project.MavenProject;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.openrewrite.Recipe;\nimport org.openrewrite.config.Environment;\n\nimport java.io.File;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.Collection;\nimport java.util.Properties;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass AbstractRewriteMojoTest {\n\n    @Test\n    void resolvePropertiesInYamlUsesUserProperties(@TempDir Path temp) throws Exception {\n        DefaultMavenExecutionRequest request = new DefaultMavenExecutionRequest();\n        Properties userProps = new Properties();\n        userProps.setProperty(\"myValue\", \"resolvedValue\");\n        request.setUserProperties(userProps);\n        MavenSession session = new MavenSession(null, null, request, new DefaultMavenExecutionResult());\n\n        String yaml = \"\"\"\n                type: specs.openrewrite.org/v1beta/recipe\n                name: test.UserPropRecipe\n                displayName: \"${myValue}\"\n                recipeList: []\n                \"\"\";\n        Files.writeString(temp.resolve(\"rewrite.yml\"), yaml);\n\n        AbstractRewriteMojo mojo = new AbstractRewriteMojo() {\n            {\n                configLocation = \"rewrite.yml\";\n                resolvePropertiesInYaml = true;\n                project = new MavenProject();\n                project.setFile(new File(temp.toFile(), \"pom.xml\"));\n                mavenSession = session;\n            }\n\n            @Override\n            public void execute() {\n            }\n        };\n\n        Environment env = mojo.environment(null);\n        Collection<Recipe> recipes = env.listRecipes();\n        Recipe recipe = recipes.stream()\n                .filter(r -> \"test.UserPropRecipe\".equals(r.getName()))\n                .findFirst()\n                .orElseThrow(() -> new AssertionError(\"Recipe not found\"));\n        assertThat(recipe.getDisplayName()).isEqualTo(\"resolvedValue\");\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"rewrite.yml\"})\n    void configLocation(String loc, @TempDir Path temp) throws Exception {\n        AbstractRewriteMojo mojo = new AbstractRewriteMojo() {\n            {\n                configLocation = loc;\n                project = new MavenProject();\n                project.setFile(new File(temp.toFile(), \"pom.xml\"));\n            }\n\n            @Override\n            public void execute() {\n            }\n        };\n\n        if (!loc.startsWith(\"http\")) {\n            Files.writeString(temp.resolve(loc), \"rewrite\");\n        }\n\n        AbstractRewriteMojo.Config config = mojo.getConfig();\n        assertThat(config).isNotNull();\n        try (InputStream is = config.inputStream) {\n            assertThat(is.readAllBytes()).isNotEmpty();\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/BasicIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\nimport org.junit.jupiter.api.Disabled;\nimport org.openrewrite.maven.jupiter.extension.GitJupiterExtension;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@GitJupiterExtension\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\nclass BasicIT {\n\n    @MavenGoal(\"clean\")\n    @MavenGoal(\"package\")\n    @MavenTest\n    void groupid_artifactid_should_be_ok(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .containsOnly(\"JAR will be empty - no content was marked for inclusion!\");\n    }\n\n    @Disabled\n    @MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:dryRun\")\n    @MavenOption(value = MavenCLIOptions.SETTINGS, parameter = \"settings.xml\")\n    @MavenTest\n    void null_check_profile_activation(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .info()\n                .anySatisfy(line -> assertThat(line).contains(\"Applying recipes would make no changes. No patch file generated.\"));\n\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                // Ignore warning logged on Mac OS X; https://github.com/openrewrite/rewrite-maven-plugin/issues/506\n                .filteredOn(warn -> !\"Unable to initialize RocksdbMavenPomCache, falling back to InMemoryMavenPomCache\".equals(warn))\n                .isEmpty();\n    }\n\n    @MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:dryRun\")\n    @MavenTest\n    @SystemProperty(value = \"ossrh_snapshots_url\", content = \"https://central.sonatype.com/repository/maven-snapshots\")\n    void resolves_maven_properties_from_user_provided_system_properties(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .allSatisfy(line -> assertThat(line).doesNotContain(\"Invalid repository URL ${ossrh_snapshots_url}\"))\n                .allSatisfy(line -> assertThat(line).doesNotContain(\"Unable to resolve property ${ossrh_snapshots_url}\"));\n    }\n\n    @MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:dryRun\")\n    @MavenOption(value = MavenCLIOptions.SETTINGS, parameter = \"settings-user.xml\")\n    @MavenProfile(\"example_profile_id\")\n    @MavenTest\n    @SystemProperty(value = \"REPOSITORY_URL\", content = \"https://maven-eu.nuxeo.org/nexus/content/repositories/public/\")\n    void resolves_settings(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .plain()\n                .allSatisfy(line -> assertThat(line).doesNotContain(\"Illegal character in path at index 1\"));\n    }\n\n    @MavenGoal(\"clean\")\n    @MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:dryRun\")\n    @MavenTest\n    void snapshot_ok(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .isEmpty();\n        assertThat(result).out().info().contains(\"Running recipe(s)...\");\n    }\n\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/DiscoverNoActiveRecipeIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:discover\")\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\nclass DiscoverNoActiveRecipeIT {\n\n    @MavenTest\n    void single_project(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .error()\n                .noneSatisfy(line -> assertThat(line).contains(\"Could not find recipe 'null' among available recipes\"));\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/KotlinIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\nimport org.openrewrite.maven.jupiter.extension.GitJupiterExtension;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@DisabledOnOs(OS.WINDOWS)\n@MavenGoal(\"install\")\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:run\")\n@GitJupiterExtension\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\n@MavenOption(MavenCLIOptions.VERBOSE)\nclass KotlinIT {\n    @MavenTest\n    void kotlin_in_src_main_java(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .debug()\n          .anySatisfy(line -> assertThat(line).contains(\"Scanned 1 kotlin source files in main scope.\"))\n          .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.kotlin.format.AutoFormat\"));\n    }\n\n    @MavenTest\n    void kotlin_in_src_main_test(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .debug()\n          .anySatisfy(line -> assertThat(line).contains(\"Scanned 1 kotlin source files in test scope.\"))\n          .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.kotlin.format.AutoFormat\"));\n    }\n\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/MavenCLIExtra.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nfinal class MavenCLIExtra\n{\n    /**\n     * User property to mute Maven 3.9.2+ \"plugin validation\" warnings.\n     */\n    static final String MUTE_PLUGIN_VALIDATION_WARNING = \"-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugin.internal.DefaultPluginValidationManager=off\";\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/MavenMojoProjectParserIsExcludedTest.java",
    "content": "/*\n * Copyright 2026 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.openrewrite.jgit.api.Git;\nimport org.openrewrite.jgit.lib.Repository;\n\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.FileSystems;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.PathMatcher;\nimport java.util.Collection;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n/**\n * Tests for the gitignore handling in {@link MavenMojoProjectParser#isExcluded}.\n * <p>\n * The original implementation had a bug where the recursive call that prepends\n * \"/\" for PathMatcher compatibility caused the JGit TreeWalk path comparison\n * to never match, making the gitignore check dead code. These tests verify\n * that gitignore exclusions actually take effect for relative paths.\n */\nclass MavenMojoProjectParserIsExcludedTest {\n\n    @Test\n    void untrackedGitIgnoredFileIsExcluded(@TempDir Path tempDir) throws Exception {\n        try (Git git = Git.init().setDirectory(tempDir.toFile()).call()) {\n            Repository repo = git.getRepository();\n\n            writeFile(tempDir.resolve(\".gitignore\"), \"generated.txt\\n\");\n            writeFile(tempDir.resolve(\"generated.txt\"), \"untracked content\");\n\n            git.add().addFilepattern(\".gitignore\").call();\n            git.commit().setMessage(\"initial\").call();\n\n            assertThat(MavenMojoProjectParser.isExcluded(repo, emptyList(), Path.of(\"generated.txt\")))\n                    .as(\"untracked gitignored file should be excluded\")\n                    .isTrue();\n        }\n    }\n\n    @Test\n    void trackedGitIgnoredFileIsNotExcluded(@TempDir Path tempDir) throws Exception {\n        try (Git git = Git.init().setDirectory(tempDir.toFile()).call()) {\n            Repository repo = git.getRepository();\n\n            writeFile(tempDir.resolve(\"tracked-ignored.txt\"), \"content\");\n            git.add().addFilepattern(\"tracked-ignored.txt\").call();\n            git.commit().setMessage(\"initial\").call();\n\n            writeFile(tempDir.resolve(\".gitignore\"), \"tracked-ignored.txt\\n\");\n            git.add().addFilepattern(\".gitignore\").call();\n            git.commit().setMessage(\"add gitignore\").call();\n\n            assertThat(MavenMojoProjectParser.isExcluded(repo, emptyList(), Path.of(\"tracked-ignored.txt\")))\n                    .as(\"tracked gitignored file should NOT be excluded\")\n                    .isFalse();\n        }\n    }\n\n    @Test\n    void untrackedFileInGitIgnoredDirectoryIsExcluded(@TempDir Path tempDir) throws Exception {\n        try (Git git = Git.init().setDirectory(tempDir.toFile()).call()) {\n            Repository repo = git.getRepository();\n\n            writeFile(tempDir.resolve(\".gitignore\"), \"target/\\n\");\n            writeFile(tempDir.resolve(\"target/output.txt\"), \"untracked content\");\n\n            git.add().addFilepattern(\".gitignore\").call();\n            git.commit().setMessage(\"initial\").call();\n\n            assertThat(MavenMojoProjectParser.isExcluded(repo, emptyList(), Path.of(\"target/output.txt\")))\n                    .as(\"untracked file in gitignored directory should be excluded\")\n                    .isTrue();\n        }\n    }\n\n    @Test\n    void trackedFileInGitIgnoredDirectoryIsNotExcluded(@TempDir Path tempDir) throws Exception {\n        try (Git git = Git.init().setDirectory(tempDir.toFile()).call()) {\n            Repository repo = git.getRepository();\n\n            writeFile(tempDir.resolve(\"target/output.txt\"), \"tracked content\");\n            git.add().addFilepattern(\"target/output.txt\").call();\n            git.commit().setMessage(\"initial\").call();\n\n            writeFile(tempDir.resolve(\".gitignore\"), \"target/\\n\");\n            git.add().addFilepattern(\".gitignore\").call();\n            git.commit().setMessage(\"add gitignore\").call();\n\n            assertThat(MavenMojoProjectParser.isExcluded(repo, emptyList(), Path.of(\"target/output.txt\")))\n                    .as(\"tracked file in gitignored directory should NOT be excluded\")\n                    .isFalse();\n        }\n    }\n\n    @Test\n    void exclusionMatcherMatchesDirectly() {\n        Collection<PathMatcher> matchers = singletonList(\n                FileSystems.getDefault().getPathMatcher(\"glob:**/secret.properties\"));\n\n        assertThat(MavenMojoProjectParser.isExcluded(null, matchers, Path.of(\"config/secret.properties\")))\n                .as(\"path matching exclusion pattern should be excluded\")\n                .isTrue();\n    }\n\n    @Test\n    void exclusionMatcherDoesNotMatchUnrelatedPath() {\n        Collection<PathMatcher> matchers = singletonList(\n                FileSystems.getDefault().getPathMatcher(\"glob:**/secret.properties\"));\n\n        assertThat(MavenMojoProjectParser.isExcluded(null, matchers, Path.of(\"config/application.properties\")))\n                .as(\"path not matching exclusion pattern should not be excluded\")\n                .isFalse();\n    }\n\n    @Test\n    void exclusionMatcherMatchesRootFileViaPrefixedSlash() {\n        // PathMatcher won't match \"pom.xml\" against \"**/pom.xml\" without a leading slash;\n        // isExcluded handles this by re-checking with a \"/\" prefix for relative paths\n        Collection<PathMatcher> matchers = singletonList(\n                FileSystems.getDefault().getPathMatcher(\"glob:**/pom.xml\"));\n\n        assertThat(MavenMojoProjectParser.isExcluded(null, matchers, Path.of(\"pom.xml\")))\n                .as(\"root-level file should match **/pom.xml via leading-slash prefixing\")\n                .isTrue();\n    }\n\n    @Test\n    void exclusionMatcherMatchesRootFileWithLeadingSlash() {\n        // When the path already has a leading slash, it should match directly\n        // without needing the prefixing logic\n        Collection<PathMatcher> matchers = singletonList(\n                FileSystems.getDefault().getPathMatcher(\"glob:**/pom.xml\"));\n\n        assertThat(MavenMojoProjectParser.isExcluded(null, matchers, Path.of(\"/pom.xml\")))\n                .as(\"root-level file with leading slash should match **/pom.xml directly\")\n                .isTrue();\n    }\n\n    @Test\n    void exclusionMatcherMatchesSubdirFileWithoutPrefixing() {\n        // A file in a subdirectory should match directly without needing the \"/\" prefix path\n        Collection<PathMatcher> matchers = singletonList(\n                FileSystems.getDefault().getPathMatcher(\"glob:**/pom.xml\"));\n\n        assertThat(MavenMojoProjectParser.isExcluded(null, matchers, Path.of(\"module/pom.xml\")))\n                .as(\"subdirectory file should match **/pom.xml directly\")\n                .isTrue();\n    }\n\n    private static void writeFile(Path path, String content) throws Exception {\n        Files.createDirectories(path.getParent());\n        Files.write(path, content.getBytes(StandardCharsets.UTF_8));\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/MavenMojoProjectParserTest.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport org.apache.maven.model.Build;\nimport org.apache.maven.model.Plugin;\nimport org.apache.maven.project.MavenProject;\nimport org.codehaus.plexus.util.xml.Xpp3Dom;\nimport org.junit.jupiter.api.DisplayName;\nimport org.junit.jupiter.api.Test;\nimport org.openrewrite.java.marker.JavaVersion;\n\nimport java.nio.charset.Charset;\nimport java.util.Optional;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatCode;\n\n/**\n * @author Fabian Krüger\n */\nclass MavenMojoProjectParserTest {\n    @DisplayName(\"Given No Java version information exists in Maven Then java.specification.version should be used\")\n    @Test\n    void givenNoJavaVersionInformationExistsInMavenThenJavaSpecificationVersionShouldBeUsed() {\n        JavaVersion marker = MavenMojoProjectParser.getSrcTestJavaVersion(new MavenProject());\n        assertThat(marker.getSourceCompatibility()).isEqualTo(System.getProperty(\"java.specification.version\"));\n        assertThat(marker.getTargetCompatibility()).isEqualTo(System.getProperty(\"java.specification.version\"));\n    }\n\n    @DisplayName(\"getCharset should resolve encoding from property placeholder\")\n    @Test\n    void getCharsetShouldResolveEncodingFromPropertyPlaceholder() {\n        MavenProject mavenProject = new MavenProject();\n        mavenProject.getProperties().setProperty(\"java.encoding\", \"UTF-8\");\n\n        // Set up maven-compiler-plugin with encoding as property placeholder\n        Plugin compilerPlugin = new Plugin();\n        compilerPlugin.setGroupId(\"org.apache.maven.plugins\");\n        compilerPlugin.setArtifactId(\"maven-compiler-plugin\");\n\n        Xpp3Dom configuration = new Xpp3Dom(\"configuration\");\n        Xpp3Dom encoding = new Xpp3Dom(\"encoding\");\n        encoding.setValue(\"${java.encoding}\");\n        configuration.addChild(encoding);\n        compilerPlugin.setConfiguration(configuration);\n\n        Build build = new Build();\n        build.addPlugin(compilerPlugin);\n        mavenProject.setBuild(build);\n\n        // Should resolve the property and return the charset\n        Optional<Charset> charset = MavenMojoProjectParser.getCharset(mavenProject);\n        assertThat(charset).isPresent();\n        assertThat(charset.get().name()).isEqualTo(\"UTF-8\");\n    }\n\n    @DisplayName(\"getCharset should return empty when property placeholder is unresolved\")\n    @Test\n    void getCharsetShouldReturnEmptyWhenPropertyPlaceholderIsUnresolved() {\n        MavenProject mavenProject = new MavenProject();\n\n        // Set up maven-compiler-plugin with encoding as property placeholder (not defined)\n        Plugin compilerPlugin = new Plugin();\n        compilerPlugin.setGroupId(\"org.apache.maven.plugins\");\n        compilerPlugin.setArtifactId(\"maven-compiler-plugin\");\n\n        Xpp3Dom configuration = new Xpp3Dom(\"configuration\");\n        Xpp3Dom encoding = new Xpp3Dom(\"encoding\");\n        encoding.setValue(\"${java.encoding}\");\n        configuration.addChild(encoding);\n        compilerPlugin.setConfiguration(configuration);\n\n        Build build = new Build();\n        build.addPlugin(compilerPlugin);\n        mavenProject.setBuild(build);\n\n        // Should not throw IllegalCharsetNameException\n        assertThatCode(() -> MavenMojoProjectParser.getCharset(mavenProject))\n                .doesNotThrowAnyException();\n\n        // Should return empty when encoding is unresolved placeholder\n        Optional<Charset> charset = MavenMojoProjectParser.getCharset(mavenProject);\n        assertThat(charset).isEmpty();\n    }\n\n    @DisplayName(\"getCharset should not throw when project.build.sourceEncoding is a property placeholder\")\n    @Test\n    void getCharsetShouldNotThrowWhenSourceEncodingIsPropertyPlaceholder() {\n        MavenProject mavenProject = new MavenProject();\n        mavenProject.setBuild(new Build());\n        mavenProject.getProperties().setProperty(\"project.build.sourceEncoding\", \"${java.encoding}\");\n\n        // Should not throw IllegalCharsetNameException\n        assertThatCode(() -> MavenMojoProjectParser.getCharset(mavenProject))\n                .doesNotThrowAnyException();\n\n        // Should return empty when encoding is unresolved placeholder\n        Optional<Charset> charset = MavenMojoProjectParser.getCharset(mavenProject);\n        assertThat(charset).isEmpty();\n    }\n\n    @DisplayName(\"getCharset should return charset when encoding is valid\")\n    @Test\n    void getCharsetShouldReturnCharsetWhenEncodingIsValid() {\n        MavenProject mavenProject = new MavenProject();\n\n        // Set up maven-compiler-plugin with valid encoding\n        Plugin compilerPlugin = new Plugin();\n        compilerPlugin.setGroupId(\"org.apache.maven.plugins\");\n        compilerPlugin.setArtifactId(\"maven-compiler-plugin\");\n\n        Xpp3Dom configuration = new Xpp3Dom(\"configuration\");\n        Xpp3Dom encoding = new Xpp3Dom(\"encoding\");\n        encoding.setValue(\"UTF-8\");\n        configuration.addChild(encoding);\n        compilerPlugin.setConfiguration(configuration);\n\n        Build build = new Build();\n        build.addPlugin(compilerPlugin);\n        mavenProject.setBuild(build);\n\n        Optional<Charset> charset = MavenMojoProjectParser.getCharset(mavenProject);\n        assertThat(charset).isPresent();\n        assertThat(charset.get().name()).isEqualTo(\"UTF-8\");\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/RecipeCsvGenerateIT.java",
    "content": "/*\n * Copyright 2026 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:recipeCsvGenerate\")\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\nclass RecipeCsvGenerateIT {\n\n    @MavenTest\n    void generates_csv_from_yaml_recipe(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .project()\n          .has(\"src/main/resources/META-INF/rewrite\");\n        assertThat(result).out().info()\n          .anySatisfy(line -> assertThat(line).contains(\"Generated recipes.csv\"));\n    }\n\n    @MavenTest\n    void generates_csv_from_java_recipe(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .project()\n          .has(\"src/main/resources/META-INF/rewrite\");\n        assertThat(result).out().info()\n          .anySatisfy(line -> assertThat(line).contains(\"Generated recipes.csv\"));\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/RewriteDiscoverIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\nimport org.junit.jupiter.api.Nested;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@MavenGoal(\"clean\")\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:discover\")\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\nclass RewriteDiscoverIT {\n\n    @Nested\n    class RecipeLookup {\n\n        @MavenTest\n        @SystemProperty(value = \"detail\", content = \"true\")\n        void rewrite_discover_detail(MavenExecutionResult result) {\n            assertThat(result)\n              .isSuccessful()\n              .out()\n              .info()\n              .anySatisfy(line -> assertThat(line).contains(\"options\"));\n\n            assertThat(result).out().warn().isEmpty();\n        }\n\n        @MavenTest\n        @SystemProperty(value = \"recipe\", content = \"org.openrewrite.JAVA.format.AutoFormAT\")\n        void rewrite_discover_recipe_lookup_case_insensitive(MavenExecutionResult result) {\n            assertThat(result)\n              .isSuccessful()\n              .out()\n              .info()\n              .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.java.format.AutoFormat\"));\n        }\n\n        @MavenTest\n        @SystemProperty(value = \"recursion\", content = \"1\")\n        void rewrite_discover_recursion(MavenExecutionResult result) {\n            assertThat(result)\n              .isSuccessful()\n              .out()\n              .info()\n              .anySatisfy(line -> assertThat(line).contains(\"recipeList\"));\n\n            assertThat(result).out().warn().isEmpty();\n        }\n    }\n\n    @MavenTest\n    void rewrite_discover_default(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .info()\n          .matches(logLines ->\n            logLines.stream().anyMatch(logLine -> logLine.contains(\"org.openrewrite.java.format.AutoFormat\"))\n          )\n          .matches(logLines ->\n            logLines.stream().anyMatch(logLine -> logLine.contains(\"org.openrewrite.java.SpringFormat\"))\n          );\n\n        assertThat(result).out().warn().isEmpty();\n    }\n\n    @MavenTest\n    void rewrite_discover_rewrite_yml(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .info()\n          .anySatisfy(line -> assertThat(line).contains(\"com.example.RewriteDiscoverIT.CodeCleanup\"));\n\n        assertThat(result).out().warn().isEmpty();\n    }\n\n    @MavenTest\n    void rewrite_discover_multi_module(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .info()\n          .satisfiesOnlyOnce(line -> assertThat(line).contains(\":discover\"));\n\n        assertThat(result).out().warn().isEmpty();\n    }\n\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/RewriteDryRunIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\nimport org.openrewrite.maven.jupiter.extension.GitJupiterExtension;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:dryRun\")\n@GitJupiterExtension\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\n@MavenOption(MavenCLIOptions.VERBOSE)\nclass RewriteDryRunIT {\n\n    @MavenTest\n    void fail_on_dry_run(MavenExecutionResult result) {\n        assertThat(result)\n                .isFailure()\n                .out()\n                .error()\n                .anySatisfy(line -> assertThat(line).contains(\"Applying recipes would make changes\"));\n    }\n\n    @MavenTest\n    void multi_module_project(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.staticanalysis.SimplifyBooleanExpression\"));\n    }\n\n    @MavenTest\n    void recipe_order(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .info()\n                .anySatisfy(line -> assertThat(line).contains(\"Using active recipe(s) [com.example.RewriteDryRunIT.CodeCleanup, org.openrewrite.java.format.AutoFormat, org.openrewrite.staticanalysis.SimplifyBooleanExpression]\"));\n    }\n\n    @MavenTest\n    void single_project(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.java.format.AutoFormat\"));\n    }\n\n    @MavenTest\n    @SystemProperties({\n            @SystemProperty(value = \"rewrite.recipeArtifactCoordinates\", content = \"org.openrewrite.recipe:rewrite-testing-frameworks:2.0.3\"),\n            @SystemProperty(value = \"rewrite.activeRecipes\", content = \"org.openrewrite.java.testing.cleanup.AssertTrueNullToAssertNull\")\n    })\n    void no_plugin_in_pom(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.java.testing.cleanup.AssertTrueNullToAssertNull\"));\n    }\n\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/RewriteRunIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\nimport org.junit.jupiter.api.condition.OS;\nimport org.openrewrite.maven.jupiter.extension.GitJupiterExtension;\n\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.stream.Stream;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\nimport static java.util.stream.Collectors.toList;\nimport static org.assertj.core.api.Assertions.as;\nimport static org.assertj.core.api.InstanceOfAssertFactories.STRING;\nimport static org.openrewrite.PathUtils.separatorsToSystem;\n\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:run\")\n@GitJupiterExtension\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\nclass RewriteRunIT {\n\n    @MavenTest\n    void multi_module_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.staticanalysis.SimplifyBooleanExpression\"));\n    }\n\n    @MavenTest\n    void multi_module_resources(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/a/src/main/resources/example.xml\")))\n          .contains(\"    org.openrewrite.xml.ChangeTagName: {elementName=/foo, newName=bar}\");\n    }\n\n    @MavenGoal(\"generate-test-sources\")\n    @MavenTest\n    @SystemProperties({\n      @SystemProperty(value = \"rewrite.activeRecipes\", content = \"org.openrewrite.java.search.FindTypes\"),\n      @SystemProperty(value = \"rewrite.options\", content = \"fullyQualifiedTypeName=org.junit.jupiter.api.Test\")\n    })\n    void multi_source_sets_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/integration-test/java/sample/IntegrationTest.java\")))\n          .contains(\"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/test/java/sample/RegularTest.java\")));\n    }\n\n    @MavenGoal(\"generate-sources\")\n    @MavenTest\n    @SystemProperties({\n      @SystemProperty(value = \"rewrite.activeRecipes\", content = \"org.openrewrite.java.format.SingleLineComments\"),\n    })\n    void multi_main_source_sets_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\"Changes have been made to project/src/main/java/sample/MainClass.java by:\")\n          .contains(\"Changes have been made to project/src/additional-main/java/sample/AdditionalMainClass.java by:\");\n    }\n\n    @MavenTest\n    void basedir_resource_no_plaintext_leak(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/main/java/sample/Main.java\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/test/java/sample/MainTest.java\"))\n          );\n    }\n\n    @MavenTest\n    void single_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.java.format.AutoFormat\"));\n    }\n\n    @MavenTest\n    void checkstyle_inline_rules(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .noneSatisfy(line -> assertThat(line).contains(\"Unable to parse checkstyle configuration\"));\n    }\n\n    @MavenTest\n    void recipe_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isFailure()\n          .out()\n          .error()\n          .anySatisfy(line -> assertThat(line).contains(separatorsToSystem(\"/sample/ThrowingRecipe.java\"), \"This recipe throws an exception\"));\n    }\n\n    @MavenTest\n    void cloud_suitability_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .anySatisfy(line -> assertThat(line).contains(\"some.jks\"));\n    }\n\n    @MavenTest\n    @SystemProperties({\n      @SystemProperty(value = \"rewrite.activeRecipes\", content = \"org.openrewrite.maven.RemovePlugin\"),\n      @SystemProperty(value = \"rewrite.options\", content = \"groupId=org.openrewrite.maven,artifactId=rewrite-maven-plugin\")\n    })\n    void command_line_options(MavenExecutionResult result) {\n        assertThat(result).isSuccessful().out().error().isEmpty();\n        assertThat(result).isSuccessful().out().warn()\n          .contains(\"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/pom.xml\")))\n          .contains(\"    org.openrewrite.maven.RemovePlugin: {groupId=org.openrewrite.maven, artifactId=rewrite-maven-plugin}\");\n        assertThat(result.getMavenProjectResult().getModel().getBuild()).isNull();\n    }\n\n    @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Quotes for comment are removed during execution\")\n    @SystemProperties({\n      @SystemProperty(value = \"rewrite.activeRecipes\", content = \"org.openrewrite.java.AddCommentToMethod\"),\n      @SystemProperty(value = \"rewrite.options\", content = \"comment='{\\\"test\\\":{\\\"some\\\":\\\"yeah\\\"}}',methodPattern=sample.SomeClass doTheThing(..)\")\n    })\n    @MavenTest\n    void command_line_options_json(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/main/java/sample/SomeClass.java\")))\n          .contains(\"    org.openrewrite.java.AddCommentToMethod: {comment='{\\\"test\\\":{\\\"some\\\":\\\"yeah\\\"}}', methodPattern=sample.SomeClass doTheThing(..)}\");\n    }\n\n    @MavenTest\n    void java_upgrade_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .filteredOn(line -> line.contains(\"Changes have been made\"))\n          .hasSize(1);\n    }\n\n    @MavenTest\n    void java_compiler_plugin_project(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .filteredOn(line -> line.contains(\"Changes have been made\"))\n          .hasSize(1);\n    }\n\n    @MavenTest\n    void container_masks(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/containerfile.build\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/Dockerfile\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/Containerfile\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/build.dockerfile\"))\n          );\n    }\n\n    @MavenTest\n    void datatable_export(MavenExecutionResult result) throws Exception {\n        assertThat(result).isSuccessful().out().error().isEmpty();\n        assertThat(result).isSuccessful().out().warn()\n          .contains(\"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/pom.xml\")))\n          .contains(\n            \"    org.openrewrite.maven.search.DependencyInsight: {groupIdPattern=*, artifactIdPattern=guava, scope=compile}\",\n            \"        org.openrewrite.maven.search.DependencyInsight: {groupIdPattern=*, artifactIdPattern=lombok, scope=compile}\"\n          );\n        Path targetProjectDirectory = result.getMavenProjectResult().getTargetProjectDirectory();\n\n        // Verify that a CSV file with DependenciesInUse datatable exists\n        Path datatablesDir = targetProjectDirectory.resolve(\"target/rewrite/datatables\");\n        assertThat(datatablesDir).exists().isDirectory();\n\n        // Find the timestamped directory (format: YYYY-MM-DD_HH-mm-ss-SSS)\n        Path csvFile;\n        try (Stream<Path> timestampedDirs = Files.list(datatablesDir)) {\n            Path timestampedDir = timestampedDirs\n                .filter(Files::isDirectory)\n                .findFirst()\n                .orElseThrow(() -> new AssertionError(\"No timestamped directory found in \" + datatablesDir));\n\n            try (Stream<Path> csvFiles = Files.list(timestampedDir)) {\n                csvFile = csvFiles\n                    .filter(p -> p.getFileName().toString().startsWith(\"org.openrewrite.maven.table.DependenciesInUse\") &&\n                                 p.getFileName().toString().endsWith(\".csv\"))\n                    .findFirst()\n                    .orElseThrow(() -> new AssertionError(\"No DependenciesInUse CSV file found in \" + timestampedDir));\n            }\n            assertThat(csvFile).exists().isRegularFile();\n        }\n\n        // Verify CSV contains expected structure and data rows\n        // CSV format: 3 comment lines (@name, @instanceName, @group), header row, data rows\n        List<String> lines = Files.readAllLines(csvFile);\n        // Filter out comment lines\n        List<String> dataLines = lines.stream()\n                .filter(l -> !l.startsWith(\"#\"))\n                .collect(toList());\n        assertThat(dataLines)\n          .hasSizeGreaterThanOrEqualTo(3) // header + 2 data rows\n          .first(as(STRING))\n          .contains(\"groupId\", \"artifactId\"); // CSV header\n\n        // Get only the data rows (skip header)\n        assertThat(dataLines.subList(1, dataLines.size()))\n          .hasSizeGreaterThanOrEqualTo(2)\n          .anySatisfy(line -> assertThat(line).contains(\"com.google.guava\", \"guava\"))\n          .anySatisfy(line -> assertThat(line).contains(\"org.projectlombok\", \"lombok\"));\n    }\n\n    @MavenTest\n    @SystemProperty(value = \"rewrite.additionalPlainTextMasks\", content = \"**/*.ext,**/.in-root\")\n    void plaintext_masks(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .out()\n          .warn()\n          .contains(\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/main/java/sample/in-src.ext\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/.in-root\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/from-default-list.py\")),\n            \"Changes have been made to %s by:\".formatted(separatorsToSystem(\"project/src/main/java/sample/Dummy.java\"))\n          )\n          .doesNotContain(\"in-root.ignored\");\n    }\n\n    /**\n     * On JDK 25, Lombok annotation processing on comment-free main sources followed by test sources\n     * with comments triggers a LinkageError in JavaUnrestrictedClassLoader.defineClass().\n     * Requires --add-exports flags in .mvn/jvm.config for the fallback to work.\n     */\n    @MavenTest\n    @EnabledForJreRange(min = JRE.JAVA_25)\n    void lombok_jdk25_linkage_error(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful();\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/RewriteRunParallelIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\nimport org.openrewrite.maven.jupiter.extension.GitJupiterExtension;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\n\n@DisabledOnOs(OS.WINDOWS)\n@MavenGoal(\"${project.groupId}:${project.artifactId}:${project.version}:run\")\n@GitJupiterExtension\n@MavenJupiterExtension\n@MavenOption(value = MavenCLIOptions.THREADS, parameter = \"2\")\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\nclass RewriteRunParallelIT {\n\n    @MavenTest\n    void multi_module_project(MavenExecutionResult result) {\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .info()\n                .anySatisfy(line -> assertThat(line).contains(\"Delaying execution to the end of multi-module project for org.openrewrite.maven:b:1.0\"));\n\n        assertThat(result)\n                .isSuccessful()\n                .out()\n                .warn()\n                .anySatisfy(line -> assertThat(line).contains(\"org.openrewrite.staticanalysis.SimplifyBooleanExpression\"));\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/RewriteTypeTableIT.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven;\n\nimport com.soebes.itf.jupiter.extension.*;\nimport com.soebes.itf.jupiter.maven.MavenExecutionResult;\n\nimport static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;\nimport static org.openrewrite.PathUtils.separatorsToSystem;\n\n@MavenJupiterExtension\n@MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS)\n@MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING)\n@MavenProfile(\"create-typetable\")\nclass RewriteTypeTableIT {\n\n    @MavenTest\n    void typetable_default(MavenExecutionResult result) {\n        assertThat(result)\n          .isSuccessful()\n          .project().has(\"src/main/resources/META-INF/rewrite\");\n        assertThat(result).out().info()\n          .matches(logLines -> logLines.stream().anyMatch(line -> line.contains(\"Wrote com.google.guava:guava:jar:33.3.1-jre\")),\n            \"contains guava 33.3.1-jre\")\n          .matches(logLines -> logLines.stream().anyMatch(line -> line.contains(\"Wrote com.google.guava:guava:jar:32.0.0-jre\")),\n            \"contains guava 32.0.0-jre\")\n          .matches(logLines -> logLines.stream().anyMatch(line -> line.contains(\"Wrote %s\".formatted(separatorsToSystem(\"src/main/resources/META-INF/rewrite/classpath.tsv.gz\")))),\n            \"write classpath.tsv.gz\");\n        assertThat(result).out().error().isEmpty();\n    }\n\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/jupiter/extension/GitITExtension.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven.jupiter.extension;\n\nimport org.junit.jupiter.api.extension.BeforeEachCallback;\nimport org.junit.jupiter.api.extension.ExtensionConfigurationException;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.openrewrite.jgit.api.Git;\n\nimport java.lang.reflect.Method;\nimport java.nio.file.Path;\n\nclass GitITExtension implements BeforeEachCallback {\n    @Override\n    public void beforeEach(ExtensionContext context) throws Exception {\n        Class<?> testClass = context.getTestClass()\n          .orElseThrow(() -> new ExtensionConfigurationException(\"MavenITExtension is only supported for classes.\"));\n        Method methodName = context.getTestMethod().orElseThrow(() -> new IllegalStateException(\"No method given\"));\n\n        Path targetTestClassesDirectory = getTargetDir().resolve(\"maven-it\");\n        String toFullyQualifiedPath = toFullyQualifiedPath(testClass);\n\n        Path mavenItTestCaseDirectory = targetTestClassesDirectory.resolve(toFullyQualifiedPath).resolve(methodName.getName());\n        Git.init().setDirectory(mavenItTestCaseDirectory.toFile()).call().close();\n    }\n\n    static Path getMavenBaseDir() {\n        return Path.of(System.getProperty(\"basedir\", System.getProperty(\"user.dir\", \".\")));\n    }\n\n    static String toFullyQualifiedPath(Class<?> testClass) {\n        return testClass.getCanonicalName().replace('.', '/');\n    }\n\n    /**\n     * @return the target directory of the current project.\n     */\n    static Path getTargetDir() {\n        return getMavenBaseDir().resolve(\"target\");\n    }\n}\n"
  },
  {
    "path": "src/test/java/org/openrewrite/maven/jupiter/extension/GitJupiterExtension.java",
    "content": "/*\n * Copyright 2020 the original author or authors.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * https://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.openrewrite.maven.jupiter.extension;\n\nimport org.junit.jupiter.api.extension.ExtendWith;\n\nimport java.lang.annotation.*;\n\n@Target(ElementType.TYPE)\n@Retention(RetentionPolicy.RUNTIME)\n@ExtendWith(GitITExtension.class)\n@Documented\npublic @interface GitJupiterExtension {\n}\n"
  },
  {
    "path": "src/test/resources/.gitkeep",
    "content": ""
  },
  {
    "path": "src/test/resources/junit-platform.properties",
    "content": "#\n# Copyright 2025 the original author or authors.\n# <p>\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# <p>\n# https://www.apache.org/licenses/LICENSE-2.0\n# <p>\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\njunit.jupiter.execution.parallel.enabled = true\njunit.jupiter.execution.parallel.mode.default = concurrent\njunit.jupiter.execution.parallel.mode.classes.default = same_thread\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/groupid_artifactid_should_be_ok/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>groupid_artifactid_should_be_ok</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>BasicIT#groupid_artifactid_should_be_ok</name>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\r\n                    </activeRecipes>\r\n                </configuration>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>null_check_profile_activation</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>BasicIT#null_check_profile_activation</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/settings.xml",
    "content": "<settings xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"\n          xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0\n                    http://maven.apache.org/xsd/settings-1.0.0.xsd\">\n    <profiles>\n        <profile>\n            <id>example_profile_id</id>\n            <activation>\n                <activeByDefault>true</activeByDefault>\n            </activation>\n            <repositories>\n                <repository>\n                    <id>example_repository_id</id>\n                    <url>https://repo.maven.apache.org/maven2/</url>\n                </repository>\n            </repositories>\n        </profile>\n    </profiles>\n\n</settings>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/resolves_maven_properties_from_user_provided_system_properties/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>resolves_maven_properties_from_user_provided_system_properties</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>BasicIT#resolves_maven_properties_from_user_provided_system_properties</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <repositories>\n        <repository>\n            <id>ossrh_snapshots</id>\n            <url>${ossrh_snapshots_url}</url>\n            <snapshots>\n                <updatePolicy>never</updatePolicy>\n                <checksumPolicy>ignore</checksumPolicy>\n                <enabled>true</enabled>\n            </snapshots>\n            <releases>\n                <updatePolicy>never</updatePolicy>\n                <checksumPolicy>ignore</checksumPolicy>\n                <enabled>false</enabled>\n            </releases>\n        </repository>\n    </repositories>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/resolves_settings/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>resolves_settings</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>BasicIT#resolves_settings</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/resolves_settings/settings-user.xml",
    "content": "<settings xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"\n          xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0\n                    http://maven.apache.org/xsd/settings-1.0.0.xsd\">\n    <profiles>\n        <profile>\n            <id>example_profile_id</id>\n            <repositories>\n                <repository>\n                    <id>example_repository_id</id>\n                    <url>${REPOSITORY_URL}</url>\n                </repository>\n            </repositories>\n        </profile>\n    </profiles>\n\n</settings>"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/BasicIT/snapshot_ok/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>snapshot_ok</artifactId>\n    <version>1.0-SNAPSHOT</version>\n    <packaging>jar</packaging>\n    <name>BasicIT#snapshot_ok</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/DiscoverNoActiveRecipeIT/single_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>single_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>ConfigureMojoITNoActiveRecipe#single_project</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>${some.property}</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/KotlinIT/kotlin_in_src_main_java/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>basic_kotlin_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>KotlinIT#basic_kotlin_project</name>\n\n    <properties>\n        <kotlin.version>1.9.10</kotlin.version>\n        <jdk.version>17</jdk.version>\n        <java.version>${jdk.version}</java.version>\n        <maven.compiler.source>${jdk.version}</maven.compiler.source>\n        <maven.compiler.target>${jdk.version}</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.jetbrains.kotlin</groupId>\n                <artifactId>kotlin-maven-plugin</artifactId>\n                <version>${kotlin.version}</version>\n                <executions>\n                    <execution>\n                        <id>compile</id>\n                        <phase>process-sources</phase>\n                        <goals>\n                            <goal>compile</goal>\n                        </goals>\n                        <configuration>\n                            <sourceDirs>\n                                <sourceDir>${project.basedir}/src/main/java</sourceDir>\n                            </sourceDirs>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.13.0</version>\n                <configuration>\n                    <source>${java.version}</source>\n                    <target>${java.version}</target>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>default-compile</id>\n                        <phase>none</phase>\n                    </execution>\n                    <execution>\n                        <id>default-testCompile</id>\n                        <phase>none</phase>\n                    </execution>\n                    <execution>\n                        <id>java-compile</id>\n                        <phase>compile</phase>\n                        <goals>\n                            <goal>compile</goal>\n                        </goals>\n                    </execution>\n                    <execution>\n                        <id>java-test-compile</id>\n                        <phase>test-compile</phase>\n                        <goals>\n                            <goal>testCompile</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.kotlin.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-all</artifactId>\n                        <version>1.3.4</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.jetbrains.kotlin</groupId>\n            <artifactId>kotlin-stdlib</artifactId>\n            <version>${kotlin.version}</version>\n        </dependency>\n    </dependencies>\n\n    <repositories>\n        <repository>\n            <id>mavenCentral</id>\n            <url>https://repo1.maven.org/maven2/</url>\n        </repository>\n    </repositories>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/KotlinIT/kotlin_in_src_main_java/src/main/java/sample/MyClass.kt",
    "content": "  package sample\n\n    class MyClass {\n\n       }\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/KotlinIT/kotlin_in_src_main_test/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>basic_kotlin_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>KotlinIT#basic_kotlin_project</name>\n\n    <properties>\n        <kotlin.version>1.9.10</kotlin.version>\n        <jdk.version>17</jdk.version>\n        <java.version>${jdk.version}</java.version>\n        <maven.compiler.source>${jdk.version}</maven.compiler.source>\n        <maven.compiler.target>${jdk.version}</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.jetbrains.kotlin</groupId>\n                <artifactId>kotlin-maven-plugin</artifactId>\n                <version>${kotlin.version}</version>\n                <executions>\n                    <execution>\n                        <id>compile</id>\n                        <phase>process-sources</phase>\n                        <goals>\n                            <goal>compile</goal>\n                        </goals>\n                        <configuration>\n                            <sourceDirs>\n                                <sourceDir>${project.basedir}/src/main/java</sourceDir>\n                            </sourceDirs>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.13.0</version>\n                <configuration>\n                    <source>${java.version}</source>\n                    <target>${java.version}</target>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>default-compile</id>\n                        <phase>none</phase>\n                    </execution>\n                    <execution>\n                        <id>default-testCompile</id>\n                        <phase>none</phase>\n                    </execution>\n                    <execution>\n                        <id>java-compile</id>\n                        <phase>compile</phase>\n                        <goals>\n                            <goal>compile</goal>\n                        </goals>\n                    </execution>\n                    <execution>\n                        <id>java-test-compile</id>\n                        <phase>test-compile</phase>\n                        <goals>\n                            <goal>testCompile</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.kotlin.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-all</artifactId>\n                        <version>1.3.4</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.jetbrains.kotlin</groupId>\n            <artifactId>kotlin-stdlib</artifactId>\n            <version>${kotlin.version}</version>\n        </dependency>\n    </dependencies>\n\n    <repositories>\n        <repository>\n            <id>mavenCentral</id>\n            <url>https://repo1.maven.org/maven2/</url>\n        </repository>\n    </repositories>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/KotlinIT/kotlin_in_src_main_test/src/test/java/sample/MyTest.kt",
    "content": "package sample\n\n   class MyTest {\n       }\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RecipeCsvGenerateIT/generates_csv_from_java_recipe/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.test</groupId>\n    <artifactId>test-java-recipe-project</artifactId>\n    <version>1.0.0</version>\n    <packaging>jar</packaging>\n    <name>RecipeCsvGenerateIT#generates_csv_from_java_recipe</name>\n\n    <properties>\n        <maven.compiler.source>8</maven.compiler.source>\n        <maven.compiler.target>8</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-core</artifactId>\n            <version>@rewrite.version@</version>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RecipeCsvGenerateIT/generates_csv_from_java_recipe/src/main/java/org/openrewrite/test/SampleJavaRecipe.java",
    "content": "package org.openrewrite.test;\n\nimport org.openrewrite.ExecutionContext;\nimport org.openrewrite.Recipe;\nimport org.openrewrite.TreeVisitor;\n\npublic class SampleJavaRecipe extends Recipe {\n\n    @Override\n    public String getDisplayName() {\n        return \"Sample Java recipe\";\n    }\n\n    @Override\n    public String getDescription() {\n        return \"A sample imperative recipe for testing CSV generation.\";\n    }\n\n    @Override\n    public TreeVisitor<?, ExecutionContext> getVisitor() {\n        return TreeVisitor.noop();\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RecipeCsvGenerateIT/generates_csv_from_yaml_recipe/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.test</groupId>\n    <artifactId>test-recipe-project</artifactId>\n    <version>1.0.0</version>\n    <packaging>jar</packaging>\n    <name>RecipeCsvGenerateIT#generates_csv_from_yaml_recipe</name>\n\n    <properties>\n        <maven.compiler.source>8</maven.compiler.source>\n        <maven.compiler.target>8</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-core</artifactId>\n            <version>@rewrite.version@</version>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RecipeCsvGenerateIT/generates_csv_from_yaml_recipe/src/main/resources/META-INF/rewrite/rewrite.yml",
    "content": "---\ntype: specs.openrewrite.org/v1beta/recipe\nname: org.openrewrite.test.TestRecipe\ndisplayName: Test recipe\ndescription: A test recipe for CSV generation testing.\nrecipeList:\n  - org.openrewrite.text.ChangeText:\n      toText: \"Hello World\"\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/RecipeLookup/rewrite_discover_detail/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>rewrite_discover_detail</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDiscoverIT#rewrite_discover_detail</name>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/RecipeLookup/rewrite_discover_recipe_lookup_case_insensitive/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>rewrite_discover_recipe_lookup_case_insensitive</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDiscoverIT#rewrite_discover_recipe_lookup_case_insensitive</name>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/RecipeLookup/rewrite_discover_recursion/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>rewrite_discover_recursion</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDiscoverIT#rewrite_discover_recursion</name>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_default/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>rewrite_discover_default</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDiscoverIT#rewrite_discover_default</name>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\r\n                    </activeRecipes>\r\n                    <activeStyles>\r\n                        <style>org.openrewrite.java.SpringFormat</style>\r\n                    </activeStyles>\r\n                </configuration>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/a/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <parent>\n        <groupId>org.openrewrite.maven</groupId>\n        <artifactId>rewrite_discover_multi_module</artifactId>\n        <version>1.0</version>\n    </parent>\n\n    <artifactId>a</artifactId>\n\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/b/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <parent>\n        <groupId>org.openrewrite.maven</groupId>\n        <artifactId>rewrite_discover_multi_module</artifactId>\n        <version>1.0</version>\n    </parent>\n\n    <artifactId>b</artifactId>\n\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>rewrite_discover_multi_module</artifactId>\n    <version>1.0</version>\n    <packaging>pom</packaging>\n    <name>RewriteDiscoverIT#multi_module</name>\n\n    <modules>\n        <module>a</module>\n        <module>b</module>\n    </modules>\n    \n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <pomCacheDirectory>\n                        ${project.build.directory}/maven-it/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/project/target/pomCache\n                    </pomCacheDirectory>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_rewrite_yml/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>rewrite_discover_rewrite_yml</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDiscoverIT#rewrite_discover_rewrite_yml</name>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>com.example.RewriteDiscoverIT.CodeCleanup</recipe>\r\n                    </activeRecipes>\r\n                    <configLocation>\r\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_rewrite_yml/rewrite.yml\r\n                    </configLocation>\r\n                </configuration>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_rewrite_yml/rewrite.yml",
    "content": "---\r\ntype: specs.openrewrite.org/v1beta/recipe\r\nname: com.example.RewriteDiscoverIT.CodeCleanup\r\nrecipeList:\r\n  - org.openrewrite.java.format.AutoFormat\r\n\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/fail_on_dry_run/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>fail_on_dry_run</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDryRunIT#fail_on_dry_run</name>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\r\n                    </activeRecipes>\r\n                    <failOnDryRunResults>true</failOnDryRunResults>\r\n                </configuration>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/fail_on_dry_run/src/main/java/sample/BadSpacing.java",
    "content": "package sample;\n\npublic class BadSpacing {\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/a/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <parent>\r\n        <groupId>org.openrewrite.maven</groupId>\r\n        <artifactId>multi_module_project</artifactId>\r\n        <version>1.0</version>\r\n    </parent>\r\n\r\n    <artifactId>a</artifactId>\r\n\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/a/src/main/java/sample/MyInterface.java",
    "content": "package sample;\n\npublic interface MyInterface {\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/a/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/b/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <parent>\r\n        <groupId>org.openrewrite.maven</groupId>\r\n        <artifactId>multi_module_project</artifactId>\r\n        <version>1.0</version>\r\n    </parent>\r\n\r\n    <artifactId>b</artifactId>\r\n\r\n    <dependencies>\r\n        <dependency>\r\n            <groupId>org.openrewrite.maven</groupId>\r\n            <artifactId>a</artifactId>\r\n            <version>1.0</version>\r\n        </dependency>\r\n    </dependencies>\r\n\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/b/src/main/java/sample/EmptyBlockSample.java",
    "content": "package sample;\n\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.Random;\n\npublic class EmptyBlockSample implements MyInterface {\n    int n = sideEffect();\n\n    static {\n    }\n\n    int sideEffect() {\n        return new Random().nextInt();\n    }\n\n    boolean boolSideEffect() {\n        return sideEffect() == 0;\n    }\n\n    public void lotsOfIfs() {\n        if(sideEffect() == 1) {}\n        if(sideEffect() == sideEffect()) {}\n        int n;\n        if((n = sideEffect()) == 1) {}\n        if((n /= sideEffect()) == 1) {}\n        if(new EmptyBlockSample().n == 1) {}\n        if(!boolSideEffect()) {}\n        if(1 == 2) {}\n    }\n\n    public void emptyTry() {\n        try {\n            Files.lines(Paths.get(\"somewhere\"));\n        } catch (Throwable t) {\n        } finally {\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>multi_module_project</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>pom</packaging>\r\n\r\n    <modules>\r\n        <module>a</module>\r\n        <module>b</module>\r\n    </modules>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>com.example.RewriteDryRunIT.CodeCleanup</recipe>\r\n                    </activeRecipes>\r\n                    <configLocation>\r\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/rewrite.yml\r\n                    </configLocation>\r\n                </configuration>\r\n                <dependencies>\r\n                    <dependency>\r\n                        <groupId>org.openrewrite.recipe</groupId>\r\n                        <artifactId>rewrite-static-analysis</artifactId>\r\n                        <version>1.0.4</version>\r\n                    </dependency>\r\n                </dependencies>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/multi_module_project/rewrite.yml",
    "content": "---\r\ntype: specs.openrewrite.org/v1beta/recipe\r\nname: com.example.RewriteDryRunIT.CodeCleanup\r\nrecipeList:\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanExpression\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanReturn\r\n  - org.openrewrite.staticanalysis.UnnecessaryParentheses\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/no_plugin_in_pom/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>no_plugin_in_pom</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteDryRunIT#no_plugin_in_pom</name>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter</artifactId>\n            <version>5.9.1</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-api</artifactId>\n            <version>5.9.1</version>\n            <scope>test</scope>\n        </dependency>\n    </dependencies>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/no_plugin_in_pom/src/test/java/sample/SampleTest.java",
    "content": "package sample;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\npublic class SampleTest {\n    @Test\n    public void testMethod() {\n        String s = null;\n        assertTrue(s == null);\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/recipe_order/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>recipe_order</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDryRunIT#recipe_order</name>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>com.example.RewriteDryRunIT.CodeCleanup</recipe>\r\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\r\n                        <recipe>org.openrewrite.staticanalysis.SimplifyBooleanExpression</recipe>\r\n                    </activeRecipes>\r\n                    <configLocation>\r\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/recipe_order/rewrite.yml\r\n                    </configLocation>\r\n                </configuration>\r\n                <dependencies>\r\n                    <dependency>\r\n                        <groupId>org.openrewrite.recipe</groupId>\r\n                        <artifactId>rewrite-static-analysis</artifactId>\r\n                        <version>1.0.4</version>\r\n                    </dependency>\r\n                </dependencies>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/recipe_order/rewrite.yml",
    "content": "---\r\ntype: specs.openrewrite.org/v1beta/recipe\r\nname: com.example.RewriteDryRunIT.CodeCleanup\r\nrecipeList:\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanExpression\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanReturn\r\n  - org.openrewrite.staticanalysis.UnnecessaryParentheses\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/recipe_order/src/main/java/sample/EmptyBlockSample.java",
    "content": "package sample;\n\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.Random;\n\npublic class EmptyBlockSample {\n    int n = sideEffect();\n\n    static {\n    }\n\n    int sideEffect() {\n        return new Random().nextInt();\n    }\n\n    boolean boolSideEffect() {\n        return sideEffect() == 0;\n    }\n\n    public void lotsOfIfs() {\n        if(sideEffect() == 1) {}\n        if(sideEffect() == sideEffect()) {}\n        int n;\n        if((n = sideEffect()) == 1) {}\n        if((n /= sideEffect()) == 1) {}\n        if(new EmptyBlockSample().n == 1) {}\n        if(!boolSideEffect()) {}\n        if(1 == 2) {}\n    }\n\n    public void emptyTry() {\n        try {\n            Files.lines(Paths.get(\"somewhere\"));\n        } catch (Throwable t) {\n        } finally {\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/recipe_order/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/single_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>single_project</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteDryRunIT#single_project</name>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\r\n                    </activeRecipes>\r\n                </configuration>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/single_project/src/main/java/sample/EmptyBlockSample.java",
    "content": "package sample;\n\nimport java.nio.file.*;\nimport java.util.Random;\n\npublic class EmptyBlockSample {\n    int n = sideEffect();\n\n    static {\n    }\n\n    int sideEffect() {\n        return new Random().nextInt();\n    }\n\n    boolean boolSideEffect() {\n        return sideEffect() == 0;\n    }\n\n    public void lotsOfIfs() {\n        if(sideEffect() == 1) {}\n        if(sideEffect() == sideEffect()) {}\n        int n;\n        if((n = sideEffect()) == 1) {}\n        if((n /= sideEffect()) == 1) {}\n        if(new EmptyBlockSample().n == 1) {}\n        if(!boolSideEffect()) {}\n        if(1 == 2) {}\n    }\n\n    public void emptyTry() {\n        try {\n            Files.lines(Paths.get(\"somewhere\"));\n        } catch (Throwable t) {\n        } finally {\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteDryRunIT/single_project/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/basedir_resource_no_plaintext_leak/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>basedir_resource_no_plaintext_leak</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#basedir_resource_no_plaintext_leak</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <resources>\n            <resource>\n                <directory>${project.basedir}</directory>\n                <excludes>\n                    <exclude>**/*</exclude>\n                </excludes>\n            </resource>\n        </resources>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}</directory>\n                <excludes>\n                    <exclude>**/*</exclude>\n                </excludes>\n            </testResource>\n        </testResources>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/basedir_resource_no_plaintext_leak/src/main/java/sample/Main.java",
    "content": "package sample;\n\npublic class Main {\n    public void hello() {\n        if(true) {}\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/basedir_resource_no_plaintext_leak/src/test/java/sample/MainTest.java",
    "content": "package sample;\n\npublic class MainTest {\n    public void test() {\n        if(true) {}\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/checkstyle_inline_rules/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xmlns=\"http://maven.apache.org/POM/4.0.0\"\n\t\t xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>org.openrewrite.maven</groupId>\n\t<artifactId>checkstyle_inline_rules</artifactId>\n\t<version>1.0</version>\n\t<packaging>jar</packaging>\n\t<name>RewriteRunIT#checkstyle_inline_rules</name>\n\n\t<properties>\n\t\t<maven.compiler.source>1.8</maven.compiler.source>\n\t\t<maven.compiler.target>1.8</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>@project.groupId@</groupId>\n\t\t\t\t<artifactId>@project.artifactId@</artifactId>\n\t\t\t\t<version>@project.version@</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<activeRecipes>\n\t\t\t\t\t\t<recipe>org.openrewrite.java.format.AutoFormat</recipe>\n\t\t\t\t\t</activeRecipes>\n\t\t\t\t</configuration>\n\t\t\t</plugin>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-checkstyle-plugin</artifactId>\n\t\t\t\t<version>3.3.1</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<id>verify-style</id>\n\t\t\t\t\t\t<phase>process-classes</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>check</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t\t<configuration>\n\t\t\t\t\t<failsOnError>false</failsOnError>\n\t\t\t\t\t<checkstyleRules>\n\t\t\t\t\t\t<module name=\"Checker\">\n\t\t\t\t\t\t\t<module name=\"FileLength\">\n\t\t\t\t\t\t\t\t<property name=\"max\" value=\"3500\" />\n\t\t\t\t\t\t\t\t<property name=\"fileExtensions\" value=\"java\"/>\n\t\t\t\t\t\t\t</module>\n\t\t\t\t\t\t\t<module name=\"FileTabCharacter\"/>\n\t\t\t\t\t\t\t<module name=\"TreeWalker\">\n\t\t\t\t\t\t\t\t<module name=\"StaticVariableName\"/>\n\t\t\t\t\t\t\t\t<module name=\"TypeName\">\n\t\t\t\t\t\t\t\t\t<property name=\"format\" value=\"^_?[A-Z][a-zA-Z0-9]*$\"/>\n\t\t\t\t\t\t\t\t</module>\n\t\t\t\t\t\t\t</module>\n\t\t\t\t\t\t</module>\n\t\t\t\t\t</checkstyleRules>\n\t\t\t\t</configuration>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/checkstyle_inline_rules/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/cloud_suitability_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>cloud_suitability_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#cloud_suitability_project</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.cloudsuitability.FindJks</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-cloud-suitability-analyzer</artifactId>\n                        <version>1.3.0</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n</project>"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/cloud_suitability_project/src/main/resource/some.jks",
    "content": ""
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/command_line_options/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>command_line_options</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#command_line_options</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/command_line_options_json/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>command_line_options</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#command_line_options_json</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/command_line_options_json/src/main/java/sample/SomeClass.java",
    "content": "package sample;\n\npublic class SomeClass {\n    public void doTheThing() {}\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/Containerfile",
    "content": "FROM alpine:latest\nCMD [\"echo\", \"Hello World\"]\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/Dockerfile",
    "content": "FROM alpine:latest\nCMD [\"echo\", \"Hello World\"]\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/build.dockerfile",
    "content": "FROM alpine:latest\nCMD [\"echo\", \"Hello World\"]\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/containerfile.build",
    "content": "FROM alpine:latest\nCMD [\"echo\", \"Hello World\"]\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>single_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#container_masks</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>com.example.RewriteRunIT.ContainerMasks</recipe>\n                    </activeRecipes>\n                    <configLocation>\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/rewrite.yml\n                    </configLocation>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/container_masks/rewrite.yml",
    "content": "---\ntype: specs.openrewrite.org/v1beta/recipe\nname: com.example.RewriteRunIT.ContainerMasks\n\nrecipeList:\n  - org.openrewrite.text.FindAndReplace:\n      find: 'alpine:latest'\n      replace: 'alpine'\n      regex: false\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/datatable_export/pom.xml",
    "content": "<project>\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.mycompany.app</groupId>\n    <artifactId>my-app</artifactId>\n    <version>1</version>\n    <dependencies>\n        <dependency>\n            <groupId>com.google.guava</groupId>\n            <artifactId>guava</artifactId>\n            <version>32.0.0-jre</version>\n        </dependency>\n        <dependency>\n            <groupId>org.projectlombok</groupId>\n            <artifactId>lombok</artifactId>\n            <version>1.18.42</version>\n        </dependency>\n    </dependencies>\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>com.github.timtebeek.FindBoth</recipe>\n                    </activeRecipes>\n                    <configLocation>\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteRunIT/datatable_export/rewrite.yml\n                    </configLocation>\n                    <exportDatatables>true</exportDatatables>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/datatable_export/rewrite.yml",
    "content": "type: specs.openrewrite.org/v1beta/recipe\nname: com.github.timtebeek.FindBoth\ndisplayName: Find dependencies\ndescription: Find all usages of both Guava and Lombok dependencies in Maven projects.\nrecipeList:\n  - org.openrewrite.maven.search.DependencyInsight:\n      groupIdPattern: \"*\"\n      artifactIdPattern: \"guava\"\n      scope: compile\n  - org.openrewrite.maven.search.DependencyInsight:\n      groupIdPattern: \"*\"\n      artifactIdPattern: \"lombok\"\n      scope: compile\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/java_compiler_plugin_project/parent/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>parent</artifactId>\n    <version>1.0</version>\n    <packaging>pom</packaging>\n\n    <properties>\n        <maven.compiler.release>11</maven.compiler.release>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/java_compiler_plugin_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <parent>\n        <groupId>org.openrewrite.maven</groupId>\n        <artifactId>parent</artifactId>\n        <version>1.0</version>\n        <relativePath>parent</relativePath>\n    </parent>\n\n    <artifactId>java_compiler_plugin_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#java_compiler_plugin_project</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n            <plugin>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.10.1</version>\n                <configuration>\n                    <release>${maven.compiler.release}</release>\n                    <compilerArgs>\n                        <arg>-parameters</arg>\n                    </compilerArgs>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/java_compiler_plugin_project/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n                return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/java_upgrade_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>java_upgrade_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#java_upgrade_project</name>\n\n    <properties>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.migrate.UpgradeToJava17</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-migrate-java</artifactId>\n                        <version>3.31.0</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n</project>"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/java_upgrade_project/src/main/java/sample/MyInterface.java",
    "content": "package sample;\n\npublic interface MyInterface {\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/lombok_jdk25_linkage_error/.mvn/jvm.config",
    "content": "--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED\n--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/lombok_jdk25_linkage_error/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>lombok_jdk25_linkage_error</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#lombok_jdk25_linkage_error</name>\n\n    <properties>\n        <maven.compiler.source>25</maven.compiler.source>\n        <maven.compiler.target>25</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.projectlombok</groupId>\n            <artifactId>lombok</artifactId>\n            <version>1.18.38</version>\n            <scope>provided</scope>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.14.0</version>\n                <configuration>\n                    <forceJavacCompilerUse>true</forceJavacCompilerUse>\n                    <annotationProcessorPaths>\n                        <path>\n                            <groupId>org.projectlombok</groupId>\n                            <artifactId>lombok</artifactId>\n                            <version>1.18.38</version>\n                        </path>\n                    </annotationProcessorPaths>\n                </configuration>\n            </plugin>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\n                    </activeRecipes>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/lombok_jdk25_linkage_error/src/main/java/sample/App.java",
    "content": "package sample;\n\nimport lombok.Data;\nimport lombok.Builder;\nimport lombok.With;\n\n@Data\n@Builder\npublic class App {\n    @With\n    private String name;\n    private int count;\n    private boolean active;\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/lombok_jdk25_linkage_error/src/test/java/sample/AppTest.java",
    "content": "package sample;\n\npublic class AppTest {\n    void testApp() {\n        // GIVEN\n        var name = \"test\";\n        var count = 1;\n        // WHEN\n        var app = App.builder().name(name).count(count).active(true).build();\n        // THEN\n        assert app.getName().equals(name);\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_main_source_sets_project/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>multi_main_source_sets_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.codehaus.mojo</groupId>\n                <artifactId>build-helper-maven-plugin</artifactId>\n                <version>3.6.0</version>\n                <executions>\n                    <execution>\n                        <id>add additional main sources</id>\n                        <phase>generate-sources</phase>\n                        <goals>\n                            <goal>add-source</goal>\n                        </goals>\n                        <configuration>\n                            <sources>\n                                <source>src/additional-main/java</source>\n                            </sources>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n        </plugins>\n    </build>\n</project>"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_main_source_sets_project/src/additional-main/java/sample/AdditionalMainClass.java",
    "content": "package sample;\n\npublic class AdditionalMainClass {\n    //This is a test class\n    public void method() {\n        System.out.println(\"Additional main source set\");\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_main_source_sets_project/src/main/java/sample/MainClass.java",
    "content": "package sample;\n\npublic class MainClass {\n    //This is a test class\n    public void method() {\n        System.out.println(\"Main source set\");\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/a/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <parent>\r\n        <groupId>org.openrewrite.maven</groupId>\r\n        <artifactId>multi_module_project</artifactId>\r\n        <version>1.0</version>\r\n    </parent>\r\n\r\n    <artifactId>a</artifactId>\r\n\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/a/src/main/java/sample/MyInterface.java",
    "content": "package sample;\n\npublic interface MyInterface {\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/a/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/b/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <parent>\r\n        <groupId>org.openrewrite.maven</groupId>\r\n        <artifactId>multi_module_project</artifactId>\r\n        <version>1.0</version>\r\n    </parent>\r\n\r\n    <artifactId>b</artifactId>\r\n\r\n    <dependencies>\r\n        <dependency>\r\n            <groupId>org.openrewrite.maven</groupId>\r\n            <artifactId>a</artifactId>\r\n            <version>1.0</version>\r\n        </dependency>\r\n    </dependencies>\r\n\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/b/src/main/java/sample/EmptyBlockSample.java",
    "content": "package sample;\n\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.Random;\n\npublic class EmptyBlockSample implements MyInterface {\n    int n = sideEffect();\n\n    static {\n    }\n\n    int sideEffect() {\n        return new Random().nextInt();\n    }\n\n    boolean boolSideEffect() {\n        return sideEffect() == 0;\n    }\n\n    public void lotsOfIfs() {\n        if(sideEffect() == 1) {}\n        if(sideEffect() == sideEffect()) {}\n        int n;\n        if((n = sideEffect()) == 1) {}\n        if((n /= sideEffect()) == 1) {}\n        if(new EmptyBlockSample().n == 1) {}\n        if(!boolSideEffect()) {}\n        if(1 == 2) {}\n    }\n\n    public void emptyTry() {\n        try {\n            Files.lines(Paths.get(\"somewhere\"));\n        } catch (Throwable t) {\n        } finally {\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>multi_module_project</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>pom</packaging>\r\n\r\n    <modules>\r\n        <module>a</module>\r\n        <module>b</module>\r\n    </modules>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>com.example.RewriteRunIT.CodeCleanup</recipe>\r\n                    </activeRecipes>\r\n                    <configLocation>\r\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/rewrite.yml\r\n                    </configLocation>\r\n                </configuration>\r\n                <dependencies>\r\n                    <dependency>\r\n                        <groupId>org.openrewrite.recipe</groupId>\r\n                        <artifactId>rewrite-static-analysis</artifactId>\r\n                        <version>1.0.4</version>\r\n                    </dependency>\r\n                </dependencies>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/rewrite.yml",
    "content": "---\r\ntype: specs.openrewrite.org/v1beta/recipe\r\nname: com.example.RewriteRunIT.CodeCleanup\r\nrecipeList:\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanExpression\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanReturn\r\n  - org.openrewrite.staticanalysis.UnnecessaryParentheses\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_resources/a/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <parent>\n        <groupId>org.openrewrite.maven</groupId>\n        <artifactId>multi_module_resources</artifactId>\n        <version>1.0</version>\n    </parent>\n\n    <artifactId>a</artifactId>\n\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_resources/a/src/main/resources/example.xml",
    "content": "<foo>bar</foo>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_resources/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>multi_module_resources</artifactId>\n    <version>1.0</version>\n    <packaging>pom</packaging>\n\n    <modules>\n        <module>a</module>\n    </modules>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>bug.report.ChangeTag</recipe>\n                    </activeRecipes>\n                    <configLocation>\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_resources/rewrite.yml\n                    </configLocation>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-static-analysis</artifactId>\n                        <version>1.0.4</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_resources/rewrite.yml",
    "content": "---\ntype: specs.openrewrite.org/v1beta/recipe\nname: bug.report.ChangeTag\ndisplayName: Change XML tag name\nrecipeList:\n  - org.openrewrite.xml.ChangeTagName:\n      elementName: /foo\n      newName: bar\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_source_sets_project/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>multi_source_sets_project</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>pom</packaging>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <dependencies>\r\n        <dependency>\r\n            <groupId>org.junit.jupiter</groupId>\r\n            <artifactId>junit-jupiter</artifactId>\r\n            <version>5.9.1</version>\r\n            <scope>test</scope>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>org.junit.jupiter</groupId>\r\n            <artifactId>junit-jupiter-engine</artifactId>\r\n            <version>5.9.1</version>\r\n            <scope>test</scope>\r\n        </dependency>\r\n    </dependencies>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>org.codehaus.mojo</groupId>\r\n                <artifactId>build-helper-maven-plugin</artifactId>\r\n                <version>3.6.0</version>\r\n                <executions>\r\n                    <execution>\r\n                        <id>add integration test sources</id>\r\n                        <phase>generate-test-sources</phase>\r\n                        <goals>\r\n                            <goal>add-test-source</goal>\r\n                        </goals>\r\n                        <configuration>\r\n                            <sources>\r\n                                <source>src/integration-test/java</source>\r\n                            </sources>\r\n                        </configuration>\r\n                    </execution>\r\n                </executions>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_source_sets_project/src/integration-test/java/sample/IntegrationTest.java",
    "content": "package sample;\n\nimport org.junit.jupiter.api.Test;\n\nclass IntegrationTest {\n    @Test\n    void testBar() {}\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_source_sets_project/src/test/java/sample/RegularTest.java",
    "content": "package sample;\n\nimport org.junit.jupiter.api.Test;\n\nclass RegularTest {\n    @Test\n    void testBar() {}\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/.in-root",
    "content": "findMe"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/from-default-list.py",
    "content": "findMe\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/in-root.ignored",
    "content": "findMe"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>single_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#plaintext_masks</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>com.example.RewriteRunIT.PlainTextMasks</recipe>\n                    </activeRecipes>\n                    <configLocation>\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/rewrite.yml\n                    </configLocation>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.recipe</groupId>\n                        <artifactId>rewrite-static-analysis</artifactId>\n                        <version>1.15.0</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/rewrite.yml",
    "content": "---\ntype: specs.openrewrite.org/v1beta/recipe\nname: com.example.RewriteRunIT.PlainTextMasks\n\nrecipeList:\n  - org.openrewrite.text.FindAndReplace:\n      find: findMe\n      replace: replacedWith\n      regex: false\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/src/main/java/sample/Dummy.java",
    "content": "package sample;\n\npublic class Dummy {\n    private static final String findMe = \"findMe\";\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/plaintext_masks/src/main/java/sample/in-src.ext",
    "content": "findMe"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/recipe_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>recipe_project</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteRunIT#recipe_project</name>\n\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.openrewrite</groupId>\n            <artifactId>rewrite-java</artifactId>\n            <version>8.0.0</version>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>@project.groupId@</groupId>\n                <artifactId>@project.artifactId@</artifactId>\n                <version>@project.version@</version>\n                <configuration>\n                    <activeRecipes>\n                        <recipe>sample.ThrowingRecipe</recipe>\n                    </activeRecipes>\n                </configuration>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.openrewrite.maven</groupId>\n                        <artifactId>recipe_project</artifactId>\n                        <version>1.0</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/recipe_project/src/main/java/sample/ThrowingRecipe.java",
    "content": "package sample;\n\nimport org.openrewrite.ExecutionContext;\nimport org.openrewrite.Recipe;\nimport org.openrewrite.Tree;\nimport org.openrewrite.TreeVisitor;\nimport org.openrewrite.internal.lang.Nullable;\nimport org.openrewrite.java.JavaVisitor;\nimport org.openrewrite.java.tree.J;\n\nimport java.nio.file.*;\nimport java.util.Random;\n\npublic class ThrowingRecipe extends Recipe {\n\n    @Override\n    public String getDisplayName() {\n        return \"Throws exception\";\n    }\n\n    @Override\n    public String getDescription() {\n        return \"Throws exception.\";\n    }\n\n    @Override\n    public TreeVisitor<?, ExecutionContext> getVisitor() {\n        return new JavaVisitor<ExecutionContext>() {\n            @Override\n            public J visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {\n                throw new RuntimeException(\"This recipe throws an exception.\");\n            }\n        };\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/single_project/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>single_project</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>jar</packaging>\r\n    <name>RewriteRunIT#single_project</name>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>\r\n                    </activeRecipes>\r\n                </configuration>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/single_project/src/main/java/sample/EmptyBlockSample.java",
    "content": "package sample;\n\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.Random;\n\npublic class EmptyBlockSample {\n    int n = sideEffect();\n\n    static {\n    }\n\n    int sideEffect() {\n        return new Random().nextInt();\n    }\n\n    boolean boolSideEffect() {\n        return sideEffect() == 0;\n    }\n\n    public void lotsOfIfs() {\n        if(sideEffect() == 1) {}\n        if(sideEffect() == sideEffect()) {}\n        int n;\n        if((n = sideEffect()) == 1) {}\n        if((n /= sideEffect()) == 1) {}\n        if(new EmptyBlockSample().n == 1) {}\n        if(!boolSideEffect()) {}\n        if(1 == 2) {}\n    }\n\n    public void emptyTry() {\n        try {\n            Files.lines(Paths.get(\"somewhere\"));\n        } catch (Throwable t) {\n        } finally {\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunIT/single_project/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/a/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <parent>\r\n        <groupId>org.openrewrite.maven</groupId>\r\n        <artifactId>multi_module_project</artifactId>\r\n        <version>1.0</version>\r\n    </parent>\r\n\r\n    <artifactId>a</artifactId>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>org.apache.maven.plugins</groupId>\r\n                <artifactId>maven-antrun-plugin</artifactId>\r\n                <version>3.0.0</version>\r\n                <executions>\r\n                    <execution>\r\n                        <id>simulate-sleep</id>\r\n                        <phase>validate</phase>\r\n                        <goals>\r\n                            <goal>run</goal>\r\n                        </goals>\r\n                        <configuration>\r\n                            <target>\r\n                                <sleep seconds=\"10\"/>\r\n                            </target>\r\n                        </configuration>\r\n                    </execution>\r\n                </executions>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/a/src/main/java/sample/MyInterface.java",
    "content": "package sample;\n\npublic interface MyInterface {\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/a/src/main/java/sample/SimplifyBooleanSample.java",
    "content": "package sample;\n\npublic class SimplifyBooleanSample {\n    boolean ifNoElse() {\n        if (isOddMillis()) {\n            return true;\n        }\n        return false;\n    }\n\n    static boolean isOddMillis() {\n        boolean even = System.currentTimeMillis() % 2 == 0;\n        if (even == true) {\n            return false;\n        }\n        else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/b/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <parent>\r\n        <groupId>org.openrewrite.maven</groupId>\r\n        <artifactId>multi_module_project</artifactId>\r\n        <version>1.0</version>\r\n    </parent>\r\n\r\n    <artifactId>b</artifactId>\r\n\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/b/src/main/java/sample/EmptyBlockSample.java",
    "content": "package sample;\n\nimport java.util.Random;\n\npublic class EmptyBlockSample {\n    int n = sideEffect();\n\n    static {\n    }\n\n    int sideEffect() {\n        return new Random().nextInt();\n    }\n}\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\r\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>org.openrewrite.maven</groupId>\r\n    <artifactId>multi_module_project</artifactId>\r\n    <version>1.0</version>\r\n    <packaging>pom</packaging>\r\n\r\n    <modules>\r\n        <module>a</module>\r\n        <module>b</module>\r\n    </modules>\r\n\r\n    <properties>\r\n        <maven.compiler.source>1.8</maven.compiler.source>\r\n        <maven.compiler.target>1.8</maven.compiler.target>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n    </properties>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>@project.groupId@</groupId>\r\n                <artifactId>@project.artifactId@</artifactId>\r\n                <version>@project.version@</version>\r\n                <configuration>\r\n                    <activeRecipes>\r\n                        <recipe>com.example.RewriteRunIT.CodeCleanup</recipe>\r\n                    </activeRecipes>\r\n                    <configLocation>\r\n                        ${maven.multiModuleProjectDirectory}/src/test/resources-its/org/openrewrite/maven/RewriteRunIT/multi_module_project/rewrite.yml\r\n                    </configLocation>\r\n                </configuration>\r\n                <dependencies>\r\n                    <dependency>\r\n                        <groupId>org.openrewrite.recipe</groupId>\r\n                        <artifactId>rewrite-static-analysis</artifactId>\r\n                        <version>1.0.4</version>\r\n                    </dependency>\r\n                </dependencies>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n</project>\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteRunParallelIT/multi_module_project/rewrite.yml",
    "content": "---\r\ntype: specs.openrewrite.org/v1beta/recipe\r\nname: com.example.RewriteRunIT.CodeCleanup\r\nrecipeList:\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanExpression\r\n  - org.openrewrite.staticanalysis.SimplifyBooleanReturn\r\n  - org.openrewrite.staticanalysis.UnnecessaryParentheses\r\n"
  },
  {
    "path": "src/test/resources-its/org/openrewrite/maven/RewriteTypeTableIT/typetable_default/pom.xml",
    "content": "<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>org.openrewrite.maven</groupId>\n    <artifactId>typetable_default</artifactId>\n    <version>1.0</version>\n    <packaging>jar</packaging>\n    <name>RewriteTypeTableIT#typetable_default</name>\n\n    <profiles>\n        <profile>\n            <id>create-typetable</id>\n            <build>\n                <plugins>\n                    <plugin>\n                        <groupId>@project.groupId@</groupId>\n                        <artifactId>@project.artifactId@</artifactId>\n                        <version>@project.version@</version>\n                        <configuration>\n                            <recipeArtifactCoordinates>\n                                com.google.guava:guava:33.3.1-jre,\n                                com.google.guava:guava:32.0.0-jre,\n                            </recipeArtifactCoordinates>\n                        </configuration>\n                        <executions>\n                            <execution>\n                                <goals>\n                                    <goal>typetable</goal>\n                                </goals>\n                                <phase>generate-resources</phase>\n                            </execution>\n                        </executions>\n                    </plugin>\n                </plugins>\n            </build>\n        </profile>\n    </profiles>\n</project>\n"
  },
  {
    "path": "suppressions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<suppressions xmlns=\"https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd\">\n    <!-- False positive: 3.6.1 contains the Zip Slip fix but CVE lists <4.0.3 as affected -->\n    <suppress until=\"2026-05-01Z\">\n        <packageUrl regex=\"true\">^pkg:maven/org\\.codehaus\\.plexus/plexus\\-utils@.*$</packageUrl>\n        <cve>CVE-2025-67030</cve>\n    </suppress>\n</suppressions>\n"
  }
]