├── .asf.yaml ├── .github ├── ISSUE_TEMPLATE │ ├── BUG.yml │ ├── FEATURE.yml │ └── config.yml ├── dependabot.yml ├── pull_request_template.md ├── release-drafter.yml └── workflows │ ├── maven-verify.yml │ ├── pr-automation.yml │ ├── release-drafter.yml │ └── stale.yml ├── .gitignore ├── Jenkinsfile ├── README.md ├── deploySite.sh ├── pom.xml └── src ├── it ├── base-config-cmds │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── cmds │ │ │ └── first.sh │ │ │ ├── configs │ │ │ └── config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── base-config-headerfiles │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── cmds │ │ │ └── first.sh │ │ │ ├── configs │ │ │ └── config.test │ │ │ ├── headerfiles │ │ │ └── first.h │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── base-config-legalnotices │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ │ └── HelloWorld.java │ │ │ └── legalnotices │ │ │ └── first.md │ └── verify.groovy ├── base-config-libs │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ │ └── HelloWorld.java │ │ │ └── libs │ │ │ └── first.so │ └── verify.groovy ├── base-config │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── configs │ │ │ └── config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── base-it │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── describe-base-config │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── configs │ │ │ └── config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── describe-plain │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── configs │ │ │ └── config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── list-base-config │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── configs │ │ │ └── config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── list-plain │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── configs │ │ │ └── config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── mjmod-20-set-main-class │ ├── greetings │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── greetings │ │ │ └── Main.java │ ├── invoker.properties │ ├── pom.xml │ ├── verify.groovy │ └── world │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── myproject │ │ └── world │ │ └── World.java ├── mjmod-23-path-must-be-dir │ ├── greetings │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── greetings │ │ │ └── Main.java │ ├── invoker.properties │ ├── pom.xml │ ├── verify.groovy │ └── world │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── myproject │ │ └── world │ │ └── World.java ├── mjmod-8-generate-jmod-in-other-project │ ├── about-cli-app │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── mymodule │ │ │ └── about │ │ │ └── cli │ │ │ └── Main.java │ ├── about-cli-distribution-jmod │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── cmds │ │ │ └── about │ │ │ └── configs │ │ │ └── about.yaml │ ├── invoker.properties │ ├── pom.xml │ └── verify.groovy ├── non-default-config-cmds │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── another-directory │ │ │ └── non-default-first.sh │ │ │ ├── another-sub-directory │ │ │ └── non-default-sub-first.sh │ │ │ ├── cmds │ │ │ └── first.sh │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy ├── non-default-config-headerfiles │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── cmds │ │ │ └── first.sh │ │ │ ├── configs │ │ │ └── config.test │ │ │ ├── headerfiles │ │ │ └── first.h │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ │ └── HelloWorld.java │ │ │ └── non-headerfiles │ │ │ └── non-first.h │ └── verify.groovy ├── non-default-config-legalnotices │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ │ └── HelloWorld.java │ │ │ ├── legalnotices │ │ │ └── first.md │ │ │ └── non-legalnotices │ │ │ └── non-first.md │ └── verify.groovy ├── non-default-config-libs │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ │ └── HelloWorld.java │ │ │ ├── libs │ │ │ └── first.so │ │ │ └── non-libs │ │ │ └── non-first.so │ └── verify.groovy ├── non-default-config │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── another-directory │ │ │ └── config.test │ │ │ ├── another-sub-directory │ │ │ └── config-sub.test │ │ │ ├── configs │ │ │ └── default-config.test │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── myproject │ │ │ └── HelloWorld.java │ └── verify.groovy └── settings.xml ├── main ├── filtered-resources │ └── META-INF │ │ └── plexus │ │ └── components.xml └── java │ └── org │ └── apache │ └── maven │ └── plugins │ └── jmod │ ├── AbstractJModMojo.java │ ├── JModCreateMojo.java │ ├── JModDescribeMojo.java │ ├── JModHashMojo.java │ └── JModListMojo.java └── site ├── apt ├── examples │ ├── example-describe.apt.vm │ └── example-list.apt.vm ├── index.apt.vm └── usage.apt.vm ├── resources └── download.cgi ├── site.xml └── xdoc └── download.xml.vm /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # see https://s.apache.org/asfyaml 18 | github: 19 | description: "Apache Maven JMod Plugin" 20 | homepage: https://maven.apache.org/plugins/maven-jmod-plugin/ 21 | labels: 22 | - java 23 | - build-management 24 | - maven-plugins 25 | - maven-jmod-plugin 26 | - maven 27 | enabled_merge_buttons: 28 | squash: true 29 | merge: false 30 | rebase: true 31 | autolink_jira: 32 | - MJMOD 33 | del_branch_on_merge: true 34 | features: 35 | issues: true 36 | notifications: 37 | commits: commits@maven.apache.org 38 | issues: issues@maven.apache.org 39 | pullrequests: issues@maven.apache.org 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema 19 | 20 | name: Bug Report 21 | description: File a bug report 22 | labels: ["bug"] 23 | 24 | body: 25 | - type: markdown 26 | attributes: 27 | value: | 28 | Thanks for taking the time to fill out this bug report. 29 | 30 | Simple fixes in single PRs do not require issues. 31 | 32 | **Do you use the latest project version?** 33 | 34 | - type: input 35 | id: version 36 | attributes: 37 | label: Affected version 38 | validations: 39 | required: true 40 | 41 | - type: textarea 42 | id: massage 43 | attributes: 44 | label: Bug description 45 | validations: 46 | required: true 47 | 48 | 49 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema 19 | 20 | name: Feature request 21 | description: File a proposal for new feature, improvement 22 | labels: ["enhancement"] 23 | 24 | body: 25 | - type: markdown 26 | attributes: 27 | value: | 28 | Thanks for taking the time to fill out this new feature, improvement proposal. 29 | 30 | - type: textarea 31 | id: massage 32 | attributes: 33 | label: New feature, improvement proposal 34 | validations: 35 | required: true 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser 19 | 20 | blank_issues_enabled: false 21 | 22 | contact_links: 23 | 24 | - name: Project Mailing Lists 25 | url: https://maven.apache.org/mailing-lists.html 26 | about: Please ask a question or discuss here 27 | 28 | - name: Old JIRA Issues 29 | url: https://issues.apache.org/jira/projects/MJMOD 30 | about: Please search old JIRA issues 31 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | version: 2 18 | updates: 19 | 20 | - package-ecosystem: maven 21 | directory: "/" 22 | schedule: 23 | interval: daily 24 | time: '04:00' 25 | open-pull-requests-limit: 10 26 | 27 | - package-ecosystem: "github-actions" 28 | directory: "/" 29 | schedule: 30 | interval: "daily" 31 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Following this checklist to help us incorporate your 2 | contribution quickly and easily: 3 | 4 | - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MJMOD) filed 5 | for the change (usually before you start working on it). Trivial changes like typos do not 6 | require a JIRA issue. Your pull request should address just this issue, without 7 | pulling in other changes. 8 | - [ ] Each commit in the pull request should have a meaningful subject line and body. 9 | - [ ] Format the pull request title like `[MJMOD-XXX] - Fixes bug in ApproximateQuantiles`, 10 | where you replace `MJMOD-XXX` with the appropriate JIRA issue. Best practice 11 | is to use the JIRA issue title in the pull request title and in the first line of the 12 | commit message. 13 | - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. 14 | - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will 15 | be performed on your pull request automatically. 16 | - [ ] You have run the integration tests successfully (`mvn -Prun-its clean verify`). 17 | 18 | If your pull request is about ~20 lines of code you don't need to sign an 19 | [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure 20 | please ask on the developers list. 21 | 22 | To make clear that you license your contribution under 23 | the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 24 | you have to acknowledge this by using the following check-box. 25 | 26 | - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 27 | 28 | - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). 29 | 30 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | _extends: maven-gh-actions-shared 19 | tag-template: maven-invoker-$NEXT_MINOR_VERSION 20 | -------------------------------------------------------------------------------- /.github/workflows/maven-verify.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Verify 19 | 20 | on: 21 | push: 22 | pull_request: 23 | 24 | jobs: 25 | build: 26 | name: Verify 27 | uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4 28 | -------------------------------------------------------------------------------- /.github/workflows/pr-automation.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: PR Automation 19 | on: 20 | pull_request_target: 21 | types: 22 | - closed 23 | 24 | jobs: 25 | pr-automation: 26 | name: PR Automation 27 | uses: apache/maven-gh-actions-shared/.github/workflows/pr-automation.yml@v4 28 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Release Drafter 19 | on: 20 | push: 21 | branches: 22 | - master 23 | jobs: 24 | update_release_draft: 25 | uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4 26 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Stale 19 | 20 | on: 21 | schedule: 22 | - cron: '11 3 * * *' 23 | issue_comment: 24 | types: [ 'created' ] 25 | 26 | jobs: 27 | stale: 28 | uses: 'apache/maven-gh-actions-shared/.github/workflows/stale.yml@v4' 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .project 3 | .classpath 4 | .settings/ 5 | .svn/ 6 | bin/ 7 | # Intellij 8 | *.ipr 9 | *.iml 10 | .idea 11 | out/ 12 | .DS_Store 13 | /bootstrap 14 | /dependencies.xml 15 | .java-version 16 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | asfMavenTlpPlgnBuild() 21 | -------------------------------------------------------------------------------- /deploySite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one 5 | # or more contributor license agreements. See the NOTICE file 6 | # distributed with this work for additional information 7 | # regarding copyright ownership. The ASF licenses this file 8 | # to you under the Apache License, Version 2.0 (the 9 | # "License"); you may not use this file except in compliance 10 | # with the License. You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, 15 | # software distributed under the License is distributed on an 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | # KIND, either express or implied. See the License for the 18 | # specific language governing permissions and limitations 19 | # under the License. 20 | # 21 | 22 | mvn -Preporting site site:stage $@ 23 | mvn scm-publish:publish-scm $@ 24 | -------------------------------------------------------------------------------- /src/it/base-config-cmds/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/base-config-cmds/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-base-config-cmds 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with cmds direcotry by using default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/base-config-cmds/src/main/cmds/first.sh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | This first.sh should be located into bin directory into the resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-cmds/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-cmds/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/base-config-cmds/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/base-config-cmds/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-base-config-cmds.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'bin/first.sh', 30 | 'conf/config.test', 31 | 'classes/module-info.class', 32 | 'classes/myproject/HelloWorld.class', 33 | ] as Set 34 | 35 | def contents = [] as Set 36 | 37 | def jar = new JarFile( artifact ) 38 | def jarEntries = jar.entries() 39 | while ( jarEntries.hasMoreElements() ) { 40 | def entry = (JarEntry) jarEntries.nextElement() 41 | if ( !entry.isDirectory() ) { 42 | // Only compare files 43 | contents.add( entry.getName() ) 44 | } 45 | } 46 | 47 | assert resourceNames == contents -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-base-config-headerfiles 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with include direcotry by using default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/src/main/cmds/first.sh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | This first.sh should be located into bin directory into the resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/src/main/headerfiles/first.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test header file which should be located in include/first.h in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/base-config-headerfiles/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-base-config-headerfiles.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'include/first.h', 30 | 'bin/first.sh', 31 | 'conf/config.test', 32 | 'classes/module-info.class', 33 | 'classes/myproject/HelloWorld.class', 34 | ] as Set 35 | 36 | def contents = [] as Set 37 | 38 | def jar = new JarFile( artifact ) 39 | def jarEntries = jar.entries() 40 | while ( jarEntries.hasMoreElements() ) { 41 | def entry = (JarEntry) jarEntries.nextElement() 42 | if ( !entry.isDirectory() ) { 43 | // Only compare files 44 | contents.add( entry.getName() ) 45 | } 46 | } 47 | 48 | assert resourceNames == contents 49 | -------------------------------------------------------------------------------- /src/it/base-config-legalnotices/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/base-config-legalnotices/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-base-config-legalnotices 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with legal direcotry by using default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/base-config-legalnotices/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/base-config-legalnotices/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/base-config-legalnotices/src/main/legalnotices/first.md: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test legal notices file which will stay in legal/first.md in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-legalnotices/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-base-config-legalnotices.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'legal/first.md', 30 | 'classes/module-info.class', 31 | 'classes/myproject/HelloWorld.class', 32 | ] as Set 33 | 34 | def contents = [] as Set 35 | 36 | def jar = new JarFile( artifact ) 37 | def jarEntries = jar.entries() 38 | while ( jarEntries.hasMoreElements() ) { 39 | def entry = (JarEntry) jarEntries.nextElement() 40 | if ( !entry.isDirectory() ) { 41 | // Only compare files 42 | contents.add( entry.getName() ) 43 | } 44 | } 45 | 46 | assert resourceNames == contents 47 | -------------------------------------------------------------------------------- /src/it/base-config-libs/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/base-config-libs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-base-config-libs 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with libs direcotry by using default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/base-config-libs/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/base-config-libs/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/base-config-libs/src/main/libs/first.so: -------------------------------------------------------------------------------- 1 | Test native librariy file which will stay in lib/first.so in 2 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config-libs/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-base-config-libs.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'lib/first.so', 30 | 'classes/module-info.class', 31 | 'classes/myproject/HelloWorld.class', 32 | ] as Set 33 | 34 | def contents = [] as Set 35 | 36 | def jar = new JarFile( artifact ) 37 | def jarEntries = jar.entries() 38 | while ( jarEntries.hasMoreElements() ) { 39 | def entry = (JarEntry) jarEntries.nextElement() 40 | if ( !entry.isDirectory() ) { 41 | // Only compare files 42 | contents.add( entry.getName() ) 43 | } 44 | } 45 | 46 | assert resourceNames == contents 47 | -------------------------------------------------------------------------------- /src/it/base-config/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/base-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-base-config 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with config directory by using default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/base-config/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/base-config/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/base-config/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/base-config/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-base-config.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'conf/config.test', 30 | 'classes/module-info.class', 31 | 'classes/myproject/HelloWorld.class', 32 | ] as Set 33 | 34 | def contents = [] as Set 35 | 36 | def jar = new JarFile( artifact ) 37 | def jarEntries = jar.entries() 38 | while ( jarEntries.hasMoreElements() ) { 39 | def entry = (JarEntry) jarEntries.nextElement() 40 | if ( !entry.isDirectory() ) { 41 | // Only compare files 42 | contents.add( entry.getName() ) 43 | } 44 | } 45 | 46 | assert resourceNames == contents 47 | -------------------------------------------------------------------------------- /src/it/base-it/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/base-it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-base-it 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test Base JMod creation 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/base-it/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/base-it/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/base-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-base-it.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'classes/module-info.class', 30 | 'classes/myproject/HelloWorld.class', 31 | ] as Set 32 | 33 | 34 | def contents = [] as Set 35 | 36 | def jar = new JarFile( artifact ) 37 | def jarEntries = jar.entries() 38 | while ( jarEntries.hasMoreElements() ) { 39 | def entry = (JarEntry) jarEntries.nextElement() 40 | if ( !entry.isDirectory() ) { 41 | // Only compare files 42 | contents.add( entry.getName() ) 43 | } 44 | } 45 | 46 | assert resourceNames == contents 47 | -------------------------------------------------------------------------------- /src/it/describe-base-config/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/describe-base-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-describe-base-config 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod describe to get the output 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | describe-jmod 60 | 61 | describe 62 | 63 | package 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/it/describe-base-config/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/describe-base-config/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/describe-base-config/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/describe-base-config/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | def expectedDescriptorLines = [ 21 | 'org.apache.maven.plugins.jmod.it.first@99.0', 22 | 'exports myproject', 23 | 'requires java.base' 24 | ] as Set 25 | 26 | def buildLog = new File (basedir, 'build.log') 27 | 28 | def describeLines = buildLog.readLines() 29 | .dropWhile{ it != '[INFO] org.apache.maven.plugins.jmod.it.first@99.0' } 30 | .takeWhile{ !it.startsWith('[INFO] ---') } 31 | .grep() 32 | .collect{ it - '[INFO] ' } as Set 33 | 34 | assert expectedDescriptorLines == describeLines 35 | 36 | -------------------------------------------------------------------------------- /src/it/describe-plain/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals.1 = clean package 19 | invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:describe -Djmodfile=target/jmods/maven-jmod-plugin-describe-base-config.jmod 20 | -------------------------------------------------------------------------------- /src/it/describe-plain/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-describe-base-config 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod describe to get the output 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/it/describe-plain/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/describe-plain/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/describe-plain/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/describe-plain/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | def expectedDescriptorLines = [ 21 | 'org.apache.maven.plugins.jmod.it.first@99.0', 22 | 'exports myproject', 23 | 'requires java.base' 24 | ] as Set 25 | 26 | def buildLog = new File (basedir, 'build.log') 27 | 28 | def describeLines = buildLog.readLines() 29 | .dropWhile{ it != '[INFO] org.apache.maven.plugins.jmod.it.first@99.0' } 30 | .takeWhile{ !it.startsWith('[INFO] ---') } 31 | .grep() 32 | .collect{ it - '[INFO] ' } as Set 33 | 34 | assert expectedDescriptorLines == describeLines 35 | -------------------------------------------------------------------------------- /src/it/list-base-config/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/list-base-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-list-base-config 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod list to get the output 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | describe-jmod 60 | 61 | list 62 | 63 | package 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/it/list-base-config/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/list-base-config/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/list-base-config/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/list-base-config/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | def resourceNames = [ 21 | 'conf/config.test', 22 | 'classes/module-info.class', 23 | 'classes/myproject/HelloWorld.class', 24 | ] as Set 25 | 26 | def buildLog = new File (basedir, 'build.log') 27 | 28 | def listLines = buildLog.readLines() 29 | .dropWhile{ !it.startsWith('[INFO] The following files are contained in the module file') } 30 | .drop(1) 31 | .takeWhile{ !it.startsWith('[INFO] ---') } 32 | .findAll{ it.startsWith('[INFO] ')} 33 | .collect{ it - '[INFO] ' } as Set 34 | 35 | assert listLines == resourceNames 36 | -------------------------------------------------------------------------------- /src/it/list-plain/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:list -Djmodfile=target/jmods/maven-jmod-plugin-list-base-config.jmod -------------------------------------------------------------------------------- /src/it/list-plain/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-list-base-config 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod list to get the output 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | describe-jmod 60 | 61 | list 62 | 63 | package 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/it/list-plain/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/list-plain/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/list-plain/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/list-plain/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | def resourceNames = [ 21 | 'conf/config.test', 22 | 'classes/module-info.class', 23 | 'classes/myproject/HelloWorld.class', 24 | ] as Set 25 | 26 | def buildLog = new File (basedir, 'build.log') 27 | 28 | def listLines = buildLog.readLines() 29 | .dropWhile{ !it.startsWith('[INFO] The following files are contained in the module file') } 30 | .drop(1) 31 | .takeWhile{ !it.startsWith('[INFO] ---') } 32 | .findAll{ it.startsWith('[INFO] ')} 33 | .collect{ it - '[INFO] ' } as Set 34 | 35 | assert listLines == resourceNames 36 | -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/greetings/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module myproject.greetings { 21 | requires myproject.world; 22 | } -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/greetings/src/main/java/myproject/greetings/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package myproject.greetings; 21 | 22 | import myproject.world.World; 23 | 24 | public class Main { 25 | public static void main(String[] args) { 26 | System.out.format("Greetings %s!%n", World.name()); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 9+ 18 | invoker.goals = verify 19 | -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | 26 | org.apache.maven.plugins 27 | maven-jmod-plugin-mjmod-20 28 | 99.0 29 | pom 30 | 31 | 32 | UTF-8 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | myproject.world 40 | ${project.version} 41 | jmod 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-compiler-plugin 52 | 3.8.0 53 | 54 | 9 55 | 56 | 57 | 58 | 59 | 60 | 61 | org.apache.maven.plugins 62 | maven-jmod-plugin 63 | @project.version@ 64 | true 65 | 66 | 67 | 68 | 69 | 70 | world 71 | greetings 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.JarEntry 21 | import java.util.jar.JarFile 22 | 23 | validateArtifact( "world", [ "classes/module-info.class", "classes/myproject/world/World.class" ] ) 24 | validateArtifact( "greetings", [ "classes/module-info.class", "classes/myproject/greetings/Main.class" ] ) 25 | 26 | def buildLog = new File(basedir,'build.log') 27 | 28 | def describeLines = buildLog.readLines() 29 | .dropWhile{ it != '[INFO] myproject.greetings@99.0' } // start line, inclusive 30 | .takeWhile{ !it.startsWith('[INFO] ---') } // end line, inclusive 31 | .grep() // remove empty lines 32 | .collect{ it - '[INFO] ' } as Set // strip loglevel 33 | 34 | def expectedLines = [ 35 | "myproject.greetings@99.0", 36 | "requires java.base mandated", 37 | "requires myproject.world", 38 | "contains myproject.greetings", 39 | "main-class myproject.greetings.Main"] as Set 40 | 41 | assert describeLines == expectedLines 42 | 43 | def validateArtifact(module, resourceNames) 44 | { 45 | println( "Checking if ${basedir}/${module}/target exists." ) 46 | def targetDir = new File( basedir, "/${module}/target" ) 47 | assert targetDir.isDirectory() 48 | 49 | File artifact = new File( targetDir, "/jmods/myproject.${module}.jmod" ) 50 | assert artifact.isFile() 51 | 52 | Set contents = new HashSet() 53 | 54 | JarFile jar = new JarFile( artifact ) 55 | Enumeration jarEntries = jar.entries() 56 | while ( jarEntries.hasMoreElements() ) 57 | { 58 | JarEntry entry = (JarEntry) jarEntries.nextElement() 59 | println( "Current entry: ${entry}" ) 60 | if ( !entry.isDirectory() ) 61 | { 62 | // Only compare files 63 | contents.add( entry.getName() ) 64 | } 65 | } 66 | 67 | assert resourceNames.size() == contents.size() 68 | 69 | resourceNames.each{ artifactName -> 70 | assert contents.contains( artifactName ) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/world/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module myproject.world { 21 | exports myproject.world; 22 | } -------------------------------------------------------------------------------- /src/it/mjmod-20-set-main-class/world/src/main/java/myproject/world/World.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package myproject.world; 21 | 22 | public class World { 23 | public static String name() { 24 | return "world"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/greetings/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module myproject.greetings { 21 | requires myproject.world; 22 | } -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/greetings/src/main/java/myproject/greetings/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package myproject.greetings; 21 | 22 | import myproject.world.World; 23 | 24 | public class Main { 25 | public static void main(String[] args) { 26 | System.out.format("Greetings %s!%n", World.name()); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 9+ 18 | invoker.goals = verify 19 | -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | 26 | org.apache.maven.plugins 27 | maven-jmod-plugin-mjmod-23 28 | 99.0 29 | pom 30 | 31 | 32 | UTF-8 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | myproject.world 40 | ${project.version} 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-compiler-plugin 51 | 3.8.0 52 | 53 | 9 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.apache.maven.plugins 61 | maven-jmod-plugin 62 | @project.version@ 63 | true 64 | 65 | 66 | 67 | 68 | 69 | world 70 | greetings 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.JarEntry 21 | import java.util.jar.JarFile 22 | 23 | validateArtifact( "world", "/myproject.world-99.0.jar", 24 | [ "module-info.class", 25 | "META-INF/maven/org.apache.maven.plugins/myproject.world/pom.xml", 26 | "myproject/world/World.class", 27 | "META-INF/maven/org.apache.maven.plugins/myproject.world/pom.properties", 28 | "META-INF/MANIFEST.MF" 29 | ] 30 | ) 31 | validateArtifact( "greetings", "/jmods/myproject.greetings.jmod", 32 | [ "classes/module-info.class", 33 | "classes/myproject/greetings/Main.class" ] ) 34 | 35 | def buildLog = new File(basedir,'build.log') 36 | 37 | def describeLines = buildLog.readLines() 38 | .dropWhile{ it != '[INFO] myproject.greetings@99.0' } // start line, inclusive 39 | .takeWhile{ !it.startsWith('[INFO] ---') } // end line, inclusive 40 | .grep() // remove empty lines 41 | .collect{ it - '[INFO] ' } as Set // strip loglevel 42 | 43 | def expectedLines = [ 44 | "myproject.greetings@99.0", 45 | "requires java.base mandated", 46 | "requires myproject.world", 47 | "contains myproject.greetings", 48 | "main-class myproject.greetings.Main"] as Set 49 | 50 | assert describeLines == expectedLines 51 | 52 | def validateArtifact(module, String filename, resourceNames) 53 | { 54 | println( "Checking if ${basedir}/${module}/target exists." ) 55 | def targetDir = new File( basedir, "/${module}/target" ) 56 | assert targetDir.isDirectory() 57 | 58 | File artifact = new File( targetDir, filename ) 59 | assert artifact.isFile() 60 | 61 | Set contents = new HashSet() 62 | 63 | JarFile jar = new JarFile( artifact ) 64 | Enumeration jarEntries = jar.entries() 65 | while ( jarEntries.hasMoreElements() ) 66 | { 67 | JarEntry entry = (JarEntry) jarEntries.nextElement() 68 | println( "Current entry: ${entry}" ) 69 | if ( !entry.isDirectory() ) 70 | { 71 | // Only compare files 72 | contents.add( entry.getName() ) 73 | } 74 | } 75 | 76 | assert resourceNames.size() == contents.size() 77 | 78 | resourceNames.each{ artifactName -> 79 | assert contents.contains( artifactName ) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/world/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 23 | 24 | org.apache.maven.plugins 25 | maven-jmod-plugin-mjmod-23 26 | 99.0 27 | 28 | 4.0.0 29 | 30 | myproject.world 31 | 32 | myproject.world 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/world/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module myproject.world { 21 | exports myproject.world; 22 | } -------------------------------------------------------------------------------- /src/it/mjmod-23-path-must-be-dir/world/src/main/java/myproject/world/World.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package myproject.world; 21 | 22 | public class World { 23 | public static String name() { 24 | return "world"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/about-cli-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 23 | 24 | 4.0.0 25 | 26 | 27 | org.apache.maven.plugins 28 | maven-jmod-plugin-mjmod-8 29 | 99.0 30 | 31 | about-cli-app 32 | 33 | 34 | 35 | info.picocli 36 | picocli 37 | 2.0.0 38 | true 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/about-cli-app/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module mymodule.about.cli { 21 | requires java.base; 22 | requires static info.picocli; 23 | exports mymodule.about.cli; 24 | } 25 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/about-cli-app/src/main/java/mymodule/about/cli/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package mymodule.about.cli; 21 | 22 | import picocli.CommandLine; 23 | 24 | import static picocli.CommandLine.*; 25 | 26 | @Command( 27 | name = "Main", 28 | description = "Demonstrating picocli", 29 | headerHeading = "Demonstration Usage:%n%n") 30 | public class Main { 31 | 32 | @Option(names = {"-v", "--verbose"}, description = "Verbose output?") 33 | private boolean verbose; 34 | 35 | @Option(names = {"-f", "--file"}, description = "Path and name of file", required = true) 36 | private String fileName; 37 | 38 | @Option(names = {"-h", "--help"}, description = "Display help/usage.", help = true) 39 | boolean help; 40 | 41 | public static void main(String[] arguments) { 42 | 43 | final Main main = CommandLine.populateCommand(new Main(), arguments); 44 | 45 | if (main.help) { 46 | CommandLine.usage(main, System.out, CommandLine.Help.Ansi.AUTO); 47 | } else { 48 | System.out.println("The provided file path and name is " + main.fileName + " and verbosity is set to " + main.verbose); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/about-cli-distribution-jmod/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 23 | 24 | 4.0.0 25 | 26 | 27 | org.apache.maven.plugins 28 | maven-jmod-plugin-mjmod-8 29 | 99.0 30 | 31 | 32 | about-cli-distribution-jmod 33 | jmod 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | about-cli-app 39 | ${project.version} 40 | 41 | 42 | 43 | 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-jmod-plugin 48 | true 49 | 54 | 55 | 56 | list 57 | 58 | list 59 | 60 | verify 61 | 62 | 63 | describe 64 | 65 | describe 66 | 67 | verify 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/about-cli-distribution-jmod/src/main/cmds/about: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | 20 | JLINK_VM_OPTIONS= 21 | DIR=`dirname $0` 22 | $DIR/java $JLINK_VM_OPTIONS -m mymodule.about.cli.jar/mymodule.about.cli.Main $@ 23 | 24 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/about-cli-distribution-jmod/src/main/configs/about.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test 19 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 9+ 18 | invoker.goals = package 19 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 23 | 4.0.0 24 | 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-mjmod-8 27 | 99.0 28 | pom 29 | 30 | 31 | UTF-8 32 | UTF-8 33 | 34 | 35 | 36 | about-cli-app 37 | about-cli-distribution-jmod 38 | 39 | 40 | 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-compiler-plugin 46 | 3.8.0 47 | 48 | 9 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | apache.snapshots 65 | https://repository.apache.org/snapshots/ 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/it/mjmod-8-generate-jmod-in-other-project/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.JarEntry 21 | import java.util.jar.JarFile 22 | 23 | 24 | println( "Checking if ${basedir}/about-cli-app/target exists." ) 25 | File target = new File( basedir, "/about-cli-app/target" ) 26 | assert target.isDirectory() 27 | 28 | File artifact = new File( basedir, "/about-cli-distribution-jmod/target/jmods/about-cli-distribution-jmod.jmod" ) 29 | assert artifact.isFile() 30 | 31 | String[] resourceNames = [ 32 | "classes/module-info.class", 33 | "classes/META-INF/MANIFEST.MF", 34 | "classes/mymodule/about/cli/Main.class", 35 | "classes/META-INF/maven/org.apache.maven.plugins/about-cli-app/pom.xml", 36 | "classes/META-INF/maven/org.apache.maven.plugins/about-cli-app/pom.properties", 37 | "conf/about.yaml", 38 | "bin/about" 39 | ] 40 | 41 | Set contents = new HashSet() 42 | 43 | JarFile jar = new JarFile( artifact ) 44 | Enumeration jarEntries = jar.entries() 45 | while ( jarEntries.hasMoreElements() ) 46 | { 47 | JarEntry entry = (JarEntry) jarEntries.nextElement() 48 | println( "Current entry: ${entry}" ) 49 | if ( !entry.isDirectory() ) 50 | { 51 | // Only compare files 52 | contents.add( entry.getName() ) 53 | } 54 | } 55 | 56 | println( "Comparing the expected number of files with the actual number of files" ) 57 | assert resourceNames.length == contents.size() 58 | 59 | resourceNames.each{ artifactName -> 60 | println( "Does ${artifactName} exist in content." ) 61 | assert contents.contains( artifactName ) 62 | } 63 | 64 | return true -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-non-default-config-cmds 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with non default directoies by using non default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | src/main/another-directory 60 | src/main/another-sub-directory 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/src/main/another-directory/non-default-first.sh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | This non-default-first.sh should be located into bin directory into the resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/src/main/another-sub-directory/non-default-sub-first.sh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | This non-default-sub-first.sh should be located into bin directory into the resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/src/main/cmds/first.sh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | This first.sh should never be located into bin directory into the resulting jmod file based on the non default configuration. -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/non-default-config-cmds/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-non-default-config-cmds.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'bin/non-default-first.sh', 30 | 'bin/non-default-sub-first.sh', 31 | 'classes/module-info.class', 32 | 'classes/myproject/HelloWorld.class', 33 | ] as Set 34 | 35 | def contents = [] as Set 36 | 37 | def jar = new JarFile( artifact ) 38 | def jarEntries = jar.entries() 39 | while ( jarEntries.hasMoreElements() ) { 40 | def entry = (JarEntry) jarEntries.nextElement() 41 | if ( !entry.isDirectory() ) { 42 | // Only compare files 43 | contents.add( entry.getName() ) 44 | } 45 | } 46 | 47 | assert resourceNames == contents 48 | -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-non-default-config-headerfiles 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with include directory by using non default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | src/main/non-headerfiles 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/src/main/cmds/first.sh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | This first.sh should be located into bin directory into the resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/src/main/configs/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/src/main/headerfiles/first.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test header file which should be located in include/first.h in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/src/main/non-headerfiles/non-first.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test header file which should be never located in include/first.h in 21 | resulting jmod file based non default configuration. -------------------------------------------------------------------------------- /src/it/non-default-config-headerfiles/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-non-default-config-headerfiles.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'include/non-first.h', 30 | 'bin/first.sh', 31 | 'conf/config.test', 32 | 'classes/module-info.class', 33 | 'classes/myproject/HelloWorld.class', 34 | ] as Set 35 | 36 | def contents = [] as Set 37 | 38 | def jar = new JarFile( artifact ) 39 | def jarEntries = jar.entries() 40 | while ( jarEntries.hasMoreElements() ) { 41 | def entry = (JarEntry) jarEntries.nextElement() 42 | if ( !entry.isDirectory() ) { 43 | // Only compare files 44 | contents.add( entry.getName() ) 45 | } 46 | } 47 | 48 | assert resourceNames == contents 49 | -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-non-default-config-legalnotices 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with legal directory by using non default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | src/main/non-legalnotices 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/src/main/legalnotices/first.md: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test legal notices file which will never be legal/first.md in 21 | resulting jmod file based on the non default configuration. -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/src/main/non-legalnotices/non-first.md: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test legal notices file which will stay in legal/first.md in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-legalnotices/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-non-default-config-legalnotices.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'legal/non-first.md', 30 | 'classes/module-info.class', 31 | 'classes/myproject/HelloWorld.class', 32 | ] as Set 33 | 34 | def contents = [] as Set 35 | 36 | def jar = new JarFile( artifact ) 37 | def jarEntries = jar.entries() 38 | while ( jarEntries.hasMoreElements() ) { 39 | def entry = (JarEntry) jarEntries.nextElement() 40 | if ( !entry.isDirectory() ) { 41 | // Only compare files 42 | contents.add( entry.getName() ) 43 | } 44 | } 45 | 46 | assert resourceNames == contents 47 | -------------------------------------------------------------------------------- /src/it/non-default-config-libs/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/non-default-config-libs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-non-default-config-libs 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with libs directory by using non default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | src/main/non-libs 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/it/non-default-config-libs/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/non-default-config-libs/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/non-default-config-libs/src/main/libs/first.so: -------------------------------------------------------------------------------- 1 | Test native librariy file which will never stay lib/first.so in 2 | resulting jmod file based on the non default configuration. -------------------------------------------------------------------------------- /src/it/non-default-config-libs/src/main/non-libs/non-first.so: -------------------------------------------------------------------------------- 1 | Test native librariy file which will stay in lib/non-first.so in 2 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config-libs/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-non-default-config-libs.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'lib/non-first.so', 30 | 'classes/module-info.class', 31 | 'classes/myproject/HelloWorld.class', 32 | ] as Set 33 | 34 | def contents = [] as Set 35 | 36 | def jar = new JarFile( artifact ) 37 | def jarEntries = jar.entries() 38 | while ( jarEntries.hasMoreElements() ) { 39 | def entry = (JarEntry) jarEntries.nextElement() 40 | if ( !entry.isDirectory() ) { 41 | // Only compare files 42 | contents.add( entry.getName() ) 43 | } 44 | } 45 | 46 | assert resourceNames == contents 47 | -------------------------------------------------------------------------------- /src/it/non-default-config/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | invoker.java.version = 1.9+ 18 | invoker.goals = clean package 19 | -------------------------------------------------------------------------------- /src/it/non-default-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 4.0.0 25 | org.apache.maven.plugins 26 | maven-jmod-plugin-non-default-config 27 | 99.0 28 | Maven 29 | jmod 30 | http://maven.apache.org 31 | Test jmod file creation with config directory by using non default configuration. 32 | 33 | 1.9 34 | 1.9 35 | UTF-8 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-compiler-plugin 43 | 3.7.0 44 | 45 | 1.9 46 | 1.9 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jmod-plugin 55 | @project.version@ 56 | true 57 | 58 | 59 | src/main/another-directory 60 | src/main/another-sub-directory 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/it/non-default-config/src/main/another-directory/config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file from another-directory which should be located in config/config.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config/src/main/another-sub-directory/config-sub.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file from another-sub-directory which should be located in config/config-sub.test in 21 | resulting jmod file. -------------------------------------------------------------------------------- /src/it/non-default-config/src/main/configs/default-config.test: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | Test configuration file which should never be put into the config/config.test in 21 | resulting jmod file based on the non default configuration. -------------------------------------------------------------------------------- /src/it/non-default-config/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module org.apache.maven.plugins.jmod.it.first { 21 | requires java.base; 22 | exports myproject; 23 | } 24 | -------------------------------------------------------------------------------- /src/it/non-default-config/src/main/java/myproject/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package myproject; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * The classic Hello World App. 24 | */ 25 | public class HelloWorld { 26 | 27 | /** 28 | * Main method. 29 | * 30 | * @param args Not used 31 | */ 32 | public static void main( String[] args ) 33 | { 34 | System.out.println( "Hello World from JDK 9" ); 35 | } 36 | } -------------------------------------------------------------------------------- /src/it/non-default-config/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.util.jar.* 21 | 22 | def target = new File( basedir, 'target' ) 23 | assert ( target.exists() && target.isDirectory() ) : 'target file is missing or not a directory.' 24 | 25 | def artifact = new File( target, 'jmods/maven-jmod-plugin-non-default-config.jmod' ) 26 | assert ( artifact.exists() && artifact.isFile() ) : 'target file is missing or a directory.' 27 | 28 | def resourceNames = [ 29 | 'conf/config.test', 30 | 'conf/config-sub.test', 31 | 'classes/module-info.class', 32 | 'classes/myproject/HelloWorld.class', 33 | ] as Set 34 | 35 | def contents = [] as Set 36 | 37 | def jar = new JarFile( artifact ) 38 | def jarEntries = jar.entries() 39 | while ( jarEntries.hasMoreElements() ) { 40 | def entry = (JarEntry) jarEntries.nextElement() 41 | if ( !entry.isDirectory() ) { 42 | // Only compare files 43 | contents.add( entry.getName() ) 44 | } 45 | } 46 | 47 | assert resourceNames == contents 48 | 49 | -------------------------------------------------------------------------------- /src/it/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | it-repo 26 | 27 | true 28 | 29 | 30 | 31 | local.central 32 | @localRepositoryUrl@ 33 | 34 | true 35 | 36 | 37 | true 38 | 39 | 40 | 41 | 42 | 43 | local.central 44 | @localRepositoryUrl@ 45 | 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/filtered-resources/META-INF/plexus/components.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 27 | 28 | org.apache.maven.artifact.handler.ArtifactHandler 29 | jmod 30 | org.apache.maven.artifact.handler.DefaultArtifactHandler 31 | 32 | jmod 33 | true 34 | java 35 | false 36 | 37 | 38 | 39 | 44 | 47 | 48 | org.apache.maven.lifecycle.mapping.LifecycleMapping 49 | jmod 50 | org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping 51 | 52 | 53 | 54 | default 55 | 56 | 57 | 58 | org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources 59 | 60 | 61 | org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile 62 | 63 | 64 | org.apache.maven.plugins:maven-resources-plugin:3.1.0:testResources 65 | 66 | 67 | org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile 68 | 69 | 70 | org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test 71 | 72 | 73 | org.apache.maven.plugins:maven-jmod-plugin:${project.version}:create 74 | 75 | 76 | org.apache.maven.plugins:maven-install-plugin:2.5.2:install 77 | 78 | 79 | org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /src/site/apt/examples/example-describe.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Usage 3 | ------ 4 | Karl Heinz Marbaise 5 | ------ 6 | 2017-09-01 7 | 8 | ~~ Copyright 2006 The Apache Software Foundation. 9 | ~~ 10 | ~~ Licensed under the Apache License, Version 2.0 (the "License"); 11 | ~~ you may not use this file except in compliance with the License. 12 | ~~ You may obtain a copy of the License at 13 | ~~ 14 | ~~ http://www.apache.org/licenses/LICENSE-2.0 15 | ~~ 16 | ~~ Unless required by applicable law or agreed to in writing, software 17 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 18 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | ~~ See the License for the specific language governing permissions and 20 | ~~ limitations under the License. 21 | 22 | ~~ NOTE: For help with the syntax of this file, see: 23 | ~~ http://maven.apache.org/doxia/references/apt-format.html 24 | 25 | 26 | Usage 27 | 28 | * Describe Goal 29 | 30 | Assuming you have configured the Maven JMod Plugin 31 | {{{../usage.html}accordingly to the usage page}} like the following: 32 | 33 | +---- 34 | 35 | [...] 36 | 37 | [...] 38 | 39 | [...] 40 | 41 | maven-jmod-plugin 42 | ${project.version} 43 | true 44 | 45 | 46 | 47 | 48 | 49 | describe 50 | 51 | describe 52 | 53 | verify 54 | 55 | 56 | 57 | 58 | [...] 59 | 60 | +----- 61 | 62 | You can run via: 63 | 64 | +----- 65 | mvn clean verify 66 | +----- 67 | 68 | During the above call of Maven the <> files will be generated and by the <> goal 69 | you will get an output like the following (using toolchains): 70 | 71 | +---- 72 | [INFO] --- maven-jmod-plugin:${project.version}:describe (describe) @ first-jmod --- 73 | [INFO] Toolchain in maven-jmod-plugin: jmod [ /../jdk1.9.0_ea+181.jdk/Contents/Home/bin/jmod ] 74 | [INFO] The following information is contained in the module file /.../maven-single-jmod-example/target/jmods/first-jmod.jmod 75 | [INFO] com.corporate.project@1.0-SNAPSHOT 76 | [INFO] exports com.corporate.project 77 | [INFO] requires java.base 78 | +---- 79 | 80 | -------------------------------------------------------------------------------- /src/site/apt/examples/example-list.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Usage 3 | ------ 4 | Karl Heinz Marbaise 5 | ------ 6 | 2017-09-01 7 | 8 | ~~ Copyright 2006 The Apache Software Foundation. 9 | ~~ 10 | ~~ Licensed under the Apache License, Version 2.0 (the "License"); 11 | ~~ you may not use this file except in compliance with the License. 12 | ~~ You may obtain a copy of the License at 13 | ~~ 14 | ~~ http://www.apache.org/licenses/LICENSE-2.0 15 | ~~ 16 | ~~ Unless required by applicable law or agreed to in writing, software 17 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 18 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | ~~ See the License for the specific language governing permissions and 20 | ~~ limitations under the License. 21 | 22 | ~~ NOTE: For help with the syntax of this file, see: 23 | ~~ http://maven.apache.org/doxia/references/apt-format.html 24 | 25 | 26 | Usage 27 | 28 | * List Goal 29 | 30 | Assuming you have configured the Maven JMod Plugin 31 | {{{../usage.html}accordingly to the usage page}} like the following: 32 | 33 | +---- 34 | 35 | [...] 36 | 37 | [...] 38 | 39 | [...] 40 | 41 | maven-jmod-plugin 42 | ${project.version} 43 | true 44 | 45 | 46 | 47 | 48 | 49 | list 50 | 51 | list 52 | 53 | verify 54 | 55 | 56 | 57 | 58 | [...] 59 | 60 | +----- 61 | 62 | You can run via: 63 | 64 | +----- 65 | mvn clean verify 66 | +----- 67 | 68 | During the above call of Maven the <> files will be generated and by the <> goal 69 | you will get an output like the following (using toolchains): 70 | 71 | +---- 72 | [INFO] --- maven-jmod-plugin:${project.version}:list (list) @ first-jmod --- 73 | [INFO] Toolchain in maven-jmod-plugin: jmod [ /../jdk1.9.0_ea+181.jdk/Contents/Home/bin/jmod ] 74 | [INFO] The following files are contained in the module file /../maven-single-jmod-example/target/jmods/first-jmod.jmod 75 | [INFO] classes/module-info.class 76 | [INFO] classes/com/corporate/project/Main.class 77 | [INFO] conf/config.1 78 | [INFO] conf/config.2 79 | [INFO] conf/sub-configuration/config.sub 80 | [INFO] include/first.h 81 | [INFO] legal/first.md 82 | [INFO] bin/first.cmd 83 | [INFO] bin/first.sh 84 | [INFO] bin/test.sh 85 | [INFO] lib/native-lib.so 86 | [INFO] 87 | +---- 88 | 89 | -------------------------------------------------------------------------------- /src/site/apt/index.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Introduction 3 | ------ 4 | Karl Heinz Marbaise 5 | ------ 6 | 2017-08-17 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | ${project.name} 30 | 31 | The JMod Plugin is used to create {{{http://openjdk.java.net/jeps/261}JMod Files}}. 32 | 33 | NOTE: This is an alpha release which means everything can change until we reach the first 34 | milestone release. 35 | 36 | * Goals Overview 37 | 38 | The JMod Plugin has currently two goals: 39 | 40 | * {{{./create-mojo.html}jmod:create}} Create jmod files. 41 | 42 | * {{{./list-mojo.html}jmod:list}} List content of a jmod file. 43 | 44 | * {{{./describe-mojo.html}jmod:describe}} List content of a jmod file (module version etc.) 45 | 46 | * {{{./help-mojo.html}jmod:help}} displays help information on maven-jmod-plugin. 47 | 48 | [] 49 | 50 | * Usage 51 | 52 | General instructions on how to use the JMod Plugin can be found on the {{{./usage.html}usage page}}. Some more 53 | specific use cases are described in the examples given below. 54 | 55 | In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel 56 | free to contact the {{{./mailing-lists.html}user mailing list}}. The posts to the mailing list are archived and could 57 | already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching 58 | the {{{./mailing-lists.html}mail archive}}. 59 | 60 | If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our 61 | {{{./issue-management.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your 62 | concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, 63 | entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. 64 | Of course, patches are welcome, too. Contributors can check out the project from our 65 | {{{./scm.html}source repository}} and will find supplementary information in the 66 | {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. 67 | 68 | * Examples 69 | 70 | To provide you with better understanding on some usages of the Maven JMod Plugin, 71 | you can take a look into the following examples: 72 | 73 | * {{{./examples/example-list.html}Usage of jmod:list}} goal. 74 | 75 | * {{{./examples/example-describe.html}Usage of jmod:describe}} goal. 76 | 77 | [] 78 | -------------------------------------------------------------------------------- /src/site/resources/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # Just call the standard mirrors.cgi script. It will use download.html 21 | # as the input template. 22 | exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 26 | 27 | pre-release 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | --------------------------------------------------------------------------------