├── .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 ├── MANTRUN-172 │ ├── build.xml │ ├── invoker.properties │ ├── pom.xml │ └── verify.bsh ├── MANTRUN-178 │ ├── build.xml │ ├── invoker.properties │ └── pom.xml ├── MANTRUN-179 │ ├── pom.xml │ └── verify.bsh ├── MANTRUN-192 │ └── pom.xml ├── MANTRUN-208 │ ├── pom.xml │ └── verify.bsh ├── MANTRUN-221 │ ├── build.xml │ ├── invoker.properties │ ├── package.json │ └── pom.xml ├── ant-1.7-features │ ├── pom.xml │ └── verify.bsh ├── antrun-default-test │ ├── invoker.properties │ ├── pom.xml │ └── verify.bsh ├── attach-artifact-from-ant-task │ ├── build.xml │ ├── invoker.properties │ ├── pom.xml │ ├── test.txt │ └── verify.bsh ├── attach-artifact-test-with-prefix-antlib │ ├── invoker.properties │ ├── pom.xml │ ├── test.txt │ └── verify.bsh ├── attach-artifact-test-with-prefix-antrun │ ├── invoker.properties │ ├── pom.xml │ ├── test.txt │ └── verify.bsh ├── attach-artifact-test-with-prefix-unknown │ ├── invoker.properties │ ├── pom.xml │ └── test.txt ├── attach-artifact-test │ ├── invoker.properties │ ├── pom.xml │ └── verify.bsh ├── classpath-ref-test │ ├── build.xml │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── Test.java ├── classpath-test-scope-test │ └── pom.xml ├── copy-fail-test │ ├── invoker.properties │ ├── pom.xml │ └── stuff │ │ ├── test1.txt │ │ └── test2.txt ├── custom-ant-target-attributes │ ├── pom.xml │ └── verify.groovy ├── custom-task-test │ ├── build.xml │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── TestTask.java ├── env-var-test │ ├── build.xml │ └── pom.xml ├── export-ant-properties │ ├── invoker.properties │ └── pom.xml ├── filesets-test │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── Test.java │ └── verify.bsh ├── local-repo-prop-test │ ├── invoker.properties │ └── pom.xml ├── multiple-phase-test │ ├── invoker.properties │ ├── pom.xml │ └── verify.bsh ├── never-fail-test │ ├── invoker.properties │ └── pom.xml ├── plugin-classpath-test │ ├── build.xml │ ├── calc.g │ └── pom.xml ├── properties-attributes-test │ ├── build.xml │ └── pom.xml ├── properties-test │ ├── build.xml │ ├── invoker.properties │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── Test.java ├── settings.xml ├── task-encoding-test │ └── pom.xml └── tasksattributes-test │ ├── pom.xml │ ├── test.properties │ └── verify.bsh ├── main ├── java │ └── org │ │ └── apache │ │ └── maven │ │ ├── ant │ │ └── tasks │ │ │ ├── AttachArtifactTask.java │ │ │ ├── DependencyFilesetsTask.java │ │ │ └── support │ │ │ ├── SpecificScopesArtifactFilter.java │ │ │ ├── TypesArtifactFilter.java │ │ │ └── VersionMapper.java │ │ └── plugins │ │ └── antrun │ │ ├── AntRunMojo.java │ │ ├── AntrunXmlPlexusConfigurationWriter.java │ │ ├── MavenAntRunProject.java │ │ └── MavenLogger.java ├── mdo │ └── antrun.mdo └── resources │ └── org │ └── apache │ └── maven │ └── ant │ └── tasks │ └── antlib.xml ├── site ├── apt │ ├── examples │ │ ├── classpaths.apt.vm │ │ ├── customTasks.apt.vm │ │ └── tasksAttributes.apt.vm │ ├── index.apt.vm │ ├── tasks │ │ ├── attachArtifact.apt.vm │ │ ├── dependencyFilesets.apt.vm │ │ ├── tasks.apt.vm │ │ └── versionMapper.apt.vm │ └── usage.apt.vm ├── fml │ └── faq.fml ├── resources │ └── download.cgi ├── site.xml └── xdoc │ └── download.xml.vm └── test ├── java └── org │ └── apache │ └── maven │ └── plugins │ └── antrun │ └── AntrunXmlPlexusConfigurationWriterTest.java └── resources └── configuration-writer ├── basic.xml ├── combine-attributes.xml ├── custom-task-prefix.xml └── empty-target.xml /.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 AntRun Plugin" 20 | homepage: https://maven.apache.org/plugins/maven-antrun-plugin/ 21 | labels: 22 | - java 23 | - build-management 24 | - maven-plugins 25 | - maven-antrun-plugin 26 | - maven 27 | enabled_merge_buttons: 28 | squash: true 29 | merge: false 30 | rebase: true 31 | autolink_jira: 32 | - MANTRUN 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 | jira_options: link label comment 41 | -------------------------------------------------------------------------------- /.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: message 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: message 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/MANTRUN 30 | about: Please search old JIRA issues 31 | -------------------------------------------------------------------------------- /.github/dependabot.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 | version: 2 19 | updates: 20 | - package-ecosystem: "maven" 21 | directory: "/" 22 | schedule: 23 | interval: "daily" 24 | - package-ecosystem: "github-actions" 25 | directory: "/" 26 | schedule: 27 | interval: "daily" 28 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Following this checklist to help us incorporate your 2 | contribution quickly and easily: 3 | 4 | - [ ] Your pull request should address just one issue, without pulling in other changes. 5 | - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. 6 | - [ ] Each commit in the pull request should have a meaningful subject line and body. 7 | Note that commits might be squashed by a maintainer on merge. 8 | - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. 9 | This may not always be possible but is a best-practice. 10 | - [ ] Run `mvn verify` to make sure basic checks pass. 11 | A more thorough check will be performed on your pull request automatically. 12 | - [ ] You have run the integration tests successfully (`mvn -Prun-its verify`). 13 | 14 | If your pull request is about ~20 lines of code you don't need to sign an 15 | [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure 16 | please ask on the developers list. 17 | 18 | To make clear that you license your contribution under 19 | the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 20 | you have to acknowledge this by using the following check-box. 21 | 22 | - [ ] 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) 23 | - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). 24 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | workflow_dispatch: 24 | 25 | jobs: 26 | update_release_draft: 27 | uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4 28 | -------------------------------------------------------------------------------- /.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: '49 1 * * *' 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 | .checkstyle 17 | -------------------------------------------------------------------------------- /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/MANTRUN-172/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/it/MANTRUN-172/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 | 18 | invoker.goals = clean validate -Dmy.test.property="from commandline" 19 | invoker.profiles = test-profile 20 | -------------------------------------------------------------------------------- /src/it/MANTRUN-172/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | org.apache.maven.plugins.antrun 27 | MANTRUN-172 28 | pom 29 | 1.0 30 | https://issues.apache.org/jira/browse/MANTRUN-172 31 | 32 | ${my.test.property} 33 | 34 | 35 | 36 | test-profile 37 | 38 | from profile 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-antrun-plugin 46 | @pom.version@ 47 | 48 | 49 | validate 50 | 51 | run 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | org.apache.maven.plugins 69 | maven-clean-plugin 70 | 3.1.0 71 | 72 | 73 | org.apache.maven.plugins 74 | maven-site-plugin 75 | 3.7.1 76 | 77 | 78 | 79 | org.apache.maven.plugins 80 | maven-resources-plugin 81 | 3.1.0 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-compiler-plugin 86 | 3.7.0 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-surefire-plugin 91 | 2.12 92 | 93 | 94 | org.apache.maven.plugins 95 | maven-jar-plugin 96 | 3.1.0 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-install-plugin 101 | 2.5.2 102 | 103 | 104 | org.apache.maven.plugins 105 | maven-deploy-plugin 106 | 2.8.2 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /src/it/MANTRUN-172/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.File; 22 | 23 | import org.codehaus.plexus.util.FileUtils; 24 | 25 | try 26 | { 27 | File buildLog = new File( basedir, "build.log" ); 28 | String log = FileUtils.fileRead( buildLog ); 29 | 30 | if ( !log.contains( "[echo] pom.xml: ptest = from commandline" ) || 31 | !log.contains( "[echo] pom.xml: my.test.property = from commandline" ) || 32 | !log.contains( "[echo] build.xml: ptest = from commandline" ) || 33 | !log.contains( "[echo] build.xml: my.test.property = from commandline" ) ) 34 | { 35 | System.err.println( "Generated console output does not contain [echo] output: " + buildLog ); 36 | return false; 37 | } 38 | } 39 | catch( Throwable t ) 40 | { 41 | t.printStackTrace(); 42 | return false; 43 | } 44 | 45 | return true; 46 | -------------------------------------------------------------------------------- /src/it/MANTRUN-178/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | prop1=${prop1} is not equal to val1-pom 35 | 36 | 37 | prop2=${prop2} is not equal to val2-cli 38 | 39 | 40 | prop3=${prop3} was set 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/it/MANTRUN-178/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 | 18 | invoker.goals = clean validate -Dprop2=val2-cli -Dprop3=val3-cli 19 | -------------------------------------------------------------------------------- /src/it/MANTRUN-178/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | org.apache.maven.plugins.antrun 27 | MANTRUN-178 28 | pom 29 | 1.0 30 | https://issues.apache.org/jira/browse/MANTRUN-178 31 | 32 | Checks that only POM properties are passed to Ant invocation, and that their values can be overriden by a user 33 | property. 34 | 35 | 36 | val1-pom 37 | val2-pom 38 | 39 | 40 | 41 | 42 | 43 | maven-antrun-plugin 44 | @pom.version@ 45 | 46 | 47 | validate 48 | 49 | run 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.apache.maven.plugins 65 | maven-clean-plugin 66 | 3.1.0 67 | 68 | 69 | org.apache.maven.plugins 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-resources-plugin 77 | 3.1.0 78 | 79 | 80 | org.apache.maven.plugins 81 | maven-compiler-plugin 82 | 3.7.0 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-surefire-plugin 87 | 2.12 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-jar-plugin 92 | 3.1.0 93 | 94 | 95 | org.apache.maven.plugins 96 | maven-install-plugin 97 | 2.5.2 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-deploy-plugin 102 | 2.8.2 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /src/it/MANTRUN-179/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | org.apache.maven.plugins.antrun 27 | MANTRUN-179 28 | pom 29 | 1.0 30 | https://issues.apache.org/jira/browse/MANTRUN-179 31 | Checks that combine.* attributes in target do not interfere with Ant execution. 32 | 33 | 34 | 35 | 36 | maven-antrun-plugin 37 | @pom.version@ 38 | 39 | 40 | From the pluginManagement 41 | 42 | 43 | 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-clean-plugin 48 | 3.1.0 49 | 50 | 51 | org.apache.maven.plugins 52 | maven-site-plugin 53 | 3.7.1 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-resources-plugin 59 | 3.1.0 60 | 61 | 62 | org.apache.maven.plugins 63 | maven-compiler-plugin 64 | 3.7.0 65 | 66 | 67 | org.apache.maven.plugins 68 | maven-surefire-plugin 69 | 2.12 70 | 71 | 72 | org.apache.maven.plugins 73 | maven-jar-plugin 74 | 3.1.0 75 | 76 | 77 | org.apache.maven.plugins 78 | maven-install-plugin 79 | 2.5.2 80 | 81 | 82 | org.apache.maven.plugins 83 | maven-deploy-plugin 84 | 2.8.2 85 | 86 | 87 | 88 | 89 | 90 | maven-antrun-plugin 91 | 92 | 93 | test 94 | 95 | run 96 | 97 | validate 98 | 99 | 100 | From the exec config 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /src/it/MANTRUN-179/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.File; 22 | 23 | import org.codehaus.plexus.util.FileUtils; 24 | 25 | try 26 | { 27 | File buildLog = new File( basedir, "build.log" ); 28 | String log = FileUtils.fileRead( buildLog ); 29 | 30 | if ( !log.contains( "[echo] From the pluginManagement" ) || 31 | !log.contains( "[echo] From the exec config" ) ) 32 | { 33 | System.err.println( "Generated console output does not contain [echo] output: " + buildLog ); 34 | return false; 35 | } 36 | } 37 | catch( Throwable t ) 38 | { 39 | t.printStackTrace(); 40 | return false; 41 | } 42 | 43 | return true; 44 | -------------------------------------------------------------------------------- /src/it/MANTRUN-192/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | org.apache.maven.plugins.antrun 27 | MANTRUN-192 28 | pom 29 | 1.0 30 | https://issues.apache.org/jira/browse/MANTRUN-192 31 | Checks that creating a FileSet of the project dependencies also works when there are no dependencies. 32 | 33 | 34 | 35 | maven-antrun-plugin 36 | @pom.version@ 37 | 38 | 39 | 40 | run 41 | 42 | validate 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.apache.maven.plugins 65 | maven-clean-plugin 66 | 3.1.0 67 | 68 | 69 | org.apache.maven.plugins 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-resources-plugin 77 | 3.1.0 78 | 79 | 80 | org.apache.maven.plugins 81 | maven-compiler-plugin 82 | 3.7.0 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-surefire-plugin 87 | 2.12 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-jar-plugin 92 | 3.1.0 93 | 94 | 95 | org.apache.maven.plugins 96 | maven-install-plugin 97 | 2.5.2 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-deploy-plugin 102 | 2.8.2 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /src/it/MANTRUN-208/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import java.util.*; 23 | import java.util.regex.*; 24 | 25 | import org.codehaus.plexus.util.*; 26 | 27 | try 28 | { 29 | File buildLog = new File( basedir, "build.log" ); 30 | String log = FileUtils.fileRead( buildLog ); 31 | 32 | if ( log.indexOf( "compile classpath: |" ) < 0 || log.indexOf( "compile classpath: ||" ) >= 0 ) 33 | { 34 | System.err.println( "Generated console output does not contain compile classpath: " + buildLog ); 35 | return false; 36 | } 37 | } 38 | catch( Throwable t ) 39 | { 40 | t.printStackTrace(); 41 | return false; 42 | } 43 | 44 | return true; 45 | -------------------------------------------------------------------------------- /src/it/MANTRUN-221/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | prop1=${prop1} is not equal to 3.2.1 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/MANTRUN-221/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 | 18 | invoker.goals = clean validate 19 | -------------------------------------------------------------------------------- /src/it/MANTRUN-221/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_license": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. ", 3 | "version": "3.2.1" 4 | } 5 | -------------------------------------------------------------------------------- /src/it/ant-1.7-features/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 4.0.0 25 | org.apache.maven.plugins.antrun 26 | antrun-plugin-test 27 | 1.0-SNAPSHOT 28 | Test for MANTRUN-68 29 | 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-antrun-plugin 35 | @pom.version@ 36 | 37 | 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | run 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-clean-plugin 59 | 3.1.0 60 | 61 | 62 | org.apache.maven.plugins 63 | maven-site-plugin 64 | 3.7.1 65 | 66 | 67 | 68 | org.apache.maven.plugins 69 | maven-resources-plugin 70 | 3.1.0 71 | 72 | 73 | org.apache.maven.plugins 74 | maven-compiler-plugin 75 | 3.7.0 76 | 77 | 78 | org.apache.maven.plugins 79 | maven-surefire-plugin 80 | 2.12 81 | 82 | 83 | org.apache.maven.plugins 84 | maven-jar-plugin 85 | 3.1.0 86 | 87 | 88 | org.apache.maven.plugins 89 | maven-install-plugin 90 | 2.5.2 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-deploy-plugin 95 | 2.8.2 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/it/ant-1.7-features/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import org.codehaus.plexus.util.*; 23 | 24 | try 25 | { 26 | File xmlFile = new File( basedir, "echo.xml" ); 27 | String xml = FileUtils.fileRead( xmlFile, "UTF-8" ); 28 | if ( xml.indexOf( " 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | antrun-plugin.test 27 | antrun-plugin-test 28 | jar 29 | 1.0-SNAPSHOT 30 | 2006 31 | Maven Antrun Plugin Test 32 | http://maven.apache.org 33 | 34 | 35 | org.junit.jupiter 36 | junit-jupiter-engine 37 | @versions.junit5@ 38 | test 39 | 40 | 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-antrun-plugin 46 | @pom.version@ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-clean-plugin 60 | 3.1.0 61 | 62 | 63 | org.apache.maven.plugins 64 | maven-site-plugin 65 | 3.7.1 66 | 67 | 68 | 69 | org.apache.maven.plugins 70 | maven-resources-plugin 71 | 3.1.0 72 | 73 | 74 | org.apache.maven.plugins 75 | maven-compiler-plugin 76 | 3.7.0 77 | 78 | 79 | org.apache.maven.plugins 80 | maven-surefire-plugin 81 | 2.12 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-jar-plugin 86 | 3.1.0 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-install-plugin 91 | 2.5.2 92 | 93 | 94 | org.apache.maven.plugins 95 | maven-deploy-plugin 96 | 2.8.2 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /src/it/antrun-default-test/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import java.util.*; 23 | import java.util.regex.*; 24 | 25 | import org.codehaus.plexus.util.*; 26 | 27 | try 28 | { 29 | File buildLog = new File( basedir, "build.log" ); 30 | String log = FileUtils.fileRead( buildLog ); 31 | 32 | if ( log.indexOf( "[echo] Hello World!" ) < 0 ) 33 | { 34 | System.err.println( "Generated console output does not contain [echo] output: " + buildLog ); 35 | return false; 36 | } 37 | } 38 | catch( Throwable t ) 39 | { 40 | t.printStackTrace(); 41 | return false; 42 | } 43 | 44 | return true; 45 | -------------------------------------------------------------------------------- /src/it/attach-artifact-from-ant-task/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/it/attach-artifact-from-ant-task/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 | 18 | invoker.goals=clean install 19 | -------------------------------------------------------------------------------- /src/it/attach-artifact-from-ant-task/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 4.0.0 25 | org.apache.maven.plugins.antrun 26 | attach-artifact-from-ant-task 27 | 1.0 28 | pom 29 | https://issues.apache.org/jira/browse/MANTRUN-181 30 | 31 | Checks that the attachartifact built-in task works correctly when invoked from an external Ant build through the 32 | ant task. 33 | 34 | 35 | 36 | 37 | maven-antrun-plugin 38 | @pom.version@ 39 | 40 | 41 | call-build 42 | compile 43 | 44 | run 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.apache.maven.plugins 61 | maven-clean-plugin 62 | 3.1.0 63 | 64 | 65 | org.apache.maven.plugins 66 | maven-site-plugin 67 | 3.7.1 68 | 69 | 70 | 71 | org.apache.maven.plugins 72 | maven-resources-plugin 73 | 3.1.0 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-compiler-plugin 78 | 3.7.0 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-surefire-plugin 83 | 2.12 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-jar-plugin 88 | 3.1.0 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-install-plugin 93 | 2.5.2 94 | 95 | 96 | org.apache.maven.plugins 97 | maven-deploy-plugin 98 | 2.8.2 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/it/attach-artifact-from-ant-task/test.txt: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /src/it/attach-artifact-from-ant-task/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | 23 | String[] expectedFiles = { 24 | "org/apache/maven/plugins/antrun/attach-artifact-from-ant-task/1.0/attach-artifact-from-ant-task-1.0.pom", 25 | "org/apache/maven/plugins/antrun/attach-artifact-from-ant-task/1.0/attach-artifact-from-ant-task-1.0-from-pom.txt", 26 | "org/apache/maven/plugins/antrun/attach-artifact-from-ant-task/1.0/attach-artifact-from-ant-task-1.0-from-build.txt" 27 | }; 28 | 29 | for ( String expectedFile : expectedFiles ) 30 | { 31 | File file = new File( localRepositoryPath, expectedFile ); 32 | System.out.println( "Checking for existence of " + file ); 33 | if ( !file.isFile() ) 34 | { 35 | throw new Exception( "Missing file " + file ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antlib/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 | 18 | invoker.goals=clean install 19 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antlib/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 4.0.0 25 | org.apache.maven.plugins.antrun 26 | attach-artifact-test-with-prefix 27 | 1.0 28 | pom 29 | 30 | 31 | 32 | maven-antrun-plugin 33 | @pom.version@ 34 | 35 | 36 | call-build 37 | compile 38 | 39 | run 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.apache.maven.plugins 55 | maven-clean-plugin 56 | 3.1.0 57 | 58 | 59 | org.apache.maven.plugins 60 | maven-site-plugin 61 | 3.7.1 62 | 63 | 64 | 65 | org.apache.maven.plugins 66 | maven-resources-plugin 67 | 3.1.0 68 | 69 | 70 | org.apache.maven.plugins 71 | maven-compiler-plugin 72 | 3.7.0 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-surefire-plugin 77 | 2.12 78 | 79 | 80 | org.apache.maven.plugins 81 | maven-jar-plugin 82 | 3.1.0 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-install-plugin 87 | 2.5.2 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-deploy-plugin 92 | 2.8.2 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antlib/test.txt: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antlib/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | 23 | String[] expectedFiles = { 24 | "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0.pom", 25 | "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0-cl.txt" 26 | }; 27 | 28 | for ( String expectedFile : expectedFiles ) 29 | { 30 | File file = new File( localRepositoryPath, expectedFile ); 31 | System.out.println( "Checking for existence of " + file ); 32 | if ( !file.isFile() ) 33 | { 34 | throw new Exception( "Missing file " + file ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antrun/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 | 18 | invoker.goals=clean install 19 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antrun/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | org.apache.maven.plugins.antrun 27 | attach-artifact-test-with-prefix 28 | 1.0 29 | pom 30 | 31 | 32 | 33 | maven-antrun-plugin 34 | @pom.version@ 35 | 36 | 37 | call-build 38 | compile 39 | 40 | run 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antrun/test.txt: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-antrun/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | 23 | String[] expectedFiles = { 24 | "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0.pom", 25 | "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0-cl.txt" 26 | }; 27 | 28 | for ( String expectedFile : expectedFiles ) 29 | { 30 | File file = new File( localRepositoryPath, expectedFile ); 31 | System.out.println( "Checking for existence of " + file ); 32 | if ( !file.isFile() ) 33 | { 34 | throw new Exception( "Missing file " + file ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-unknown/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 | 18 | invoker.goals = clean install 19 | invoker.buildResult = failure 20 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-unknown/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 4.0.0 25 | org.apache.maven.plugins.antrun 26 | attach-artifact-test-with-prefix-unknown 27 | 1.0 28 | pom 29 | 30 | 31 | 32 | maven-antrun-plugin 33 | @pom.version@ 34 | 35 | 36 | call-build 37 | compile 38 | 39 | run 40 | 41 | 42 | mvn 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.apache.maven.plugins 56 | maven-clean-plugin 57 | 3.1.0 58 | 59 | 60 | org.apache.maven.plugins 61 | maven-site-plugin 62 | 3.7.1 63 | 64 | 65 | 66 | org.apache.maven.plugins 67 | maven-resources-plugin 68 | 3.1.0 69 | 70 | 71 | org.apache.maven.plugins 72 | maven-compiler-plugin 73 | 3.7.0 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-surefire-plugin 78 | 2.12 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-jar-plugin 83 | 3.1.0 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-install-plugin 88 | 2.5.2 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-deploy-plugin 93 | 2.8.2 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test-with-prefix-unknown/test.txt: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /src/it/attach-artifact-test/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 | 18 | invoker.goals=install 19 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | antrun-plugin.test 27 | antrun-plugin-attach-artifact-test 28 | pom 29 | 1.0-SNAPSHOT 30 | 2006 31 | Maven Antrun Plugin Test 32 | http://maven.apache.org 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-antrun-plugin 38 | @pom.version@ 39 | 40 | 41 | attach-artifact-test 42 | package 43 | 44 | run 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.apache.maven.plugins 65 | maven-clean-plugin 66 | 3.1.0 67 | 68 | 69 | org.apache.maven.plugins 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-resources-plugin 77 | 3.1.0 78 | 79 | 80 | org.apache.maven.plugins 81 | maven-compiler-plugin 82 | 3.7.0 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-surefire-plugin 87 | 2.12 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-jar-plugin 92 | 3.1.0 93 | 94 | 95 | org.apache.maven.plugins 96 | maven-install-plugin 97 | 2.5.2 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-deploy-plugin 102 | 2.8.2 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /src/it/attach-artifact-test/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import java.util.*; 23 | import java.util.regex.*; 24 | 25 | import org.codehaus.plexus.util.*; 26 | 27 | try 28 | { 29 | String zipFilePath = "../../local-repo/antrun-plugin/test/antrun-plugin-attach-artifact-test/1.0-SNAPSHOT/antrun-plugin-attach-artifact-test-1.0-SNAPSHOT-foo.zip"; 30 | File installedZipFile = new File( basedir, zipFilePath ); 31 | 32 | if ( ! installedZipFile.exists() ) 33 | { 34 | System.out.println( "Zip file not installed: " + installedZipFile ); 35 | return false; 36 | } 37 | 38 | String zipWithouClassifierFilePath = "../../local-repo/antrun-plugin/test/antrun-plugin-attach-artifact-test/1.0-SNAPSHOT/antrun-plugin-attach-artifact-test-1.0-SNAPSHOT.zip"; 39 | File installedZipWithouClassifierFile = new File( basedir, zipWithouClassifierFilePath ); 40 | 41 | if ( ! installedZipWithouClassifierFile.exists() ) 42 | { 43 | System.out.println( "Zip file (without classifier) not installed: " + installedZipWithouClassifierFile ); 44 | return false; 45 | } 46 | } 47 | catch( Throwable t ) 48 | { 49 | t.printStackTrace(); 50 | return false; 51 | } 52 | 53 | return true; 54 | -------------------------------------------------------------------------------- /src/it/classpath-ref-test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/classpath-ref-test/src/main/java/Test.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 | public class Test 21 | { 22 | 23 | public static void main( String args[] ) 24 | { 25 | System.out.println( "done" ); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/it/classpath-test-scope-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | 27 | org.apache.maven.plugins.antrun 28 | classpath-test-scope 29 | 1.0-SNAPSHOT 30 | Test for MANTRUN-28 31 | maven.test.classpath doesn't contain test scope dependancies 32 | 33 | 34 | 35 | org.junit.jupiter 36 | junit-jupiter-engine 37 | @versions.junit5@ 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-antrun-plugin 46 | @pom.version@ 47 | 48 | 49 | test 50 | 51 | 52 | 53 | ${test.classpath} 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | run 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | org.apache.maven.plugins 75 | maven-clean-plugin 76 | 3.1.0 77 | 78 | 79 | org.apache.maven.plugins 80 | maven-site-plugin 81 | 3.7.1 82 | 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-resources-plugin 87 | 3.1.0 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-compiler-plugin 92 | 3.7.0 93 | 94 | 95 | org.apache.maven.plugins 96 | maven-surefire-plugin 97 | 2.12 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-jar-plugin 102 | 3.1.0 103 | 104 | 105 | org.apache.maven.plugins 106 | maven-install-plugin 107 | 2.5.2 108 | 109 | 110 | org.apache.maven.plugins 111 | maven-deploy-plugin 112 | 2.8.2 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /src/it/copy-fail-test/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 | 18 | invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run 19 | -------------------------------------------------------------------------------- /src/it/copy-fail-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | antrun-plugin.test 27 | antrun-plugin-test 28 | jar 29 | 1.0-SNAPSHOT 30 | 2006 31 | Maven Antrun Plugin Test 32 | http://maven.apache.org 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-antrun-plugin 38 | @pom.version@ 39 | 40 | 41 | 42 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.apache.maven.plugins 61 | maven-clean-plugin 62 | 3.1.0 63 | 64 | 65 | org.apache.maven.plugins 66 | maven-site-plugin 67 | 3.7.1 68 | 69 | 70 | 71 | org.apache.maven.plugins 72 | maven-resources-plugin 73 | 3.1.0 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-compiler-plugin 78 | 3.7.0 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-surefire-plugin 83 | 2.12 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-jar-plugin 88 | 3.1.0 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-install-plugin 93 | 2.5.2 94 | 95 | 96 | org.apache.maven.plugins 97 | maven-deploy-plugin 98 | 2.8.2 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/it/copy-fail-test/stuff/test1.txt: -------------------------------------------------------------------------------- 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 | test1 -------------------------------------------------------------------------------- /src/it/copy-fail-test/stuff/test2.txt: -------------------------------------------------------------------------------- 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 | test2 -------------------------------------------------------------------------------- /src/it/custom-ant-target-attributes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 4.0.0 25 | org.apache.maven.plugins.antrun 26 | custom-ant-target-attributes 27 | 1.0 28 | pom 29 | 30 | 31 | 32 | maven-antrun-plugin 33 | @pom.version@ 34 | 35 | 36 | validate 37 | 38 | run 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-clean-plugin 55 | 3.1.0 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-site-plugin 60 | 3.7.1 61 | 62 | 63 | 64 | org.apache.maven.plugins 65 | maven-resources-plugin 66 | 3.1.0 67 | 68 | 69 | org.apache.maven.plugins 70 | maven-compiler-plugin 71 | 3.7.0 72 | 73 | 74 | org.apache.maven.plugins 75 | maven-surefire-plugin 76 | 2.12 77 | 78 | 79 | org.apache.maven.plugins 80 | maven-jar-plugin 81 | 3.1.0 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-install-plugin 86 | 2.5.2 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-deploy-plugin 91 | 2.8.2 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/it/custom-ant-target-attributes/verify.groovy: -------------------------------------------------------------------------------- 1 | 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 | 21 | def antProject = new groovy.xml.XmlSlurper().parse(new File(basedir, 'target/antrun/build-myname.xml')) 22 | 23 | assert antProject.@default == "myname" 24 | assert antProject.target.size() == 1 25 | assert antProject.target[0].@name == "myname" 26 | assert antProject.target[0].@description == "Foo" 27 | assert antProject.target[0].attributes().size() == 2 28 | -------------------------------------------------------------------------------- /src/it/custom-task-test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | P1: ${property1} 30 | P2: ${property2} 31 | P3: ${property3} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/it/custom-task-test/src/main/java/TestTask.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 | import org.apache.tools.ant.BuildException; 21 | import org.apache.tools.ant.Project; 22 | import org.apache.tools.ant.Task; 23 | 24 | public class TestTask 25 | extends Task 26 | { 27 | 28 | public void execute() 29 | throws BuildException 30 | { 31 | Project p = this.getProject(); 32 | System.out.println( "sourceDirectory:" + p.getProperty( "project.build.sourceDirectory" ) ); 33 | System.out.println( "project.cmdline:" + p.getProperty( "project.cmdline" ) ); 34 | System.out.println( "basedir:" + p.getProperty( "basedir" ) ); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/it/env-var-test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | user.home = ${user.home} 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/it/env-var-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | 27 | org.apache.maven.plugins.antrun 28 | env-var-test 29 | 1.0-SNAPSHOT 30 | Test for MANTRUN-32 31 | ant tasks don't use correct environment in antrun plugin 32 | 33 | 34 | 35 | org.junit.jupiter 36 | junit-jupiter-engine 37 | @versions.junit5@ 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-antrun-plugin 46 | @pom.version@ 47 | 48 | 49 | test 50 | 51 | 52 | user.home = ${user.home} 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | run 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-clean-plugin 78 | 3.1.0 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-site-plugin 83 | 3.7.1 84 | 85 | 86 | 87 | org.apache.maven.plugins 88 | maven-resources-plugin 89 | 3.1.0 90 | 91 | 92 | org.apache.maven.plugins 93 | maven-compiler-plugin 94 | 3.7.0 95 | 96 | 97 | org.apache.maven.plugins 98 | maven-surefire-plugin 99 | 2.12 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-jar-plugin 104 | 3.1.0 105 | 106 | 107 | org.apache.maven.plugins 108 | maven-install-plugin 109 | 2.5.2 110 | 111 | 112 | org.apache.maven.plugins 113 | maven-deploy-plugin 114 | 2.8.2 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /src/it/export-ant-properties/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 | 18 | invoker.goals = clean validate 19 | -------------------------------------------------------------------------------- /src/it/filesets-test/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 | 18 | invoker.goals = clean generate-resources 19 | -------------------------------------------------------------------------------- /src/it/filesets-test/src/main/java/Test.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 | public class Test 21 | { 22 | 23 | public static void main( String args[] ) 24 | { 25 | System.out.println( "done" ); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/it/filesets-test/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import java.util.*; 23 | import java.util.regex.*; 24 | 25 | import org.codehaus.plexus.util.*; 26 | 27 | try 28 | { 29 | File depsDir = new File( basedir, "target/dependencies" ); 30 | File antJar = new File( depsDir, "ant-1.10.14.jar" ); 31 | File junitJar = new File( depsDir, "junit-jupiter-engine-5.12.0.jar" ); 32 | 33 | if ( ! antJar.exists() || antJar.isDirectory() ) 34 | { 35 | System.out.println( "Ant jar file does not exist: " + antJar ); 36 | return false; 37 | } 38 | if ( ! junitJar.exists() || junitJar.isDirectory() ) 39 | { 40 | System.out.println( "Junit jar file does not exist: " + junitJar ); 41 | return false; 42 | } 43 | 44 | File deps2Dir = new File( basedir, "target/dependencies2" ); 45 | antJar = new File( deps2Dir, "ant-1.10.14.jar" ); 46 | junitJar = new File( deps2Dir, "junit-jupiter-api-5.12.0.jar" ); 47 | 48 | if ( ! antJar.exists() || antJar.isDirectory() ) 49 | { 50 | System.out.println( "Ant jar file does not exist: " + antJar ); 51 | return false; 52 | } 53 | if ( ! junitJar.exists() || junitJar.isDirectory() ) 54 | { 55 | System.out.println( "Junit jar file does not exist: " + junitJar ); 56 | return false; 57 | } 58 | } 59 | catch( Throwable t ) 60 | { 61 | t.printStackTrace(); 62 | return false; 63 | } 64 | 65 | return true; 66 | -------------------------------------------------------------------------------- /src/it/local-repo-prop-test/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 | 18 | invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run 19 | -------------------------------------------------------------------------------- /src/it/multiple-phase-test/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 | 18 | invoker.goals = generate-resources 19 | -------------------------------------------------------------------------------- /src/it/multiple-phase-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | antrun-plugin.test 27 | antrun-plugin-test 28 | jar 29 | 1.0-SNAPSHOT 30 | Maven Antrun Plugin Test 31 | http://maven.apache.org 32 | 33 | 34 | 35 | org.apache.maven.plugins 36 | maven-antrun-plugin 37 | @pom.version@ 38 | 39 | 40 | phase-1 41 | 42 | run 43 | 44 | validate 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | phase-2 53 | 54 | run 55 | 56 | generate-resources 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | org.apache.maven.plugins 71 | maven-clean-plugin 72 | 3.1.0 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-site-plugin 77 | 3.7.1 78 | 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-resources-plugin 83 | 3.1.0 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-compiler-plugin 88 | 3.7.0 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-surefire-plugin 93 | 2.12 94 | 95 | 96 | org.apache.maven.plugins 97 | maven-jar-plugin 98 | 3.1.0 99 | 100 | 101 | org.apache.maven.plugins 102 | maven-install-plugin 103 | 2.5.2 104 | 105 | 106 | org.apache.maven.plugins 107 | maven-deploy-plugin 108 | 2.8.2 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/it/multiple-phase-test/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import java.util.*; 23 | import java.util.regex.*; 24 | 25 | import org.codehaus.plexus.util.*; 26 | 27 | try 28 | { 29 | File phase1 = new File( basedir, "phase-1.txt" ); 30 | if ( ! phase1.exists() ) 31 | { 32 | System.err.println( "Could not find Ant generated file: " + phase1 ); 33 | return false; 34 | } 35 | 36 | File phase2 = new File( basedir, "phase-2.txt" ); 37 | if ( ! phase2.exists() ) 38 | { 39 | System.err.println( "Could not find Ant generated file: " + phase2 ); 40 | return false; 41 | } 42 | } 43 | catch( Throwable t ) 44 | { 45 | t.printStackTrace(); 46 | return false; 47 | } 48 | 49 | return true; 50 | -------------------------------------------------------------------------------- /src/it/never-fail-test/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 | 18 | invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run 19 | -------------------------------------------------------------------------------- /src/it/never-fail-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | antrun-plugin.test 27 | antrun-plugin-never-fail-test 28 | jar 29 | 1.0-SNAPSHOT 30 | 2011 31 | Never Fail test for Antrun 32 | http://maven.apache.org 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-antrun-plugin 38 | @pom.version@ 39 | 40 | false 41 | 42 | This is a failure 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | org.apache.maven.plugins 52 | maven-clean-plugin 53 | 3.1.0 54 | 55 | 56 | org.apache.maven.plugins 57 | maven-site-plugin 58 | 3.7.1 59 | 60 | 61 | 62 | org.apache.maven.plugins 63 | maven-resources-plugin 64 | 3.1.0 65 | 66 | 67 | org.apache.maven.plugins 68 | maven-compiler-plugin 69 | 3.7.0 70 | 71 | 72 | org.apache.maven.plugins 73 | maven-surefire-plugin 74 | 2.12 75 | 76 | 77 | org.apache.maven.plugins 78 | maven-jar-plugin 79 | 3.1.0 80 | 81 | 82 | org.apache.maven.plugins 83 | maven-install-plugin 84 | 2.5.2 85 | 86 | 87 | org.apache.maven.plugins 88 | maven-deploy-plugin 89 | 2.8.2 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/it/plugin-classpath-test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/it/plugin-classpath-test/calc.g: -------------------------------------------------------------------------------- 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 | class CalcParser extends Parser; 21 | options { 22 | buildAST = true; // uses CommonAST by default 23 | } 24 | 25 | expr 26 | : mexpr (PLUS^ mexpr)* SEMI! 27 | ; 28 | 29 | mexpr 30 | : atom (STAR^ atom)* 31 | ; 32 | 33 | atom: INT 34 | ; 35 | 36 | class CalcLexer extends Lexer; 37 | 38 | WS : (' ' 39 | | '\t' 40 | | '\n' 41 | | '\r') 42 | { _ttype = Token.SKIP; } 43 | ; 44 | 45 | LPAREN: '(' 46 | ; 47 | 48 | RPAREN: ')' 49 | ; 50 | 51 | STAR: '*' 52 | ; 53 | 54 | PLUS: '+' 55 | ; 56 | 57 | SEMI: ';' 58 | ; 59 | 60 | protected 61 | DIGIT 62 | : '0'..'9' 63 | ; 64 | 65 | INT : (DIGIT)+ 66 | ; 67 | 68 | class CalcTreeWalker extends TreeParser; 69 | 70 | expr returns [float r] 71 | { 72 | float a,b; 73 | r=0; 74 | } 75 | : #(PLUS a=expr b=expr) {r = a+b;} 76 | | #(STAR a=expr b=expr) {r = a*b;} 77 | | i:INT {r = (float)Integer.parseInt(i.getText());} 78 | ; 79 | 80 | -------------------------------------------------------------------------------- /src/it/properties-attributes-test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | P1: ${property1} 30 | P2: ${property2} 31 | P3: ${property3} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/it/properties-test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/it/properties-test/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 | 18 | invoker.goals = clean generate-resources 19 | invoker.profiles = property-profile -------------------------------------------------------------------------------- /src/it/properties-test/src/main/java/Test.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 | public class Test 21 | { 22 | 23 | public static void main( String args[] ) 24 | { 25 | System.out.println( "done" ); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /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/it/task-encoding-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 4.0.0 25 | 26 | org.apache.maven.plugins.antrun 27 | mantrun-155 28 | 1.0-SNAPSHOT 29 | pom 30 | 31 | mantrun-155 32 | 33 | 34 | UTF-8 35 | 36 | 37 | 38 | 39 | 40 | org.apache.maven.plugins 41 | maven-antrun-plugin 42 | @pom.version@ 43 | 44 | 45 | antrun 46 | test 47 | 48 | run 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | org.apache.maven.plugins 67 | maven-clean-plugin 68 | 3.1.0 69 | 70 | 71 | org.apache.maven.plugins 72 | maven-site-plugin 73 | 3.7.1 74 | 75 | 76 | 77 | org.apache.maven.plugins 78 | maven-resources-plugin 79 | 3.1.0 80 | 81 | 82 | org.apache.maven.plugins 83 | maven-compiler-plugin 84 | 3.7.0 85 | 86 | 87 | org.apache.maven.plugins 88 | maven-surefire-plugin 89 | 2.12 90 | 91 | 92 | org.apache.maven.plugins 93 | maven-jar-plugin 94 | 3.1.0 95 | 96 | 97 | org.apache.maven.plugins 98 | maven-install-plugin 99 | 2.5.2 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-deploy-plugin 104 | 2.8.2 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /src/it/tasksattributes-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 4.0.0 26 | antrun-plugin.test 27 | antrun-plugin-test 28 | jar 29 | 1.0-SNAPSHOT 30 | 2006 31 | Maven Antrun Plugin Test 32 | http://maven.apache.org 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | maven-antrun-plugin 40 | @pom.version@ 41 | 42 | 43 | if 44 | compile 45 | 46 | 47 | [ANTRUN-OUTPUT-MARKER:IF] 48 | 49 | 50 | 51 | run 52 | 53 | 54 | 55 | unless 56 | compile 57 | 58 | 59 | [ANTRUN-OUTPUT-MARKER:UNLESS] 60 | 61 | 62 | 63 | run 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | org.apache.maven.plugins 74 | maven-clean-plugin 75 | 3.1.0 76 | 77 | 78 | org.apache.maven.plugins 79 | maven-site-plugin 80 | 3.7.1 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-resources-plugin 86 | 3.1.0 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-compiler-plugin 91 | 3.7.0 92 | 93 | 94 | org.apache.maven.plugins 95 | maven-surefire-plugin 96 | 2.12 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-jar-plugin 101 | 3.1.0 102 | 103 | 104 | org.apache.maven.plugins 105 | maven-install-plugin 106 | 2.5.2 107 | 108 | 109 | org.apache.maven.plugins 110 | maven-deploy-plugin 111 | 2.8.2 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/it/tasksattributes-test/test.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 | 18 | maven.test.skip=true 19 | -------------------------------------------------------------------------------- /src/it/tasksattributes-test/verify.bsh: -------------------------------------------------------------------------------- 1 | 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 | 21 | import java.io.*; 22 | import java.util.*; 23 | import java.util.regex.*; 24 | 25 | import org.codehaus.plexus.util.*; 26 | 27 | try 28 | { 29 | File buildLog = new File( basedir, "build.log" ); 30 | String log = FileUtils.fileRead( buildLog ); 31 | 32 | if ( log.indexOf( "[echo] [ANTRUN-OUTPUT-MARKER:IF]" ) < 0 ) 33 | { 34 | System.err.println( "Generated console output does not contain expected marker output" ); 35 | return false; 36 | } 37 | 38 | if ( log.indexOf( "[echo] [ANTRUN-OUTPUT-MARKER:UNLESS]" ) >= 0 ) 39 | { 40 | System.err.println( "Generated console output contains unexpected marker output" ); 41 | return false; 42 | } 43 | } 44 | catch( Throwable t ) 45 | { 46 | t.printStackTrace(); 47 | return false; 48 | } 49 | 50 | return true; 51 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/ant/tasks/AttachArtifactTask.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 | package org.apache.maven.ant.tasks; 20 | 21 | import java.io.File; 22 | 23 | import org.apache.maven.plugins.antrun.AntRunMojo; 24 | import org.apache.maven.plugins.antrun.MavenAntRunProject; 25 | import org.apache.maven.plugins.antrun.taskconfig.AttachArtifactConfiguration; 26 | import org.apache.maven.project.MavenProject; 27 | import org.apache.maven.project.MavenProjectHelper; 28 | import org.apache.tools.ant.BuildException; 29 | import org.apache.tools.ant.Project; 30 | import org.apache.tools.ant.Task; 31 | import org.codehaus.plexus.util.FileUtils; 32 | 33 | /** 34 | * 35 | */ 36 | public class AttachArtifactTask extends Task { 37 | 38 | /** 39 | * The refId of the Maven project. 40 | */ 41 | private String mavenProjectRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_REF_REFID; 42 | 43 | /** 44 | * The refId of the Maven project helper component. 45 | */ 46 | @SuppressWarnings("FieldCanBeLocal") 47 | private String mavenProjectHelperRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_HELPER_REFID; 48 | 49 | private AttachArtifactConfiguration configuration = new AttachArtifactConfiguration(); 50 | 51 | @Override 52 | public void execute() { 53 | File file = configuration.getFile(); 54 | if (file == null) { 55 | throw new BuildException("File is a required parameter."); 56 | } 57 | 58 | if (!file.exists()) { 59 | throw new BuildException("File does not exist: " + file); 60 | } 61 | 62 | if (this.getProject().getReference(mavenProjectRefId) == null) { 63 | throw new BuildException("Maven project reference not found: " + mavenProjectRefId); 64 | } 65 | 66 | String type = configuration.getType(); 67 | if (type == null) { 68 | type = FileUtils.getExtension(file.getName()); 69 | } 70 | 71 | MavenProject mavenProject = 72 | ((MavenAntRunProject) this.getProject().getReference(mavenProjectRefId)).getMavenProject(); 73 | 74 | if (this.getProject().getReference(mavenProjectHelperRefId) == null) { 75 | throw new BuildException("Maven project helper reference not found: " + mavenProjectHelperRefId); 76 | } 77 | 78 | String classifier = configuration.getClassifier(); 79 | log("Attaching " + file + " as an attached artifact", Project.MSG_VERBOSE); 80 | MavenProjectHelper projectHelper = getProject().getReference(mavenProjectHelperRefId); 81 | projectHelper.attachArtifact(mavenProject, type, classifier, file); 82 | } 83 | 84 | /** 85 | * @return {@link #mavenProjectRefId} 86 | */ 87 | public String getMavenProjectRefId() { 88 | return mavenProjectRefId; 89 | } 90 | 91 | /** 92 | * @param mavenProjectRefId {@link #mavenProjectRefId} 93 | */ 94 | public void setMavenProjectRefId(String mavenProjectRefId) { 95 | this.mavenProjectRefId = mavenProjectRefId; 96 | } 97 | 98 | /* Fields delegated to AttachArtifactConfiguration */ 99 | 100 | public File getFile() { 101 | return this.configuration.getFile(); 102 | } 103 | 104 | public void setFile(File file) { 105 | this.configuration.setFile(file); 106 | } 107 | 108 | public String getClassifier() { 109 | return this.configuration.getClassifier(); 110 | } 111 | 112 | public void setClassifier(String classifier) { 113 | this.configuration.setClassifier(classifier); 114 | } 115 | 116 | public String getType() { 117 | return this.configuration.getType(); 118 | } 119 | 120 | public void setType(String type) { 121 | this.configuration.setType(type); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilter.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 | package org.apache.maven.ant.tasks.support; 20 | 21 | import org.apache.maven.artifact.Artifact; 22 | import org.apache.maven.artifact.resolver.filter.ArtifactFilter; 23 | 24 | /** 25 | * Filter to only retain objects in the given scope(s). 26 | * 27 | * @author pgier 28 | */ 29 | public class SpecificScopesArtifactFilter implements ArtifactFilter { 30 | private boolean compileScope; 31 | 32 | private boolean runtimeScope; 33 | 34 | private boolean testScope; 35 | 36 | private boolean providedScope; 37 | 38 | private boolean systemScope; 39 | 40 | /** 41 | * Takes a comma separated list of scopes to include. 42 | * 43 | * @param scopes A comma separated list of scopes 44 | */ 45 | public SpecificScopesArtifactFilter(String scopes) { 46 | String[] scopeList = scopes.split(","); 47 | 48 | for (String aScopeList : scopeList) { 49 | if (aScopeList.trim().equals(Artifact.SCOPE_COMPILE)) { 50 | compileScope = true; 51 | } else if (aScopeList.trim().equals(Artifact.SCOPE_PROVIDED)) { 52 | providedScope = true; 53 | } else if (aScopeList.trim().equals(Artifact.SCOPE_RUNTIME)) { 54 | runtimeScope = true; 55 | } else if (aScopeList.trim().equals(Artifact.SCOPE_SYSTEM)) { 56 | systemScope = true; 57 | } else if (aScopeList.trim().equals(Artifact.SCOPE_TEST)) { 58 | testScope = true; 59 | } 60 | } 61 | } 62 | 63 | /** {@inheritDoc} */ 64 | @Override 65 | public boolean include(Artifact artifact) { 66 | if (Artifact.SCOPE_COMPILE.equals(artifact.getScope())) { 67 | return compileScope; 68 | } else if (Artifact.SCOPE_RUNTIME.equals(artifact.getScope())) { 69 | return runtimeScope; 70 | } else if (Artifact.SCOPE_TEST.equals(artifact.getScope())) { 71 | return testScope; 72 | } else if (Artifact.SCOPE_PROVIDED.equals(artifact.getScope())) { 73 | return providedScope; 74 | } else if (Artifact.SCOPE_SYSTEM.equals(artifact.getScope())) { 75 | return systemScope; 76 | } else { 77 | return true; 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/ant/tasks/support/TypesArtifactFilter.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 | package org.apache.maven.ant.tasks.support; 20 | 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | import org.apache.maven.artifact.Artifact; 25 | import org.apache.maven.artifact.resolver.filter.ArtifactFilter; 26 | 27 | /** 28 | * Artifact Filter which filters on artifact types. 29 | */ 30 | public class TypesArtifactFilter implements ArtifactFilter { 31 | private List types = new ArrayList<>(); 32 | 33 | /** 34 | * Accepts a comma separated list of types 35 | * 36 | * @param types The types. 37 | */ 38 | public TypesArtifactFilter(String types) { 39 | if (!types.trim().equals("")) { 40 | for (String type : types.split(",")) { 41 | this.types.add(type.trim()); 42 | } 43 | } 44 | } 45 | 46 | /** {@inheritDoc} */ 47 | @Override 48 | public boolean include(Artifact artifact) { 49 | String artifactType = artifact.getType(); 50 | if (artifactType == null || artifactType.equals("")) { 51 | artifactType = "jar"; 52 | } 53 | return types.contains(artifactType); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/ant/tasks/support/VersionMapper.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 | package org.apache.maven.ant.tasks.support; 20 | 21 | import java.io.File; 22 | import java.util.Arrays; 23 | import java.util.Comparator; 24 | import java.util.List; 25 | 26 | import org.apache.tools.ant.util.FileNameMapper; 27 | import org.codehaus.plexus.util.StringUtils; 28 | 29 | /** 30 | * Ant filename mapper to remove version info from filename when copying dependencies. 31 | * 32 | * @author Herve Boutemy 33 | */ 34 | public class VersionMapper implements FileNameMapper, Comparator { 35 | private List versions; 36 | 37 | private String to; 38 | 39 | /** {@inheritDoc} */ 40 | @Override 41 | public String[] mapFileName(String sourceFileName) { 42 | String originalFileName = new File(sourceFileName).getName(); 43 | for (String version : versions) { 44 | int index = originalFileName.indexOf(version); 45 | if (index >= 0) { 46 | // remove version in artifactId-version(-classifier).type 47 | String baseFilename = originalFileName.substring(0, index - 1); 48 | String extension = originalFileName.substring(index + version.length()); 49 | String path = sourceFileName.substring(0, sourceFileName.length() - originalFileName.length()); 50 | if ("flatten".equals(to)) { 51 | path = ""; 52 | } 53 | return new String[] {path + baseFilename + extension}; 54 | } 55 | } 56 | return new String[] {sourceFileName}; 57 | } 58 | 59 | /** 60 | * Set the versions identifiers that this mapper can remove from filenames. The separator value used is path 61 | * separator, as used by dependencies task when setting versionsId property value. 62 | * @param from The string from which we set. 63 | */ 64 | @Override 65 | public void setFrom(String from) { 66 | String[] split = StringUtils.split(from, File.pathSeparator); 67 | // sort, from lengthiest to smallest 68 | Arrays.sort(split, this); 69 | versions = Arrays.asList(split); 70 | } 71 | 72 | /** 73 | * By default, only filename is changed, but if this attribute is set to flatten, directory is removed. 74 | * @param to {@link #to} 75 | */ 76 | @Override 77 | public void setTo(String to) { 78 | this.to = to; 79 | } 80 | 81 | /** {@inheritDoc} */ 82 | @Override 83 | public int compare(String s1, String s2) { 84 | int lengthDiff = s2.length() - s1.length(); 85 | return (lengthDiff != 0) ? lengthDiff : s1.compareTo(s2); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.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 | package org.apache.maven.plugins.antrun; 20 | 21 | import java.io.BufferedOutputStream; 22 | import java.io.File; 23 | import java.io.FileOutputStream; 24 | import java.io.IOException; 25 | import java.util.Arrays; 26 | import java.util.HashSet; 27 | import java.util.Set; 28 | 29 | import org.codehaus.plexus.configuration.PlexusConfiguration; 30 | import org.codehaus.plexus.util.xml.Xpp3DomUtils; 31 | import org.codehaus.plexus.util.xml.pull.MXSerializer; 32 | import org.codehaus.plexus.util.xml.pull.XmlSerializer; 33 | 34 | /** 35 | * Write the Ant target Plexus configuration to an XML file. 36 | */ 37 | class AntrunXmlPlexusConfigurationWriter { 38 | 39 | private static final Set EXCLUDED_ATTRIBUTES = new HashSet<>(Arrays.asList( 40 | Xpp3DomUtils.CHILDREN_COMBINATION_MODE_ATTRIBUTE, Xpp3DomUtils.SELF_COMBINATION_MODE_ATTRIBUTE)); 41 | 42 | /** 43 | * @param configuration {@link PlexusConfiguration} 44 | * @param file File to write the Plexus configuration to. 45 | * @param customTaskPrefix Prefix to use for the custom Ant tasks. Empty if no prefix should be used. 46 | * @param antTargetName Name of the default Ant target. 47 | * @throws IOException In case of problems. 48 | */ 49 | public void write(PlexusConfiguration configuration, File file, String customTaskPrefix, String antTargetName) 50 | throws IOException { 51 | MXSerializer serializer = new MXSerializer(); 52 | serializer.setProperty( 53 | "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", 54 | System.getProperty("line.separator")); 55 | serializer.setProperty("http://xmlpull.org/v1/doc/properties.html#serializer-indentation", " "); 56 | try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file))) { 57 | serializer.setOutput(bos, AntRunMojo.UTF_8); 58 | serializer.startDocument(AntRunMojo.UTF_8, null); 59 | if (!customTaskPrefix.isEmpty()) { 60 | serializer.setPrefix(customTaskPrefix, AntRunMojo.TASK_URI); 61 | } 62 | serializer.startTag(null, "project"); 63 | serializer.attribute(null, "name", "maven-antrun-"); 64 | serializer.attribute(null, "default", antTargetName); 65 | write(configuration, serializer); 66 | serializer.endTag(null, "project"); 67 | serializer.endDocument(); 68 | } 69 | } 70 | 71 | private void write(PlexusConfiguration c, XmlSerializer serializer) throws IOException { 72 | serializer.startTag(null, c.getName()); 73 | writeAttributes(c, serializer); 74 | 75 | int count = c.getChildCount(); 76 | if (count == 0) { 77 | String value = c.getValue(); 78 | if (value != null) { 79 | serializer.text(value); 80 | } 81 | } else { 82 | for (int i = 0; i < count; i++) { 83 | PlexusConfiguration child = c.getChild(i); 84 | write(child, serializer); 85 | } 86 | } 87 | 88 | serializer.endTag(null, c.getName()); 89 | } 90 | 91 | private void writeAttributes(PlexusConfiguration c, XmlSerializer serializer) throws IOException { 92 | String[] names = c.getAttributeNames(); 93 | 94 | for (String name : names) { 95 | if (!EXCLUDED_ATTRIBUTES.contains(name)) { 96 | serializer.attribute(null, name, c.getAttribute(name)); 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/antrun/MavenAntRunProject.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 | package org.apache.maven.plugins.antrun; 20 | 21 | import org.apache.maven.project.MavenProject; 22 | 23 | /** 24 | * Encapsulates a Maven project with an unsupported clone operation. This makes sure that, when used as a reference in 25 | * an Ant project, it is passed by reference to sub-projects when inheritRefs is set to true 26 | * (which would otherwise pass a clone). 27 | * 28 | * @author gboue 29 | */ 30 | public class MavenAntRunProject { 31 | 32 | private MavenProject mavenProject; 33 | 34 | public MavenAntRunProject(MavenProject mavenProject) { 35 | this.mavenProject = mavenProject; 36 | } 37 | 38 | public MavenProject getMavenProject() { 39 | return mavenProject; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/antrun/MavenLogger.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 | package org.apache.maven.plugins.antrun; 20 | 21 | import java.io.PrintStream; 22 | 23 | import org.apache.maven.plugin.logging.Log; 24 | import org.apache.tools.ant.DefaultLogger; 25 | import org.apache.tools.ant.Project; 26 | 27 | /** 28 | * Redirects build events from {@link DefaultLogger} to {@link Log}. 29 | */ 30 | public class MavenLogger extends DefaultLogger { 31 | 32 | private final Log log; 33 | 34 | public MavenLogger(Log log) { 35 | this.log = log; 36 | } 37 | 38 | @Override 39 | protected void printMessage(final String message, final PrintStream stream, final int priority) { 40 | switch (priority) { 41 | case Project.MSG_ERR: 42 | log.error(message); 43 | break; 44 | case Project.MSG_WARN: 45 | log.warn(message); 46 | break; 47 | case Project.MSG_DEBUG: 48 | case Project.MSG_VERBOSE: 49 | log.debug(message); 50 | break; 51 | case Project.MSG_INFO: 52 | default: 53 | log.info(message); 54 | break; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/mdo/antrun.mdo: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 26 | antrun 27 | AntRun 28 | 29 | 30 | 31 | package 32 | org.apache.maven.plugins.antrun.taskconfig 33 | 34 | 35 | 36 | 37 | 38 | AttachArtifactConfiguration 39 | 40 | 41 | 42 | _file_placeholder 43 | String 44 | true 45 | The file to attach to the project 46 | 47 | 48 | classifier 49 | String 50 | A classifier assigned to the artifact 51 | 52 | 53 | type 54 | String 55 | The type of the artifact, zip, war, etc 56 | 57 | 58 | 59 | 60 | 73 | 74 | 75 | 76 | 77 | 78 | DependencyFilesetsConfiguration 79 | 80 | 81 | prefix 82 | String 83 | String to prepend to all fileset IDs 84 | 85 | 86 | projectDependenciesId 87 | String 88 | maven.project.dependencies 89 | RefId for the fileset containing all project dependencies 90 | 91 | 92 | scopes 93 | String 94 | Comma separated list of artifact scopes to include 95 | 96 | 97 | types 98 | String 99 | Comma separated list of artifact types to include 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/maven/ant/tasks/antlib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/site/apt/examples/customTasks.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Using tasks not included in Ant's default jar 3 | ------ 4 | Carlos Sanchez 5 | ------ 6 | 2008-07-15 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Using tasks not included in Ant's default jar 30 | 31 | To use Ant tasks not included in the Ant jar, like Ant optional or custom tasks you need to add the dependencies needed for the task 32 | to run to the plugin classpath and use the <<>> reference if needed. 33 | 34 | +---+ 35 | 36 | 4.0.0 37 | my-test-app 38 | my-test-group 39 | 1.0-SNAPSHOT 40 | 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-antrun-plugin 46 | ${project.version} 47 | 48 | 49 | ftp 50 | deploy 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | run 67 | 68 | 69 | 70 | 71 | 72 | org.apache.ant 73 | ant-commons-net 74 | ${project.version} 75 | 76 | 77 | 78 | 79 | 80 | 81 | +---+ 82 | 83 | Another example of this is the use of {{{http://ant-contrib.sourceforge.net/}Ant-Contrib}} tasks: 84 | 85 | +---+ 86 | 87 | [...] 88 | 89 | [...] 90 | 91 | [...] 92 | 93 | org.apache.maven.plugins 94 | maven-antrun-plugin 95 | ${project.version} 96 | 97 | 98 | [...] 99 | 100 | 101 | 102 | [...] 103 | 104 | 105 | 106 | run 107 | 108 | 109 | 110 | 111 | 112 | ant-contrib 113 | ant-contrib 114 | 1.0b3 115 | 116 | 117 | ant 118 | ant 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | +---+ 128 | -------------------------------------------------------------------------------- /src/site/apt/examples/tasksAttributes.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Using tasks attributes 3 | ------ 4 | Vincent Siveton 5 | ------ 6 | 2006-09-30 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Using <<<\>>> Attributes 30 | 31 | You can specify attributes in the <<<\>>> configuration to execute or not Ant tasks 32 | depending some conditions. For example, to skip Ant call, you could add the following: 33 | 34 | +---+ 35 | 36 | ... 37 | 38 | 39 | ... 40 | 41 | org.apache.maven.plugins 42 | maven-antrun-plugin 43 | ${project.version} 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | run 56 | 57 | 58 | 59 | 60 | ... 61 | 62 | 63 | ... 64 | 65 | +---+ 66 | -------------------------------------------------------------------------------- /src/site/apt/index.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Introduction 3 | ------ 4 | Kenney Westerhof, Franz Allan Valencia See 5 | ------ 6 | 2013-07-22 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | ${project.name} 30 | 31 | This plugin provides the ability to run Ant tasks from within Maven. You can 32 | even embed your Ant scripts in the POM! 33 | 34 | It is the intention of this plugin to provide a means of polluting the 35 | POM, so it's encouraged to move all your Ant tasks to a <<>> file 36 | and just call it from the POM using Ant's 37 | {{{https://ant.apache.org/manual/Tasks/ant.html}\ task}}. 38 | 39 | One of the main purposes of this plugin is to facilitate the migration from Ant 40 | based projects to Maven. Some projects may not currently be able to migrate 41 | because they depend on custom build functionality that Maven doesn't provide 42 | by default. 43 | 44 | * Goals Overview 45 | 46 | * {{{./run-mojo.html}antrun:run}} runs Ant tasks for Maven. 47 | 48 | * Major Version Upgrade to version 3.0.0 49 | 50 | Please note that the following parameters have been completely removed from the plugin configuration: 51 | 52 | * <<>>: use <<>> instead; 53 | 54 | * <<>> and <<>>: you can use the 55 | {{{https://www.mojohaus.org/build-helper-maven-plugin/}build-helper-maven-plugin}} instead, with its 56 | {{{https://www.mojohaus.org/build-helper-maven-plugin/add-source-mojo.html}add-source}} and 57 | {{{https://www.mojohaus.org/build-helper-maven-plugin/add-test-source-mojo.html}add-test-source}} goals. 58 | 59 | The format <<>> to reference the path of a project 60 | dependency as an Ant property has been removed: use <<>> instead. 61 | 62 | * Usage 63 | 64 | General instructions on how to use the AntRun Plugin can be found on the {{{./usage.html}usage page}}. Some more 65 | specific use cases are described in the examples given below. 66 | 67 | In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel 68 | free to contact the {{{./mailing-lists.html}user mailing list}}. The posts to the mailing list are archived and could 69 | already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching 70 | the {{{./mailing-lists.html}mail archive}}. 71 | 72 | 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 73 | {{{./issue-management.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your 74 | concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, 75 | entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. 76 | Of course, patches are welcome, too. Contributors can check out the project from our 77 | {{{./scm.html}source repository}} and will find supplementary information in the 78 | {{{/guides/development/guide-helping.html}guide to helping with Maven}}. 79 | 80 | * Examples 81 | 82 | To provide you with better understanding on some usages of the Maven AntRun 83 | Plugin, you can take a look into the following examples: 84 | 85 | * {{{./examples/classpaths.html}Referencing the Maven Classpaths}} 86 | 87 | * {{{./examples/tasksAttributes.html}Using <<<\>>> Attributes}} 88 | 89 | * {{{./examples/customTasks.html}Using tasks not included in Ant's default jar}} 90 | 91 | [] 92 | -------------------------------------------------------------------------------- /src/site/apt/tasks/attachArtifact.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | AttachArtifact Task 3 | ------ 4 | Paul Gier 5 | ------ 6 | 2010-05-21 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | AttachArtifact Task 30 | 31 | This task will attatch an artifact to the current Maven project. This is can be used to install and 32 | deploy an artifact generated by the Ant tasks. 33 | 34 | * Task Parameters 35 | 36 | *---------------+--------------------------------------------------------+-----------------------------------* 37 | || Attribute || Description || Required | 38 | *---------------+--------------------------------------------------------+-----------------------------------* 39 | | file | The file to attach to the project | Yes | 40 | *---------------+--------------------------------------------------------+-----------------------------------* 41 | | classifier | A classifier assigned to the artifact | No, defaults to no classifier | 42 | *---------------+--------------------------------------------------------+-----------------------------------* 43 | | type | The type of the artifact, zip, war, etc | No, defaults to jar | 44 | *---------------+--------------------------------------------------------+-----------------------------------* 45 | 46 | 47 | * Example 48 | 49 | This example shows how to use the <<>> task. 50 | 51 | +---+ 52 | 53 | org.apache.maven.plugins 54 | maven-antrun-plugin 55 | ${project.version} 56 | 57 | 58 | attach-artifact 59 | package 60 | 61 | run 62 | 63 | 64 | 65 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | +---+ -------------------------------------------------------------------------------- /src/site/apt/tasks/dependencyFilesets.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | DependencyFileSets Task 3 | ------ 4 | Paul Gier 5 | ------ 6 | 2010-03-19 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | DependencyFilesets Task 30 | 31 | This task will create fileset objects containing the Maven project dependencies. This can be used access 32 | specific dependency artifacts, or to operate on a set of dependency artifacts. Each artifact will be assigned 33 | a fileset ID in the form <<<[prefix]groupId:artifactId:[classifier]:type>>>. A dependency on a junit jar would be 34 | given a fileset ID of <<>>. 35 | 36 | In addition, a single fileset containing all the project dependencies will be created using the default ID 37 | maven.project.dependencies 38 | 39 | * Task Parameters 40 | 41 | *---------------+--------------------------------------------------------+-----------------------------------* 42 | || Attribute || Description || Required | 43 | *---------------+--------------------------------------------------------+-----------------------------------* 44 | | prefix | String to prepend to all fileset IDs | No, defaults to empty string | 45 | *---------------+--------------------------------------------------------+-----------------------------------* 46 | | projectDependenciesId | RefId for the fileset containing all project dependencies | No, defaults to "maven.project.dependencies | 47 | *---------------+--------------------------------------------------------+-----------------------------------* 48 | | scopes | Comma separated list of artifact scopes to include | No, defaults to all artifacts | 49 | *---------------+--------------------------------------------------------+-----------------------------------* 50 | | types | Comma separated list of artifact types to include | No, defaults to all artifacts | 51 | *---------------+--------------------------------------------------------+-----------------------------------* 52 | 53 | 54 | * Example 55 | 56 | This example shows how to access individual dependencies and the combined dependency fileset. 57 | 58 | +---+ 59 | 60 | org.apache.maven.plugins 61 | maven-antrun-plugin 62 | ${project.version} 63 | 64 | 65 | copy-dependencies 66 | package 67 | 68 | run 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | +---+ 91 | 92 | -------------------------------------------------------------------------------- /src/site/apt/tasks/tasks.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Ant Tasks 3 | ------ 4 | Paul Gier 5 | ------ 6 | 2010-03-19 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Ant Tasks 30 | 31 | The Maven Antrun Plugin includes some custom Ant tasks which can be used to better integrate with the 32 | Maven build. This page provides an overview of these tasks. Click on the task name for more information 33 | and examples. 34 | 35 | *-----------------------------------------------------+--------------------------------------------------------+ 36 | || Task || Description | 37 | *---------------+--------------------------------------------------------+ 38 | | {{{./attachArtifact.html}attachartifact}} | Attach an artifact to the current Maven project | 39 | *---------------+--------------------------------------------------------+ 40 | | {{{./dependencyFilesets.html}dependencyfilesets}} | Creates a fileset for each of the Maven project dependencies and adds them to the Ant build | 41 | *---------------+--------------------------------------------------------+ 42 | | {{{./versionMapper.html}versionMapper}} | Mapper to remove version from artifact filenames | 43 | *---------------+--------------------------------------------------------+ 44 | -------------------------------------------------------------------------------- /src/site/apt/tasks/versionMapper.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | VersionMapper 3 | ------ 4 | Paul Gier 5 | ------ 6 | 2010-05-21 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 | ~~ https://maven.apache.org/doxia/references/apt-format.html 28 | 29 | VersionMapper 30 | 31 | This is an Ant mapper class which can be used to remove the versions from the dependency 32 | artifact filenames.. 33 | 34 | * Example 35 | 36 | This example shows how to use the version mapper. 37 | 38 | +---+ 39 | 40 | org.apache.maven.plugins 41 | maven-antrun-plugin 42 | ${project.version} 43 | 44 | 45 | copy-dependencies 46 | package 47 | 48 | run 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | +---+ 69 | 70 | -------------------------------------------------------------------------------- /src/site/fml/faq.fml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 26 | 27 | 28 | Why use antrun and not the Ant program itself? 29 | 30 |

Maven has certain benefits over Ant. And for your Ant projects to take 31 | advantage of these, you can use Maven as your project management tool and 32 | use its maven-antrun-plugin to build your Ant projects.

33 |

Furthermore, if you wish to migrate from Ant to Maven, you can use 34 | this plugin first, then gradually convert your Ant expressions into their 35 | corresponding Maven expressions.

36 |
37 |
38 |
39 |
40 | 41 | -------------------------------------------------------------------------------- /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 | org.apache.maven.skins 28 | maven-fluido-skin 29 | 1.9 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/test/resources/configuration-writer/basic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/configuration-writer/combine-attributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/configuration-writer/custom-task-prefix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The first value. 5 | The second value. 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/configuration-writer/empty-target.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | --------------------------------------------------------------------------------