├── .asf.yaml ├── .git-blame-ignore-revs ├── .github ├── ISSUE_TEMPLATE │ ├── BUG.yml │ ├── FEATURE.yml │ └── config.yml ├── dependabot.yml ├── pull_request_template.md ├── release-drafter.yml └── workflows │ ├── maven.yml │ ├── pr-automation.yml │ ├── release-drafter.yml │ └── stale.yml ├── .gitignore ├── Jenkinsfile ├── README.md ├── pom.xml └── src ├── it ├── issue-mscmpub-50 │ ├── invoker.properties │ ├── pom.xml │ ├── selector.groovy │ ├── setup.bsh │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── ThisHasJavadoc.java │ │ └── site │ │ │ ├── apt │ │ │ └── index.apt │ │ │ ├── resources │ │ │ └── trunk │ │ │ │ └── readme.txt │ │ │ └── site.xml │ └── verify.bsh ├── publish-scm-skip │ ├── invoker.properties │ ├── pom.xml │ ├── selector.groovy │ ├── setup.bsh │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── ThisHasJavadoc.java │ │ └── site │ │ │ ├── apt │ │ │ └── index.apt │ │ │ ├── resources │ │ │ └── trunk │ │ │ │ └── readme.txt │ │ │ └── site.xml │ └── verify.bsh ├── publish-scm-staged │ ├── invoker.properties │ ├── pom.xml │ ├── selector.groovy │ ├── setup.bsh │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── apache │ │ │ └── maven │ │ │ └── it │ │ │ └── ThisHasJavadoc.java │ │ └── site │ │ ├── apt │ │ └── index.apt │ │ ├── resources │ │ └── trunk │ │ │ └── readme.txt │ │ └── site.xml ├── publish-scm │ ├── invoker.properties │ ├── pom.xml │ ├── selector.groovy │ ├── setup.bsh │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── ThisHasJavadoc.java │ │ └── site │ │ │ ├── apt │ │ │ └── index.apt │ │ │ ├── resources │ │ │ └── trunk │ │ │ │ └── readme.txt │ │ │ └── site.xml │ └── verify.bsh ├── settings.xml └── site-deploy │ ├── invoker.properties │ ├── pom.xml │ ├── selector.groovy │ ├── setup.bsh │ └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── maven │ │ └── it │ │ └── ThisHasJavadoc.java │ └── site │ ├── apt │ └── index.apt │ ├── resources │ └── trunk │ │ └── readme.txt │ └── site.xml ├── main └── java │ └── org │ └── apache │ └── maven │ └── plugins │ └── scmpublish │ ├── AbstractScmPublishMojo.java │ └── ScmPublishPublishScmMojo.java └── site ├── apt ├── examples │ ├── importing-maven-site.apt │ ├── multi-module-configuration.apt.vm │ └── one-module-configuration.apt.vm ├── index.apt.vm ├── usage.apt.vm └── various-tips.apt.vm ├── resources └── download.cgi ├── site.xml └── xdoc └── download.xml.vm /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # see https://s.apache.org/asfyaml 18 | github: 19 | description: "Apache Maven SCM Publish Plugin" 20 | homepage: https://maven.apache.org/plugins/maven-scm-publish-plugin/ 21 | labels: 22 | - java 23 | - build-management 24 | - maven-plugins 25 | - maven-scm-publish-plugin 26 | - maven 27 | enabled_merge_buttons: 28 | squash: true 29 | merge: false 30 | rebase: true 31 | autolink_jira: 32 | - MSCMPUB 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 41 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 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 | # Change maven code style 21 | ef21a970c9cdd66ef8107ad95b886a3d322018a1 22 | 23 | -------------------------------------------------------------------------------- /.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/MSCMPUB 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 | ignore: 25 | # ignore Maven Core updates 26 | - dependency-name: "org.apache.maven:*" 27 | - package-ecosystem: "github-actions" 28 | directory: "/" 29 | schedule: 30 | interval: "daily" 31 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Following this checklist to help us incorporate your 2 | contribution quickly and easily: 3 | 4 | - [ ] 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.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: '12 5 * * *' 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 | *~ 11 | .idea 12 | out/ 13 | .DS_Store 14 | /bootstrap 15 | /dependencies.xml 16 | .java-version 17 | .checkstyle 18 | .factorypath -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 17 | Contributing to [Apache Maven SCM Publish Plugin](https://maven.apache.org/plugins/maven-scm-publish-plugin/) 18 | ====================== 19 | 20 | [![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license] 21 | [![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-scm-publish-plugin.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-scm-publish-plugin) 22 | [![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/apache/maven/plugins/maven-scm-publish-plugin/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/apache/maven/plugins/maven-scm-publish-plugin/README.md) 23 | [![Jenkins Status](https://img.shields.io/jenkins/s/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-scm-publish-plugin/job/master.svg?)][build] 24 | [![Jenkins tests](https://img.shields.io/jenkins/t/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-scm-publish-plugin/job/master.svg?)][test-results] 25 | 26 | 27 | You have found a bug, or you have an idea for a cool new feature? Contributing 28 | code is a great way to give something back to the open source community. Before 29 | you dig right into the code, there are a few guidelines that we need 30 | contributors to follow so that we can have a chance of keeping on top of 31 | things. 32 | 33 | Getting Started 34 | --------------- 35 | 36 | + Make sure you have a [GitHub account](https://github.com/signup/free). 37 | + If you're planning to implement a new feature, it makes sense to discuss your changes 38 | on the [dev list][ml-list] first. 39 | This way you can make sure you're not wasting your time on something that isn't 40 | considered to be in Apache Maven's scope. 41 | + Submit a ticket for your issue, assuming one does not already exist. 42 | + Clearly describe the issue, including steps to reproduce when it is a bug. 43 | + Make sure you fill in the earliest version that you know has the issue. 44 | + Fork the repository on GitHub. 45 | 46 | Making and Submitting Changes 47 | -------------- 48 | 49 | We accept Pull Requests via GitHub. The [developer mailing list][ml-list] is the 50 | main channel of communication for contributors. 51 | There are some guidelines which will make applying PRs easier for us: 52 | + Create a topic branch from where you want to base your work (this is usually the master branch). 53 | Push your changes to a topic branch in your fork of the repository. 54 | + Make commits of logical units. 55 | + Respect the original code style: by using the same [codestyle][code-style], 56 | patches should only highlight the actual difference, not being disturbed by any formatting issues: 57 | + Only use spaces for indentation. 58 | + Create minimal diffs - disable on save actions like reformat source code or organize imports. 59 | If you feel the source code should be reformatted, create a separate PR for this change. 60 | + Check for unnecessary whitespace with `git diff --check` before committing. 61 | + Make sure you have added the necessary tests (JUnit/IT) for your changes. 62 | + Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken. 63 | + Submit a pull request to the repository in the Apache organization. 64 | 65 | If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla]. 66 | 67 | Additional Resources 68 | -------------------- 69 | 70 | + [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch) 71 | + [Contributor License Agreement][cla] 72 | + [General GitHub documentation](https://help.github.com/) 73 | + [GitHub pull request documentation](https://help.github.com/send-pull-requests/) 74 | + [Apache Maven X Account](https://x.com/ASFMavenProject) 75 | + [Apache Maven Bluesky Account](https://bsky.app/profile/maven.apache.org) 76 | + [Apache Maven Mastodon Account](https://mastodon.social/deck/@ASFMavenProject@fosstodon.org) 77 | 78 | [license]: https://www.apache.org/licenses/LICENSE-2.0 79 | [ml-list]: https://maven.apache.org/mailing-lists.html 80 | [code-style]: https://maven.apache.org/developers/conventions/code.html 81 | [cla]: https://www.apache.org/licenses/#clas 82 | [maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index 83 | [test-results]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-scm-publish-plugin/job/master/lastCompletedBuild/testReport/ 84 | [build]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-scm-publish-plugin/job/master/ 85 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-plugins 26 | 42 27 | 28 | 29 | 30 | maven-scm-publish-plugin 31 | 3.3.1-SNAPSHOT 32 | maven-plugin 33 | 34 | Apache Maven SCM Publish Plugin 35 | 36 | 37 | 38 | Roman Korpachyov 39 | 40 | 41 | 42 | 43 | ${mavenVersion} 44 | 45 | 46 | 47 | scm:git:https://gitbox.apache.org/repos/asf/maven-scm-publish-plugin.git 48 | scm:git:https://gitbox.apache.org/repos/asf/maven-scm-publish-plugin.git 49 | HEAD 50 | https://github.com/apache/maven-scm-publish-plugin/tree/${project.scm.tag} 51 | 52 | 53 | GitHub Issues 54 | https://github.com/apache/maven-scm-publish-plugin/issues 55 | 56 | 57 | Jenkins 58 | https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-scm-publish-plugin/ 59 | 60 | 61 | 62 | apache.website 63 | scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path} 64 | 65 | 66 | 67 | 68 | 8 69 | 3.6.3 70 | 2.1.0 71 | 3.1.1 72 | 3.12.1 73 | 3.1.0 74 | 3.6.0 75 | 3.7.0 76 | 2024-06-16T20:16:56Z 77 | 78 | 79 | 80 | 81 | org.apache.maven.release 82 | maven-release-api 83 | ${releasePluginVersion} 84 | 85 | 86 | org.apache.maven.release 87 | maven-release-manager 88 | ${releasePluginVersion} 89 | 90 | 91 | org.apache.maven 92 | maven-model 93 | ${mavenVersion} 94 | provided 95 | 96 | 97 | org.apache.maven 98 | maven-core 99 | ${mavenVersion} 100 | provided 101 | 102 | 103 | org.apache.maven 104 | maven-settings 105 | ${mavenVersion} 106 | provided 107 | 108 | 109 | org.apache.maven 110 | maven-plugin-api 111 | ${mavenVersion} 112 | provided 113 | 114 | 115 | org.apache.maven.plugin-tools 116 | maven-plugin-annotations 117 | provided 118 | 119 | 120 | org.apache.maven.shared 121 | maven-shared-utils 122 | 3.4.2 123 | 124 | 125 | org.codehaus.plexus 126 | plexus-utils 127 | 128 | 129 | commons-io 130 | commons-io 131 | 2.19.0 132 | 133 | 134 | org.apache.commons 135 | commons-lang3 136 | 3.17.0 137 | 138 | 139 | org.apache.maven.scm 140 | maven-scm-api 141 | ${scmVersion} 142 | 143 | 144 | javax.inject 145 | javax.inject 146 | 1 147 | provided 148 | 149 | 150 | org.apache.maven.scm 151 | maven-scm-providers-standard 152 | ${scmVersion} 153 | pom 154 | runtime 155 | 156 | 157 | org.apache.maven.scm 158 | maven-scm-provider-svn-commons 159 | ${scmVersion} 160 | 161 | 162 | org.apache.maven.scm 163 | maven-scm-provider-svntest 164 | ${scmVersion} 165 | test 166 | 167 | 168 | 169 | 170 | 171 | run-its 172 | 173 | 174 | 175 | org.apache.maven.plugins 176 | maven-invoker-plugin 177 | 178 | true 179 | 180 | 181 | 182 | 183 | 184 | 185 | reporting 186 | 187 | 188 | 189 | org.apache.maven.plugins 190 | maven-scm-publish-plugin 191 | ${project.version} 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/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 = site scm-publish:publish-scm 19 | -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.apache.maven.plugins 24 | maven-scm-publish-plugin-006-issue-mscmpub-50 25 | 1.0-SNAPSHOT 26 | 27 | publish-scm site (without staging) 28 | http://people.apache.org/~bimargulies/site-test 29 | 30 | 31 | 32 | publish-scm-002 33 | scm:svn:${project.baseUri}/target/svn-root 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-site-plugin 43 | @sitePluginVersion@ 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-scm-publish-plugin 48 | @project.version@ 49 | 50 | ${project.reporting.outputDirectory} 51 | true 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-antrun-plugin 60 | @antrunPluginVersion@ 61 | 62 | 63 | ln 64 | site 65 | 66 | run 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-project-info-reports-plugin 86 | @projectInfoReportsPluginVersion@ 87 | 88 | false 89 | false 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-javadoc-plugin 95 | @javadocPluginVersion@ 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/selector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.Files 21 | import java.nio.file.Path 22 | 23 | try { 24 | def proc = "svnadmin".execute() 25 | proc.consumeProcessOutput() 26 | proc.waitFor() 27 | 28 | def proc2 = "svn".execute() 29 | proc2.consumeProcessOutput() 30 | proc2.waitFor() 31 | 32 | def pom = basedir.toPath().resolve("pom.xml") 33 | def linkedPom = basedir.toPath().resolve("linked-pom.xml") 34 | Files.deleteIfExists(linkedPom) 35 | Files.createSymbolicLink(linkedPom, pom) 36 | } catch (IOException e) { 37 | return false 38 | } 39 | 40 | return true 41 | -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import org.apache.maven.scm.provider.svn.SvnScmTestUtils; 22 | 23 | SvnScmTestUtils.initializeRepository( new File( basedir, "target/svn-root" ) ); 24 | 25 | return true; -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/src/main/java/org/apache/maven/it/ThisHasJavadoc.java: -------------------------------------------------------------------------------- 1 | package org.apache.maven.it; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * This is a class with some javadoc. 24 | **/ 25 | public class ThisHasJavadoc 26 | { 27 | /** 28 | * This is the constructor. 29 | */ 30 | public ThisHasJavadoc() 31 | { 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/src/site/apt/index.apt: -------------------------------------------------------------------------------- 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 | Index 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultrices magna quis arcu venenatis varius. Donec pellentesque fringilla mauris, eget convallis quam gravida nec. Sed sapien urna, dapibus sed fringilla nec, adipiscing vitae dui. Sed at vestibulum diam. Integer mattis, eros in congue imperdiet, enim sapien eleifend mauris, sit amet blandit turpis nibh quis lorem. Donec consectetur hendrerit velit. Nulla luctus, felis eget luctus pharetra, sem lectus dapibus ante, eget sodales lorem felis laoreet tortor. Sed nisi orci, commodo in tempus id, semper sed tellus. Aenean tellus augue, dapibus vitae fermentum commodo, dapibus quis ante. Ut tempus nunc ut erat rutrum sit amet eleifend justo imperdiet. Suspendisse euismod nibh sit amet eros faucibus eget iaculis erat aliquet. -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/src/site/resources/trunk/readme.txt: -------------------------------------------------------------------------------- 1 | This file content is not the same as reference svn. 2 | Will check svn checkin. 3 | -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/issue-mscmpub-50/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.Files; 21 | 22 | File checkout = new File( basedir, "target/scmpublish-checkout" ); 23 | 24 | return !checkout.exists(); 25 | -------------------------------------------------------------------------------- /src/it/publish-scm-skip/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 = site scm-publish:publish-scm 19 | -------------------------------------------------------------------------------- /src/it/publish-scm-skip/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.apache.maven.plugins 24 | maven-scm-publish-plugin-007-publish-scm-skip 25 | 1.0-SNAPSHOT 26 | 27 | publish-scm site (without staging) 28 | http://people.apache.org/~bimargulies/site-test 29 | 30 | 31 | 32 | publish-scm-002 33 | scm:svn:${project.baseUri}/target/svn-root 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-site-plugin 43 | @sitePluginVersion@ 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-scm-publish-plugin 48 | @project.version@ 49 | 50 | ${project.reporting.outputDirectory} 51 | true 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-antrun-plugin 60 | @antrunPluginVersion@ 61 | 62 | 63 | ln 64 | site 65 | 66 | run 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-project-info-reports-plugin 86 | @projectInfoReportsPluginVersion@ 87 | 88 | false 89 | false 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-javadoc-plugin 95 | @javadocPluginVersion@ 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /src/it/publish-scm-skip/selector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.Files 21 | import java.nio.file.Path 22 | 23 | try { 24 | def proc = "svnadmin".execute() 25 | proc.consumeProcessOutput() 26 | proc.waitFor() 27 | 28 | def proc2 = "svn".execute() 29 | proc2.consumeProcessOutput() 30 | proc2.waitFor() 31 | 32 | def pom = basedir.toPath().resolve("pom.xml") 33 | def linkedPom = basedir.toPath().resolve("linked-pom.xml") 34 | Files.deleteIfExists(linkedPom) 35 | Files.createSymbolicLink(linkedPom, pom) 36 | } catch (IOException e) { 37 | return false 38 | } 39 | 40 | return true 41 | -------------------------------------------------------------------------------- /src/it/publish-scm-skip/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import org.apache.maven.scm.provider.svn.SvnScmTestUtils; 22 | 23 | SvnScmTestUtils.initializeRepository( new File( basedir, "target/svn-root" ) ); 24 | 25 | return true; -------------------------------------------------------------------------------- /src/it/publish-scm-skip/src/main/java/org/apache/maven/it/ThisHasJavadoc.java: -------------------------------------------------------------------------------- 1 | package org.apache.maven.it; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * This is a class with some javadoc. 24 | **/ 25 | public class ThisHasJavadoc 26 | { 27 | /** 28 | * This is the constructor. 29 | */ 30 | public ThisHasJavadoc() 31 | { 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /src/it/publish-scm-skip/src/site/apt/index.apt: -------------------------------------------------------------------------------- 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 | Index 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultrices magna quis arcu venenatis varius. Donec pellentesque fringilla mauris, eget convallis quam gravida nec. Sed sapien urna, dapibus sed fringilla nec, adipiscing vitae dui. Sed at vestibulum diam. Integer mattis, eros in congue imperdiet, enim sapien eleifend mauris, sit amet blandit turpis nibh quis lorem. Donec consectetur hendrerit velit. Nulla luctus, felis eget luctus pharetra, sem lectus dapibus ante, eget sodales lorem felis laoreet tortor. Sed nisi orci, commodo in tempus id, semper sed tellus. Aenean tellus augue, dapibus vitae fermentum commodo, dapibus quis ante. Ut tempus nunc ut erat rutrum sit amet eleifend justo imperdiet. Suspendisse euismod nibh sit amet eros faucibus eget iaculis erat aliquet. -------------------------------------------------------------------------------- /src/it/publish-scm-skip/src/site/resources/trunk/readme.txt: -------------------------------------------------------------------------------- 1 | This file content is not the same as reference svn. 2 | Will check svn checkin. 3 | -------------------------------------------------------------------------------- /src/it/publish-scm-skip/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/publish-scm-skip/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.Files; 21 | 22 | File checkout = new File( basedir, "target/scmpublish-checkout" ); 23 | 24 | return !checkout.exists(); 25 | -------------------------------------------------------------------------------- /src/it/publish-scm-staged/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 = site site:stage scm-publish:publish-scm -------------------------------------------------------------------------------- /src/it/publish-scm-staged/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.apache.maven.plugins 24 | maven-scm-publish-plugin-004-publish-scm-staged 25 | 1.0-SNAPSHOT 26 | 27 | publish-scm from staged site 28 | http://people.apache.org/~bimargulies/site-test 29 | 30 | 31 | 32 | publish-scm-004 33 | scm:svn:${project.baseUri}/target/svn-root 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-site-plugin 43 | @sitePluginVersion@ 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-scm-publish-plugin 48 | @project.version@ 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-project-info-reports-plugin 59 | @projectInfoReportsPluginVersion@ 60 | 61 | false 62 | false 63 | 64 | 65 | 66 | org.apache.maven.plugins 67 | maven-javadoc-plugin 68 | @javadocPluginVersion@ 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/it/publish-scm-staged/selector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | try { 21 | def proc = "svnadmin".execute() 22 | proc.consumeProcessOutput() 23 | proc.waitFor() 24 | 25 | def proc2 = "svn".execute() 26 | proc2.consumeProcessOutput() 27 | proc2.waitFor() 28 | } catch (IOException e) { 29 | return false 30 | } 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/publish-scm-staged/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import org.apache.maven.scm.provider.svn.SvnScmTestUtils; 22 | 23 | SvnScmTestUtils.initializeRepository( new File( basedir, "target/svn-root" ) ); 24 | 25 | return true; -------------------------------------------------------------------------------- /src/it/publish-scm-staged/src/main/java/org/apache/maven/it/ThisHasJavadoc.java: -------------------------------------------------------------------------------- 1 | package org.apache.maven.it; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * This is a class with some javadoc. 24 | **/ 25 | public class ThisHasJavadoc 26 | { 27 | /** 28 | * This is the constructor. 29 | */ 30 | public ThisHasJavadoc() 31 | { 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /src/it/publish-scm-staged/src/site/apt/index.apt: -------------------------------------------------------------------------------- 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 | Index 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultrices magna quis arcu venenatis varius. Donec pellentesque fringilla mauris, eget convallis quam gravida nec. Sed sapien urna, dapibus sed fringilla nec, adipiscing vitae dui. Sed at vestibulum diam. Integer mattis, eros in congue imperdiet, enim sapien eleifend mauris, sit amet blandit turpis nibh quis lorem. Donec consectetur hendrerit velit. Nulla luctus, felis eget luctus pharetra, sem lectus dapibus ante, eget sodales lorem felis laoreet tortor. Sed nisi orci, commodo in tempus id, semper sed tellus. Aenean tellus augue, dapibus vitae fermentum commodo, dapibus quis ante. Ut tempus nunc ut erat rutrum sit amet eleifend justo imperdiet. Suspendisse euismod nibh sit amet eros faucibus eget iaculis erat aliquet. -------------------------------------------------------------------------------- /src/it/publish-scm-staged/src/site/resources/trunk/readme.txt: -------------------------------------------------------------------------------- 1 | This file content is not the same as reference svn. 2 | Will check svn checkin. 3 | -------------------------------------------------------------------------------- /src/it/publish-scm-staged/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/publish-scm/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 = site scm-publish:publish-scm 19 | -------------------------------------------------------------------------------- /src/it/publish-scm/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.apache.maven.plugins 24 | maven-scm-publish-plugin-002-publish-scm 25 | 1.0-SNAPSHOT 26 | 27 | publish-scm site (without staging) 28 | http://people.apache.org/~bimargulies/site-test 29 | 30 | 31 | 32 | publish-scm-002 33 | scm:svn:${project.baseUri}/target/svn-root 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-site-plugin 43 | @sitePluginVersion@ 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-scm-publish-plugin 48 | @project.version@ 49 | 50 | ${project.reporting.outputDirectory} 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-antrun-plugin 59 | @antrunPluginVersion@ 60 | 61 | 62 | ln 63 | site 64 | 65 | run 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | org.apache.maven.plugins 84 | maven-project-info-reports-plugin 85 | @projectInfoReportsPluginVersion@ 86 | 87 | false 88 | false 89 | 90 | 91 | 92 | org.apache.maven.plugins 93 | maven-javadoc-plugin 94 | @javadocPluginVersion@ 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/it/publish-scm/selector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.Files 21 | import java.nio.file.Path 22 | import java.util.Locale 23 | 24 | try { 25 | def proc = "svnadmin".execute() 26 | proc.consumeProcessOutput() 27 | proc.waitFor() 28 | 29 | def proc2 = "svn".execute() 30 | proc2.consumeProcessOutput() 31 | proc2.waitFor() 32 | 33 | def pom = basedir.toPath().resolve("pom.xml") 34 | def linkedPom = basedir.toPath().resolve("linked-pom.xml") 35 | Files.deleteIfExists(linkedPom) 36 | Files.createSymbolicLink(linkedPom, pom) 37 | } catch (IOException e) { 38 | return false 39 | } 40 | 41 | // Because of a bug in Subversion on Windows 42 | if (System.properties['os.name'].toLowerCase(Locale.ROOT).contains('windows')) { 43 | return false 44 | } 45 | 46 | return true 47 | -------------------------------------------------------------------------------- /src/it/publish-scm/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import org.apache.maven.scm.provider.svn.SvnScmTestUtils; 22 | 23 | SvnScmTestUtils.initializeRepository( new File( basedir, "target/svn-root" ) ); 24 | 25 | return true; -------------------------------------------------------------------------------- /src/it/publish-scm/src/main/java/org/apache/maven/it/ThisHasJavadoc.java: -------------------------------------------------------------------------------- 1 | package org.apache.maven.it; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * This is a class with some javadoc. 24 | **/ 25 | public class ThisHasJavadoc 26 | { 27 | /** 28 | * This is the constructor. 29 | */ 30 | public ThisHasJavadoc() 31 | { 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /src/it/publish-scm/src/site/apt/index.apt: -------------------------------------------------------------------------------- 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 | Index 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultrices magna quis arcu venenatis varius. Donec pellentesque fringilla mauris, eget convallis quam gravida nec. Sed sapien urna, dapibus sed fringilla nec, adipiscing vitae dui. Sed at vestibulum diam. Integer mattis, eros in congue imperdiet, enim sapien eleifend mauris, sit amet blandit turpis nibh quis lorem. Donec consectetur hendrerit velit. Nulla luctus, felis eget luctus pharetra, sem lectus dapibus ante, eget sodales lorem felis laoreet tortor. Sed nisi orci, commodo in tempus id, semper sed tellus. Aenean tellus augue, dapibus vitae fermentum commodo, dapibus quis ante. Ut tempus nunc ut erat rutrum sit amet eleifend justo imperdiet. Suspendisse euismod nibh sit amet eros faucibus eget iaculis erat aliquet. -------------------------------------------------------------------------------- /src/it/publish-scm/src/site/resources/trunk/readme.txt: -------------------------------------------------------------------------------- 1 | This file content is not the same as reference svn. 2 | Will check svn checkin. 3 | -------------------------------------------------------------------------------- /src/it/publish-scm/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/publish-scm/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.Files; 21 | 22 | File checkout = new File( basedir, "target/scmpublish-checkout" ); 23 | 24 | if ( !Files.isSymbolicLink( new File( checkout, "link" ).toPath() ) ) 25 | { 26 | System.err.println( "link is not a symbolic link" ); 27 | return false; 28 | } 29 | 30 | if ( !Files.isSymbolicLink( new File( checkout, "link-directory" ).toPath() ) ) 31 | { 32 | System.err.println( "link-directory is not a symbolic link" ); 33 | return false; 34 | } 35 | 36 | if ( !Files.isSymbolicLink( new File( checkout, "link-file" ).toPath() ) ) 37 | { 38 | System.err.println( "link-file is not a symbolic link" ); 39 | return false; 40 | } 41 | 42 | return true; 43 | -------------------------------------------------------------------------------- /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/site-deploy/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 = site-deploy -------------------------------------------------------------------------------- /src/it/site-deploy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.apache.maven.plugins 24 | maven-scm-publish-plugin-005-site-lifecycle 25 | 1.0-SNAPSHOT 26 | 27 | maven-scm-publish-plugin-004-005-site-lifecycle 28 | http://people.apache.org/~bimargulies/site-test 29 | 30 | 31 | 32 | site-lifecycle 33 | scm:svn:${project.baseUri}/target/svn-root 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-site-plugin 43 | @sitePluginVersion@ 44 | 45 | true 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-scm-publish-plugin 51 | @project.version@ 52 | 53 | 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-site-plugin 59 | 60 | 61 | stage-for-scm-publish 62 | post-site 63 | 64 | stage 65 | 66 | 67 | 68 | 69 | 70 | org.apache.maven.plugins 71 | maven-scm-publish-plugin 72 | @project.version@ 73 | 74 | 75 | scm-publish 76 | site-deploy 77 | 78 | publish-scm 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-project-info-reports-plugin 91 | @projectInfoReportsPluginVersion@ 92 | 93 | false 94 | false 95 | 96 | 97 | 98 | org.apache.maven.plugins 99 | maven-javadoc-plugin 100 | @javadocPluginVersion@ 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /src/it/site-deploy/selector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | try { 21 | def proc = "svnadmin".execute() 22 | proc.consumeProcessOutput() 23 | proc.waitFor() 24 | 25 | def proc2 = "svn".execute() 26 | proc2.consumeProcessOutput() 27 | proc2.waitFor() 28 | } catch (IOException e) { 29 | return false 30 | } 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/site-deploy/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import org.apache.maven.scm.provider.svn.SvnScmTestUtils; 22 | 23 | SvnScmTestUtils.initializeRepository( new File( basedir, "target/svn-root" ) ); 24 | 25 | return true; -------------------------------------------------------------------------------- /src/it/site-deploy/src/main/java/org/apache/maven/it/ThisHasJavadoc.java: -------------------------------------------------------------------------------- 1 | package org.apache.maven.it; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | /** 23 | * This is a class with some javadoc. 24 | **/ 25 | public class ThisHasJavadoc 26 | { 27 | /** 28 | * This is the constructor. 29 | */ 30 | public ThisHasJavadoc() 31 | { 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /src/it/site-deploy/src/site/apt/index.apt: -------------------------------------------------------------------------------- 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 | Index 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultrices magna quis arcu venenatis varius. Donec pellentesque fringilla mauris, eget convallis quam gravida nec. Sed sapien urna, dapibus sed fringilla nec, adipiscing vitae dui. Sed at vestibulum diam. Integer mattis, eros in congue imperdiet, enim sapien eleifend mauris, sit amet blandit turpis nibh quis lorem. Donec consectetur hendrerit velit. Nulla luctus, felis eget luctus pharetra, sem lectus dapibus ante, eget sodales lorem felis laoreet tortor. Sed nisi orci, commodo in tempus id, semper sed tellus. Aenean tellus augue, dapibus vitae fermentum commodo, dapibus quis ante. Ut tempus nunc ut erat rutrum sit amet eleifend justo imperdiet. Suspendisse euismod nibh sit amet eros faucibus eget iaculis erat aliquet. -------------------------------------------------------------------------------- /src/it/site-deploy/src/site/resources/trunk/readme.txt: -------------------------------------------------------------------------------- 1 | This file content is not the same as reference svn. 2 | Will check svn checkin. 3 | -------------------------------------------------------------------------------- /src/it/site-deploy/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/scmpublish/AbstractScmPublishMojo.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.scmpublish; 20 | 21 | import java.io.File; 22 | import java.io.IOException; 23 | import java.nio.file.Files; 24 | import java.util.ArrayList; 25 | import java.util.Arrays; 26 | import java.util.Collection; 27 | import java.util.HashSet; 28 | import java.util.List; 29 | import java.util.Map; 30 | import java.util.Set; 31 | import java.util.TreeSet; 32 | 33 | import org.apache.commons.io.FileUtils; 34 | import org.apache.commons.io.FilenameUtils; 35 | import org.apache.commons.lang3.time.DurationFormatUtils; 36 | import org.apache.maven.plugin.AbstractMojo; 37 | import org.apache.maven.plugin.MojoExecutionException; 38 | import org.apache.maven.plugin.MojoFailureException; 39 | import org.apache.maven.plugins.annotations.Parameter; 40 | import org.apache.maven.scm.CommandParameter; 41 | import org.apache.maven.scm.CommandParameters; 42 | import org.apache.maven.scm.ScmBranch; 43 | import org.apache.maven.scm.ScmException; 44 | import org.apache.maven.scm.ScmFileSet; 45 | import org.apache.maven.scm.ScmResult; 46 | import org.apache.maven.scm.command.add.AddScmResult; 47 | import org.apache.maven.scm.command.checkin.CheckInScmResult; 48 | import org.apache.maven.scm.manager.NoSuchScmProviderException; 49 | import org.apache.maven.scm.manager.ScmManager; 50 | import org.apache.maven.scm.provider.ScmProvider; 51 | import org.apache.maven.scm.provider.ScmUrlUtils; 52 | import org.apache.maven.scm.provider.svn.AbstractSvnScmProvider; 53 | import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; 54 | import org.apache.maven.scm.repository.ScmRepository; 55 | import org.apache.maven.scm.repository.ScmRepositoryException; 56 | import org.apache.maven.settings.Settings; 57 | import org.apache.maven.shared.release.config.ReleaseDescriptor; 58 | import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder; 59 | import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; 60 | import org.apache.maven.shared.utils.logging.MessageUtils; 61 | 62 | /** 63 | * Base class for the scm-publish mojos. 64 | */ 65 | public abstract class AbstractScmPublishMojo extends AbstractMojo { 66 | // CHECKSTYLE_OFF: LineLength 67 | /** 68 | * URL of the target SCM repository to publish to in format 69 | * {@code scm:}. 70 | *

71 | * Example: 72 | * {@code scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/plugins/maven-scm-publish-plugin-LATEST/} 73 | * 74 | * @see SCM URL Format 75 | */ 76 | // CHECKSTYLE_ON: LineLength 77 | @Parameter( 78 | property = "scmpublish.pubScmUrl", 79 | defaultValue = "${project.distributionManagement.site.url}", 80 | required = true) 81 | protected String pubScmUrl; 82 | 83 | /** 84 | * If the {@link AbstractScmPublishMojo#checkoutDirectory} exists and this flag is activated, the plugin will try an SCM-update instead 85 | * of deleting first and then doing a fresh checkout. 86 | */ 87 | @Parameter(property = "scmpublish.tryUpdate", defaultValue = "false") 88 | protected boolean tryUpdate; 89 | 90 | // CHECKSTYLE_OFF: LineLength 91 | /** 92 | * Filesystem path of the directory to where the scm check-out is done. By default, scm checkout is done in build (target) directory, 93 | * which is deleted on every mvn clean. To avoid this and get better performance, configure 94 | * this location outside build structure and set tryUpdate to true. 95 | * See 96 | * Improving SCM Checkout Performance for more information. 97 | */ 98 | // CHECKSTYLE_ON: LineLength 99 | @Parameter( 100 | property = "scmpublish.checkoutDirectory", 101 | defaultValue = "${project.build.directory}/scmpublish-checkout") 102 | protected File checkoutDirectory; 103 | 104 | /** 105 | * Location where the content is published inside the ${checkoutDirectory}. 106 | * By default, content is copyed at the root of ${checkoutDirectory}. 107 | */ 108 | @Parameter(property = "scmpublish.subDirectory") 109 | protected String subDirectory; 110 | 111 | /** 112 | * If set to {@code true} displays list of added, deleted, and changed files, but does not do any actual SCM operations. 113 | */ 114 | @Parameter(property = "scmpublish.dryRun") 115 | private boolean dryRun; 116 | 117 | /** 118 | * Set this to {@code true} to skip site deployment. 119 | * 120 | * @deprecated Please use {@link #skipDeployment}. 121 | */ 122 | @Deprecated 123 | @Parameter(defaultValue = "false") 124 | private boolean skipDeployement; 125 | 126 | /** 127 | * Set this to {@code true} to skip site deployment. 128 | */ 129 | @Parameter(property = "scmpublish.skipDeploy", alias = "maven.site.deploy.skip", defaultValue = "false") 130 | private boolean skipDeployment; 131 | 132 | /** 133 | * Only executes local SCM add and delete commands, but leave the actual checkin for the user to run manually. 134 | */ 135 | @Parameter(property = "scmpublish.skipCheckin") 136 | private boolean skipCheckin; 137 | 138 | /** 139 | * Push changes to the upstream remote repository during commit (only affects distributed SCMs like Git). 140 | * @since 3.4.0 141 | */ 142 | @Parameter(property = "scmpublish.pushChanges", defaultValue = "true") 143 | private boolean pushChanges; 144 | 145 | /** 146 | * SCM log/checkin comment for this publication. 147 | */ 148 | @Parameter(property = "scmpublish.checkinComment", defaultValue = "Site checkin for project ${project.name}") 149 | private String checkinComment; 150 | 151 | /** 152 | * List of SCM provider implementations. 153 | * Key is the provider type, eg. cvs. 154 | * Value is the provider implementation (the role-hint of the provider), eg. cvs or 155 | * cvs_native. 156 | * @see ScmManager.setScmProviderImplementation 157 | */ 158 | @Parameter 159 | private Map providerImplementations; 160 | 161 | /** 162 | * The server id specified in the {@code settings.xml}, which should be used for the authentication. 163 | * @see Settings Reference 164 | */ 165 | @Parameter(property = "scmpublish.serverId", defaultValue = "${project.distributionManagement.site.id}") 166 | private String serverId; 167 | 168 | /** 169 | * The SCM username to use. 170 | * This value takes precedence over the username derived from {@link #serverId}. 171 | * @see #serverId 172 | */ 173 | @Parameter(property = "username") 174 | protected String username; 175 | 176 | /** 177 | * The SCM password to use. 178 | * This value takes precedence over the password derived from {@link #serverId}. 179 | * @see #serverId 180 | */ 181 | @Parameter(property = "password") 182 | protected String password; 183 | 184 | /** 185 | * Use a local checkout instead of doing a checkout from the upstream repository. 186 | * WARNING: This will only work with distributed SCMs which support the file:// protocol. 187 | * TODO: we should think about having the defaults for the various SCM providers provided via Modello! 188 | */ 189 | @Parameter(property = "localCheckout", defaultValue = "false") 190 | protected boolean localCheckout; 191 | 192 | /** 193 | * The outputEncoding parameter of the site plugin. This plugin will corrupt your site 194 | * if this does not match the value used by the site plugin. 195 | */ 196 | @Parameter(property = "outputEncoding", defaultValue = "${project.reporting.outputEncoding}") 197 | protected String siteOutputEncoding; 198 | 199 | /** 200 | * If set to {@code true} does not delete files in the SCM that are not in the site. 201 | */ 202 | @Parameter(property = "scmpublish.skipDeletedFiles", defaultValue = "false") 203 | protected boolean skipDeletedFiles; 204 | 205 | /** 206 | * Add each directory in a separated SCM command: this can be necessary if SCM does not support 207 | * adding subdirectories in one command. 208 | */ 209 | @Parameter(defaultValue = "false") 210 | protected boolean addUniqueDirectory; 211 | 212 | /** 213 | */ 214 | @Parameter(defaultValue = "${basedir}", readonly = true) 215 | protected File basedir; 216 | 217 | /** 218 | */ 219 | @Parameter(defaultValue = "${settings}", readonly = true, required = true) 220 | protected Settings settings; 221 | 222 | /** 223 | * Collections of path patterns specifying files/directories which should never be deleted by this goal. 224 | * Each pattern is either 225 | *

    226 | *
  • an Ant pattern (when surrounded by {@code %ant[} and {@code ]} or not starting with {@code %regex[}), or
  • 227 | *
  • a full regex pattern when surrounded by {@code %regex[} and {@code ]}.
  • 228 | *
229 | * Files/directories with a matching path will be skipped when deleting files from the SCM. 230 | *

231 | * If your site has subdirectories or individual files published by an other mechanism/build you should leverage this parameter. 232 | * @see Ant Patterns 233 | * @see org.codehaus.plexus.util.MatchPatterns 234 | * @see #skipDeletedFiles 235 | */ 236 | @Parameter 237 | protected String[] ignorePathsToDelete; 238 | 239 | /** 240 | * SCM branch to use. For using with GitHub Pages, 241 | * you conventionally use gh-pages. 242 | */ 243 | @Parameter(property = "scmpublish.scm.branch") 244 | protected String scmBranch; 245 | 246 | /** 247 | * Configure svn automatic remote url creation. 248 | */ 249 | @Parameter(property = "scmpublish.automaticRemotePathCreation", defaultValue = "true") 250 | protected boolean automaticRemotePathCreation; 251 | 252 | /** 253 | * File name extensions of files where line ending normalization should be applied. 254 | * @see #extraNormalizeExtensions 255 | */ 256 | private static final String[] NORMALIZE_EXTENSIONS = {"html", "css", "js"}; 257 | 258 | /** 259 | * Additional file name extensions of files where line ending normalization should be applied (will be added to the default list containing 260 | * html,css and js) 261 | */ 262 | @Parameter 263 | protected String[] extraNormalizeExtensions; 264 | 265 | private Set normalizeExtensions; 266 | 267 | protected ScmProvider scmProvider; 268 | 269 | protected ScmRepository scmRepository; 270 | 271 | /** 272 | * The SCM manager. 273 | */ 274 | private final ScmManager scmManager; 275 | 276 | /** 277 | * Tool that gets a configured SCM repository from release configuration. 278 | */ 279 | protected final ScmRepositoryConfigurator scmRepositoryConfigurator; 280 | 281 | protected AbstractScmPublishMojo(ScmManager scmManager, ScmRepositoryConfigurator scmRepositoryConfigurator) { 282 | this.scmManager = scmManager; 283 | this.scmRepositoryConfigurator = scmRepositoryConfigurator; 284 | } 285 | 286 | protected void logInfo(String format, Object... params) { 287 | getLog().info(String.format(format, params)); 288 | } 289 | 290 | protected void logWarn(String format, Object... params) { 291 | getLog().warn(String.format(format, params)); 292 | } 293 | 294 | protected void logError(String format, Object... params) { 295 | getLog().error(String.format(format, params)); 296 | } 297 | 298 | private File relativize(File base, File file) { 299 | return new File(base.toURI().relativize(file.toURI()).getPath()); 300 | } 301 | 302 | protected boolean requireNormalizeNewlines(File f) throws IOException { 303 | if (normalizeExtensions == null) { 304 | normalizeExtensions = new HashSet<>(Arrays.asList(NORMALIZE_EXTENSIONS)); 305 | if (extraNormalizeExtensions != null) { 306 | normalizeExtensions.addAll(Arrays.asList(extraNormalizeExtensions)); 307 | } 308 | } 309 | 310 | return FilenameUtils.isExtension(f.getName(), normalizeExtensions); 311 | } 312 | 313 | private void setupScm() throws ScmRepositoryException, NoSuchScmProviderException { 314 | String scmUrl; 315 | if (localCheckout) { 316 | // in the release phase we have to change the checkout URL 317 | // to do a local checkout instead of going over the network. 318 | 319 | String provider = ScmUrlUtils.getProvider(pubScmUrl); 320 | String delimiter = ScmUrlUtils.getDelimiter(pubScmUrl); 321 | 322 | String providerPart = "scm:" + provider + delimiter; 323 | 324 | // X TODO: also check the information from releaseDescriptor.getScmRelativePathProjectDirectory() 325 | // X TODO: in case our toplevel git directory has no pom. 326 | // X TODO: fix pathname once I understand this. 327 | scmUrl = providerPart + "file://" + "target/localCheckout"; 328 | logInfo("Performing a LOCAL checkout from " + scmUrl); 329 | } 330 | 331 | ReleaseDescriptorBuilder descriptorBuilder = new ReleaseDescriptorBuilder(); 332 | descriptorBuilder.setInteractive(settings.isInteractiveMode()); 333 | 334 | descriptorBuilder.setScmPassword(password); 335 | descriptorBuilder.setScmUsername(username); 336 | // used for lookup of credentials from settings.xml in DefaultScmRepositoryConfigurator 337 | descriptorBuilder.setScmId(serverId); 338 | descriptorBuilder.setWorkingDirectory(basedir.getAbsolutePath()); 339 | descriptorBuilder.setLocalCheckout(localCheckout); 340 | descriptorBuilder.setScmSourceUrl(pubScmUrl); 341 | descriptorBuilder.setPushChanges(pushChanges); 342 | if (providerImplementations != null) { 343 | for (Map.Entry providerEntry : providerImplementations.entrySet()) { 344 | logInfo( 345 | "Changing the default '%s' provider implementation to '%s'.", 346 | providerEntry.getKey(), providerEntry.getValue()); 347 | scmManager.setScmProviderImplementation(providerEntry.getKey(), providerEntry.getValue()); 348 | } 349 | } 350 | 351 | ReleaseDescriptor releaseDescriptor = descriptorBuilder.build(); 352 | scmRepository = scmRepositoryConfigurator.getConfiguredRepository(releaseDescriptor, settings); 353 | // set pushChanges afterwards due to https://issues.apache.org/jira/browse/MRELEASE-1160 354 | scmRepository.getProviderRepository().setPushChanges(pushChanges); 355 | scmProvider = scmRepositoryConfigurator.getRepositoryProvider(scmRepository); 356 | } 357 | 358 | protected void checkoutExisting() throws MojoExecutionException { 359 | 360 | if (scmProvider instanceof AbstractSvnScmProvider) { 361 | checkCreateRemoteSvnPath(); 362 | } 363 | 364 | logInfo( 365 | MessageUtils.buffer().strong("%s") + " the pub tree from " 366 | + MessageUtils.buffer().strong("%s") + " into %s", 367 | (tryUpdate ? "Updating" : "Checking out"), 368 | pubScmUrl, 369 | checkoutDirectory); 370 | 371 | if (checkoutDirectory.exists() && !tryUpdate) { 372 | 373 | try { 374 | FileUtils.deleteDirectory(checkoutDirectory); 375 | } catch (IOException e) { 376 | logError(e.getMessage()); 377 | 378 | throw new MojoExecutionException("Unable to remove old checkout directory: " + e.getMessage(), e); 379 | } 380 | } 381 | 382 | boolean forceCheckout = false; 383 | 384 | if (!checkoutDirectory.exists()) { 385 | 386 | if (tryUpdate) { 387 | logInfo("TryUpdate is configured but no local copy currently available: forcing checkout."); 388 | } 389 | checkoutDirectory.mkdirs(); 390 | forceCheckout = true; 391 | } 392 | 393 | try { 394 | // only the baseDir is evaluated during update/checkout 395 | ScmFileSet fileSet = new ScmFileSet(checkoutDirectory, null, null); 396 | 397 | ScmBranch branch = (scmBranch == null) ? null : new ScmBranch(scmBranch); 398 | 399 | ScmResult scmResult = null; 400 | if (tryUpdate && !forceCheckout) { 401 | scmResult = scmProvider.update(scmRepository, fileSet, branch); 402 | } else { 403 | int attempt = 0; 404 | while (scmResult == null) { 405 | try { 406 | scmResult = scmProvider.checkOut(scmRepository, fileSet, branch); 407 | } catch (ScmException e) { 408 | // give it max 2 times to retry 409 | if (attempt++ < 2) { 410 | try { 411 | // wait 3 seconds 412 | Thread.sleep(3 * 1000); 413 | } catch (InterruptedException ie) { 414 | // noop 415 | } 416 | } else { 417 | throw e; 418 | } 419 | } 420 | } 421 | } 422 | checkScmResult(scmResult, "check out from SCM"); 423 | } catch (ScmException | IOException e) { 424 | logError(e.getMessage()); 425 | 426 | throw new MojoExecutionException("An error occurred during the checkout process: " + e.getMessage(), e); 427 | } 428 | } 429 | 430 | private void checkCreateRemoteSvnPath() throws MojoExecutionException { 431 | getLog().debug("AbstractSvnScmProvider used, so we can check if remote url exists and eventually create it."); 432 | AbstractSvnScmProvider svnScmProvider = (AbstractSvnScmProvider) scmProvider; 433 | 434 | try { 435 | boolean remoteExists = svnScmProvider.remoteUrlExist(scmRepository.getProviderRepository(), null); 436 | 437 | if (remoteExists) { 438 | return; 439 | } 440 | } catch (ScmException e) { 441 | throw new MojoExecutionException(e.getMessage(), e); 442 | } 443 | 444 | String remoteUrl = ((SvnScmProviderRepository) scmRepository.getProviderRepository()).getUrl(); 445 | 446 | if (!automaticRemotePathCreation) { 447 | // olamy: return ?? that will fail during checkout IMHO :-) 448 | logWarn("Remote svn url %s does not exist and automatic remote path creation disabled.", remoteUrl); 449 | return; 450 | } 451 | 452 | logInfo("Remote svn url %s does not exist: creating.", remoteUrl); 453 | 454 | File baseDir = null; 455 | try { 456 | 457 | // create a temporary directory for svnexec 458 | baseDir = Files.createTempDirectory("scm").toFile(); 459 | 460 | // to prevent fileSet cannot be empty 461 | ScmFileSet scmFileSet = new ScmFileSet(baseDir, new File("")); 462 | 463 | CommandParameters commandParameters = new CommandParameters(); 464 | commandParameters.setString(CommandParameter.SCM_MKDIR_CREATE_IN_LOCAL, Boolean.FALSE.toString()); 465 | commandParameters.setString(CommandParameter.MESSAGE, "Automatic svn path creation: " + remoteUrl); 466 | svnScmProvider.mkdir(scmRepository.getProviderRepository(), scmFileSet, commandParameters); 467 | 468 | // new remote url so force checkout! 469 | if (checkoutDirectory.exists()) { 470 | FileUtils.deleteDirectory(checkoutDirectory); 471 | } 472 | } catch (IOException | ScmException e) { 473 | throw new MojoExecutionException(e.getMessage(), e); 474 | } finally { 475 | if (baseDir != null) { 476 | try { 477 | FileUtils.forceDeleteOnExit(baseDir); 478 | } catch (IOException e) { 479 | throw new MojoExecutionException(e.getMessage(), e); 480 | } 481 | } 482 | } 483 | } 484 | 485 | public void execute() throws MojoExecutionException, MojoFailureException { 486 | if (skipDeployment || skipDeployement) { 487 | getLog().info("scmpublish.skipDeploy = true: Skipping site deployment"); 488 | return; 489 | } 490 | 491 | // setup the scm plugin with help from release plugin utilities 492 | try { 493 | setupScm(); 494 | } catch (ScmRepositoryException | NoSuchScmProviderException e) { 495 | throw new MojoExecutionException(e.getMessage(), e); 496 | } 497 | 498 | boolean tmpCheckout = false; 499 | 500 | if (checkoutDirectory.getPath().contains("${project.")) { 501 | try { 502 | tmpCheckout = true; 503 | checkoutDirectory = Files.createTempDirectory("maven-scm-publish" + ".checkout") 504 | .toFile(); 505 | } catch (IOException ioe) { 506 | throw new MojoExecutionException(ioe.getMessage(), ioe); 507 | } 508 | } 509 | 510 | try { 511 | scmPublishExecute(); 512 | } finally { 513 | if (tmpCheckout) { 514 | FileUtils.deleteQuietly(checkoutDirectory); 515 | } 516 | } 517 | } 518 | 519 | /** 520 | * Check-in content from scm checkout. 521 | * 522 | * @throws MojoExecutionException in case of issue 523 | */ 524 | protected void checkinFiles() throws MojoExecutionException { 525 | if (skipCheckin) { 526 | return; 527 | } 528 | 529 | ScmFileSet updatedFileSet = new ScmFileSet(checkoutDirectory); 530 | try { 531 | long start = System.currentTimeMillis(); 532 | 533 | CheckInScmResult checkinResult = checkScmResult( 534 | scmProvider.checkIn(scmRepository, updatedFileSet, new ScmBranch(scmBranch), checkinComment), 535 | "check-in files to SCM"); 536 | 537 | logInfo( 538 | "Checked in %d file(s) to revision %s in %s", 539 | checkinResult.getCheckedInFiles().size(), 540 | checkinResult.getScmRevision(), 541 | DurationFormatUtils.formatPeriod(start, System.currentTimeMillis(), "H' h 'm' m 's' s'")); 542 | } catch (ScmException e) { 543 | throw new MojoExecutionException("Failed to perform SCM checkin", e); 544 | } 545 | } 546 | 547 | protected void deleteFiles(Collection deleted) throws MojoExecutionException { 548 | if (skipDeletedFiles) { 549 | logInfo("Deleting files is skipped."); 550 | return; 551 | } 552 | List deletedList = new ArrayList<>(); 553 | for (File f : deleted) { 554 | deletedList.add(relativize(checkoutDirectory, f)); 555 | } 556 | ScmFileSet deletedFileSet = new ScmFileSet(checkoutDirectory, deletedList); 557 | try { 558 | getLog().info("Deleting files: " + deletedList); 559 | 560 | checkScmResult( 561 | scmProvider.remove(scmRepository, deletedFileSet, "Deleting obsolete site files."), 562 | "delete files from SCM"); 563 | } catch (ScmException e) { 564 | throw new MojoExecutionException("Failed to delete removed files to SCM", e); 565 | } 566 | } 567 | 568 | /** 569 | * Add files to scm. 570 | * 571 | * @param added files to be added 572 | * @throws MojoFailureException in case of issue 573 | * @throws MojoExecutionException in case of issue 574 | */ 575 | protected void addFiles(Collection added) throws MojoFailureException, MojoExecutionException { 576 | List addedList = new ArrayList<>(); 577 | Set createdDirs = new HashSet<>(); 578 | Set dirsToAdd = new TreeSet<>(); 579 | 580 | createdDirs.add(relativize(checkoutDirectory, checkoutDirectory)); 581 | 582 | for (File f : added) { 583 | for (File dir = f.getParentFile(); !dir.equals(checkoutDirectory); dir = dir.getParentFile()) { 584 | File relativized = relativize(checkoutDirectory, dir); 585 | // we do the best we can with the directories 586 | if (createdDirs.add(relativized)) { 587 | dirsToAdd.add(relativized); 588 | } else { 589 | break; 590 | } 591 | } 592 | addedList.add(relativize(checkoutDirectory, f)); 593 | } 594 | 595 | if (addUniqueDirectory) { // add one directory at a time 596 | for (File relativized : dirsToAdd) { 597 | try { 598 | ScmFileSet fileSet = new ScmFileSet(checkoutDirectory, relativized); 599 | getLog().info("scm add directory: " + relativized); 600 | AddScmResult addDirResult = scmProvider.add(scmRepository, fileSet, "Adding directory"); 601 | if (!addDirResult.isSuccess()) { 602 | getLog().warn(" Error adding directory " + relativized + ": " 603 | + addDirResult.getCommandOutput()); 604 | } 605 | } catch (ScmException e) { 606 | // 607 | } 608 | } 609 | } else { // add all directories in one command 610 | try { 611 | List dirs = new ArrayList<>(dirsToAdd); 612 | ScmFileSet fileSet = new ScmFileSet(checkoutDirectory, dirs); 613 | getLog().info("scm add directories: " + dirs); 614 | AddScmResult addDirResult = scmProvider.add(scmRepository, fileSet, "Adding directories"); 615 | if (!addDirResult.isSuccess()) { 616 | getLog().warn(" Error adding directories " + dirs + ": " + addDirResult.getCommandOutput()); 617 | } 618 | } catch (ScmException e) { 619 | // 620 | } 621 | } 622 | 623 | // remove directories already added ! 624 | addedList.removeAll(dirsToAdd); 625 | 626 | ScmFileSet addedFileSet = new ScmFileSet(checkoutDirectory, addedList); 627 | getLog().info("scm add files: " + addedList); 628 | try { 629 | CommandParameters commandParameters = new CommandParameters(); 630 | commandParameters.setString(CommandParameter.MESSAGE, "Adding new site files."); 631 | commandParameters.setString(CommandParameter.FORCE_ADD, Boolean.TRUE.toString()); 632 | checkScmResult(scmProvider.add(scmRepository, addedFileSet, commandParameters), "add new files to SCM"); 633 | } catch (ScmException e) { 634 | throw new MojoExecutionException("Failed to add new files to SCM", e); 635 | } 636 | } 637 | 638 | private T checkScmResult(T result, String failure) throws MojoExecutionException { 639 | if (!result.isSuccess()) { 640 | String msg = "Failed to " + failure + ": " + result.getProviderMessage() + " " + result.getCommandOutput(); 641 | logError(msg); 642 | throw new MojoExecutionException(msg); 643 | } 644 | return result; 645 | } 646 | 647 | public boolean isDryRun() { 648 | return dryRun; 649 | } 650 | 651 | public abstract void scmPublishExecute() throws MojoExecutionException, MojoFailureException; 652 | 653 | public void setPubScmUrl(String pubScmUrl) { 654 | // Fix required for Windows, which fit other OS as well 655 | if (pubScmUrl.startsWith("scm:svn:")) { 656 | pubScmUrl = pubScmUrl.replaceFirst("file:/[/]*", "file:///"); 657 | } 658 | 659 | this.pubScmUrl = pubScmUrl; 660 | } 661 | } 662 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/scmpublish/ScmPublishPublishScmMojo.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.scmpublish; 20 | 21 | import javax.inject.Inject; 22 | 23 | import java.io.BufferedReader; 24 | import java.io.File; 25 | import java.io.IOException; 26 | import java.io.InputStreamReader; 27 | import java.io.OutputStreamWriter; 28 | import java.io.PrintWriter; 29 | import java.nio.file.Files; 30 | import java.nio.file.LinkOption; 31 | import java.nio.file.StandardCopyOption; 32 | import java.util.ArrayList; 33 | import java.util.Arrays; 34 | import java.util.Collections; 35 | import java.util.Date; 36 | import java.util.HashSet; 37 | import java.util.List; 38 | import java.util.Set; 39 | 40 | import org.apache.commons.io.FileUtils; 41 | import org.apache.commons.io.filefilter.NameFileFilter; 42 | import org.apache.commons.io.filefilter.NotFileFilter; 43 | import org.apache.maven.plugin.MojoExecutionException; 44 | import org.apache.maven.plugin.MojoFailureException; 45 | import org.apache.maven.plugins.annotations.Mojo; 46 | import org.apache.maven.plugins.annotations.Parameter; 47 | import org.apache.maven.project.MavenProject; 48 | import org.apache.maven.scm.manager.ScmManager; 49 | import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; 50 | import org.apache.maven.shared.utils.logging.MessageUtils; 51 | import org.codehaus.plexus.util.MatchPatterns; 52 | 53 | /** 54 | * Publish content to an SCM (source code management) repository (like Git). By default, content is taken from default site staging directory 55 | * ${project.build.directory}/staging. 56 | * Can also be used without a Maven project, so usable to update any SCM with any content. 57 | * @see Maven SCM 58 | */ 59 | @Mojo(name = "publish-scm", aggregator = true, requiresProject = false) 60 | public class ScmPublishPublishScmMojo extends AbstractScmPublishMojo { 61 | /** 62 | * The path of the directory containing the content to be published. 63 | * The is published recursively (i.e. including subdirectories). 64 | */ 65 | @Parameter(property = "scmpublish.content", defaultValue = "${project.build.directory}/staging") 66 | private File content; 67 | 68 | @Parameter(defaultValue = "${project}", readonly = true, required = true) 69 | protected MavenProject project; 70 | 71 | private List deleted = new ArrayList<>(); 72 | 73 | private List added = new ArrayList<>(); 74 | 75 | private List updated = new ArrayList<>(); 76 | 77 | private int directories = 0; 78 | private int files = 0; 79 | private long size = 0; 80 | 81 | @Inject 82 | public ScmPublishPublishScmMojo(ScmManager scmManager, ScmRepositoryConfigurator scmRepositoryConfigurator) { 83 | super(scmManager, scmRepositoryConfigurator); 84 | } 85 | 86 | /** 87 | * Update SCM checkout directory with content. 88 | * 89 | * @param checkout the scm checkout directory 90 | * @param dir the content to put in scm (can be null) 91 | * @param doNotDeleteDirs directory names that should not be deleted from scm even if not in new content: 92 | * used for modules, which content is available only when staging 93 | * @throws IOException 94 | */ 95 | private void update(File checkout, File dir, List doNotDeleteDirs) throws IOException { 96 | String scmSpecificFilename = scmProvider.getScmSpecificFilename(); 97 | String[] files = scmSpecificFilename != null 98 | ? checkout.list(new NotFileFilter(new NameFileFilter(scmSpecificFilename))) 99 | : checkout.list(); 100 | 101 | Set checkoutContent = new HashSet<>(Arrays.asList(files)); 102 | List dirContent = (dir != null) ? Arrays.asList(dir.list()) : Collections.emptyList(); 103 | 104 | Set deleted = new HashSet<>(checkoutContent); 105 | deleted.removeAll(dirContent); 106 | 107 | MatchPatterns ignoreDeleteMatchPatterns = null; 108 | List pathsAsList = new ArrayList<>(0); 109 | if (ignorePathsToDelete != null && ignorePathsToDelete.length > 0) { 110 | ignoreDeleteMatchPatterns = MatchPatterns.from(ignorePathsToDelete); 111 | pathsAsList = Arrays.asList(ignorePathsToDelete); 112 | } 113 | 114 | for (String name : deleted) { 115 | if (ignoreDeleteMatchPatterns != null && ignoreDeleteMatchPatterns.matches(name, true)) { 116 | getLog().debug(name + " match one of the patterns '" + pathsAsList + "': do not add to deleted files"); 117 | continue; 118 | } 119 | getLog().debug("file marked for deletion: " + name); 120 | File file = new File(checkout, name); 121 | 122 | if ((doNotDeleteDirs != null) && file.isDirectory() && (doNotDeleteDirs.contains(name))) { 123 | // ignore directory not available 124 | continue; 125 | } 126 | 127 | if (file.isDirectory()) { 128 | update(file, null, null); 129 | } 130 | this.deleted.add(file); 131 | } 132 | 133 | for (String name : dirContent) { 134 | File file = new File(checkout, name); 135 | File source = new File(dir, name); 136 | 137 | if (Files.isSymbolicLink(source.toPath())) { 138 | if (!checkoutContent.contains(name)) { 139 | this.added.add(file); 140 | } 141 | 142 | // copy symbolic link (Java 7 only) 143 | copySymLink(source, file); 144 | } else if (source.isDirectory()) { 145 | directories++; 146 | if (!checkoutContent.contains(name)) { 147 | this.added.add(file); 148 | file.mkdir(); 149 | } 150 | 151 | update(file, source, null); 152 | } else { 153 | if (checkoutContent.contains(name)) { 154 | this.updated.add(file); 155 | } else { 156 | this.added.add(file); 157 | } 158 | 159 | copyFile(source, file); 160 | } 161 | } 162 | } 163 | 164 | /** 165 | * Copy a symbolic link. 166 | * 167 | * @param srcFile the source file (expected to be a symbolic link) 168 | * @param destFile the destination file (which will be a symbolic link) 169 | * @throws IOException 170 | */ 171 | private void copySymLink(File srcFile, File destFile) throws IOException { 172 | Files.copy( 173 | srcFile.toPath(), 174 | destFile.toPath(), 175 | StandardCopyOption.REPLACE_EXISTING, 176 | StandardCopyOption.COPY_ATTRIBUTES, 177 | LinkOption.NOFOLLOW_LINKS); 178 | } 179 | 180 | /** 181 | * Copy a file content, normalizing newlines when necessary. 182 | * 183 | * @param srcFile the source file 184 | * @param destFile the destination file 185 | * @throws IOException 186 | * @see #requireNormalizeNewlines(File) 187 | */ 188 | private void copyFile(File srcFile, File destFile) throws IOException { 189 | if (requireNormalizeNewlines(srcFile)) { 190 | copyAndNormalizeNewlines(srcFile, destFile); 191 | } else { 192 | FileUtils.copyFile(srcFile, destFile); 193 | } 194 | files++; 195 | size += destFile.length(); 196 | } 197 | 198 | /** 199 | * Copy and normalize newlines. 200 | * 201 | * @param srcFile the source file 202 | * @param destFile the destination file 203 | * @throws IOException 204 | */ 205 | private void copyAndNormalizeNewlines(File srcFile, File destFile) throws IOException { 206 | try (BufferedReader in = new BufferedReader( 207 | new InputStreamReader(Files.newInputStream(srcFile.toPath()), siteOutputEncoding)); 208 | PrintWriter out = new PrintWriter( 209 | new OutputStreamWriter(Files.newOutputStream(destFile.toPath()), siteOutputEncoding))) { 210 | for (String line = in.readLine(); line != null; line = in.readLine()) { 211 | if (in.ready()) { 212 | out.println(line); 213 | } else { 214 | out.print(line); 215 | } 216 | } 217 | } 218 | } 219 | 220 | public void scmPublishExecute() throws MojoExecutionException, MojoFailureException { 221 | if (siteOutputEncoding == null) { 222 | getLog().warn("No output encoding, defaulting to UTF-8."); 223 | siteOutputEncoding = "utf-8"; 224 | } 225 | 226 | if (!content.exists()) { 227 | throw new MojoExecutionException("Configured content directory does not exist: " + content); 228 | } 229 | 230 | if (!content.canRead()) { 231 | throw new MojoExecutionException("Can't read content directory: " + content); 232 | } 233 | 234 | checkoutExisting(); 235 | 236 | final File updateDirectory; 237 | if (subDirectory == null) { 238 | updateDirectory = checkoutDirectory; 239 | } else { 240 | updateDirectory = new File(checkoutDirectory, subDirectory); 241 | 242 | // Security check for subDirectory with .. inside 243 | if (!updateDirectory 244 | .toPath() 245 | .normalize() 246 | .startsWith(checkoutDirectory.toPath().normalize())) { 247 | logError("Try to acces outside of the checkout directory with sub-directory: %s", subDirectory); 248 | return; 249 | } 250 | 251 | if (!updateDirectory.exists()) { 252 | updateDirectory.mkdirs(); 253 | } 254 | 255 | logInfo("Will copy content in sub-directory: %s", subDirectory); 256 | } 257 | 258 | try { 259 | logInfo("Updating checkout directory with actual content in %s", content); 260 | update( 261 | updateDirectory, 262 | content, 263 | (project == null) ? null : project.getModel().getModules()); 264 | String displaySize = FileUtils.byteCountToDisplaySize(size); 265 | logInfo( 266 | "Content consists of " + MessageUtils.buffer().strong("%d directories and %d files = %s"), 267 | directories, 268 | files, 269 | displaySize); 270 | } catch (IOException ioe) { 271 | throw new MojoExecutionException("Could not copy content to SCM checkout", ioe); 272 | } 273 | 274 | logInfo( 275 | "Publishing content to SCM will result in " 276 | + MessageUtils.buffer().strong("%d addition(s), %d update(s), %d delete(s)"), 277 | added.size(), 278 | updated.size(), 279 | deleted.size()); 280 | 281 | if (isDryRun()) { 282 | int pos = checkoutDirectory.getAbsolutePath().length() + 1; 283 | for (File addedFile : added) { 284 | logInfo("- addition %s", addedFile.getAbsolutePath().substring(pos)); 285 | } 286 | for (File updatedFile : updated) { 287 | logInfo("- update %s", updatedFile.getAbsolutePath().substring(pos)); 288 | } 289 | for (File deletedFile : deleted) { 290 | logInfo("- delete %s", deletedFile.getAbsolutePath().substring(pos)); 291 | } 292 | return; 293 | } 294 | 295 | if (!added.isEmpty()) { 296 | addFiles(added); 297 | } 298 | 299 | if (!deleted.isEmpty()) { 300 | deleteFiles(deleted); 301 | } 302 | 303 | logInfo("Checking in SCM, starting at " + new Date() + "..."); 304 | checkinFiles(); 305 | } 306 | } 307 | -------------------------------------------------------------------------------- /src/site/apt/examples/importing-maven-site.apt: -------------------------------------------------------------------------------- 1 | ------ 2 | Importing maven.apache.org Content to Svn 3 | ------ 4 | Hervé Boutemy 5 | ------ 6 | 2012-08-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 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Importing maven.apache.org Content to Svn 30 | 31 | This plugin has been created to enable conversion of Maven components documentation 32 | to Apache CMS, based on svnpubsub: see {{{http://www.apache.org/dev/cms.html}documentation}}. 33 | 34 | Once new content can be published with the plugin, existing content needs to be imported. 35 | 36 | A little shell script has been used to import a component with all its versions independently of 37 | any site generation phase or components' pom.xml: 38 | 39 | +-------- 40 | # configuration 41 | ORIG_PATH=/www/maven.apache.org 42 | DEST_SVN_BASE=https://svn.apache.org/repos/infra/websites/production/maven/content 43 | 44 | ARTIFACT=maven-clean-plugin 45 | DIR=plugins/${ARTIFACT} 46 | VERSIONS="2.3 2.4 2.4.1 2.5" 47 | 48 | 49 | # initialize ${DIR}-LATEST entry in svn 50 | svn -m "prepare ${ARTIFACT} documentation publication" mkdir ${DEST_SVN_BASE}/${DIR}-LATEST 51 | 52 | # publish existing content for each version in ${VERSIONS} 53 | for VERSION in ${VERSIONS} 54 | do 55 | 56 | echo " ========== ${ARTIFACT} ${VERSION} ==========" 57 | mvn -e scm-publish:publish-scm \ 58 | -Dscmpublish.content=${ORIG_PATH}/${DIR}-${VERSION} \ 59 | -Dscmpublish.pubScmUrl=scm:svn:${DEST_SVN_BASE}/${DIR}-LATEST \ 60 | -Dscmpublish.checkinComment="published documentation for ${ARTIFACT} version ${VERSION}" \ 61 | && \ 62 | svn cp ${DEST_SVN_BASE}/${DIR}-LATEST ${DEST_SVN_BASE}/${DIR}-${VERSION} -m "releasing ${ARTIFACT} ${VERSION} documentation" 63 | 64 | done 65 | +-------- 66 | -------------------------------------------------------------------------------- /src/site/apt/examples/multi-module-configuration.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Maven Multi Module Configuration 3 | ------ 4 | Olivier Lamy 5 | Hervé Boutemy 6 | ------ 7 | 2012-12-06 8 | ------ 9 | 10 | ~~ Licensed to the Apache Software Foundation (ASF) under one 11 | ~~ or more contributor license agreements. See the NOTICE file 12 | ~~ distributed with this work for additional information 13 | ~~ regarding copyright ownership. The ASF licenses this file 14 | ~~ to you under the Apache License, Version 2.0 (the 15 | ~~ "License"); you may not use this file except in compliance 16 | ~~ with the License. You may obtain a copy of the License at 17 | ~~ 18 | ~~ http://www.apache.org/licenses/LICENSE-2.0 19 | ~~ 20 | ~~ Unless required by applicable law or agreed to in writing, 21 | ~~ software distributed under the License is distributed on an 22 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 23 | ~~ KIND, either express or implied. See the License for the 24 | ~~ specific language governing permissions and limitations 25 | ~~ under the License. 26 | 27 | ~~ NOTE: For help with the syntax of this file, see: 28 | ~~ http://maven.apache.org/doxia/references/apt-format.html 29 | 30 | Maven Multi Module Configuration 31 | 32 | With a multi modules build, you cannot simply use <<>>: you must stage your site first. 33 | 34 | Cli commands to use: 35 | 36 | +------------+ 37 | mvn -Preporting site site:stage 38 | mvn scm-publish:publish-scm 39 | +------------+ 40 | 41 | These commands work well with mono-module too, even if mono-module could permit some optimizations (everything can be run 42 | in only one Maven invocation). 43 | 44 | * Avoiding Extra Path During Staging 45 | 46 | When staging the site, sometimes extra directories may appear between <<>> and the effective root of the site: 47 | this is caused by the auto-detection algorithm of site root, which cannot detect at which level to stop. 48 | 49 | This can be fixed by configuring the {{{/plugins/maven-site-plugin/stage-mojo.html#topSiteURL}site plugin's topSiteURL parameter}} 50 | (added in version 3.3) with top distribution management site url in a parent pom: 51 | 52 | +-----+ 53 | 54 | 55 | site 56 | scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/bimargulies/site-test 57 | 58 | 59 | 60 | 61 | 62 | 63 | org.apache.maven.plugins 64 | maven-site-plugin 65 | 66 | scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/bimargulies/site-test 67 | 68 | 69 | 70 | 71 | 72 | +-----+ 73 | -------------------------------------------------------------------------------- /src/site/apt/examples/one-module-configuration.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Maven Mono Module Configuration 3 | ------ 4 | Olivier Lamy 5 | Hervé Boutemy 6 | ------ 7 | 2012-12-05 8 | ------ 9 | 10 | ~~ Licensed to the Apache Software Foundation (ASF) under one 11 | ~~ or more contributor license agreements. See the NOTICE file 12 | ~~ distributed with this work for additional information 13 | ~~ regarding copyright ownership. The ASF licenses this file 14 | ~~ to you under the Apache License, Version 2.0 (the 15 | ~~ "License"); you may not use this file except in compliance 16 | ~~ with the License. You may obtain a copy of the License at 17 | ~~ 18 | ~~ http://www.apache.org/licenses/LICENSE-2.0 19 | ~~ 20 | ~~ Unless required by applicable law or agreed to in writing, 21 | ~~ software distributed under the License is distributed on an 22 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 23 | ~~ KIND, either express or implied. See the License for the 24 | ~~ specific language governing permissions and limitations 25 | ~~ under the License. 26 | 27 | ~~ NOTE: For help with the syntax of this file, see: 28 | ~~ http://maven.apache.org/doxia/references/apt-format.html 29 | 30 | Maven Mono Module Configuration 31 | 32 | <> 33 | 34 | With following configuration you can simply run: <<>> 35 | 36 | +----------------------- 37 | 38 | org.apache.maven.plugins 39 | maven-site-plugin 40 | 41 | true 42 | 43 | 44 | 45 | org.apache.maven.plugins 46 | maven-scm-publish-plugin 47 | ${project.version} 48 | 49 | \${project.reporting.outputDirectory} 50 | 51 | 52 | 53 | scm-publish 54 | site-deploy 55 | 56 | publish-scm 57 | 58 | 59 | 60 | 61 | +----------------------- 62 | -------------------------------------------------------------------------------- /src/site/apt/index.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Introduction 3 | ------ 4 | Benson Margulies 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 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | ${project.name} 30 | 31 | The maven-scm-publish-plugin is a utility plugin to allow publishing Maven 32 | website to any supported SCM (Source Code Management) repository (like Git). 33 | The primary goal was to have an utility plugin to allow Apache projects 34 | to publish Maven websites via the {{{https://infra.apache.org/project-site.html#tools}ASF svnpubsub system}}. 35 | 36 | In addition to SCM operations, it takes care to fix newline inconsistencies 37 | generated by <<>> (see {{{https://issues.apache.org/jira/browse/MSITE-121}MSITE-121}}), 38 | which prevents simple content import to SCM. 39 | 40 | The plugin has been tested with Git SCM too and by example can 41 | {{{./various-tips.html#Git_branch}push content for GitHub Pages}}. 42 | 43 | 44 | * Implementation 45 | 46 | The plugin works from <> by default (see {{{./publish-scm-mojo.html#content}<<>> parameter}}). 47 | 48 | It first checks out the contents of a directory from 49 | the SCM (see {{{./publish-scm-mojo.html#pubScmUrl}<<>> parameter}}) into 50 | <<>> by default (see {{{./publish-scm-mojo.html#checkoutDirectory}<<>> parameter}}). 51 | 52 | Then locally staged content is applied to the check-out, issuing 53 | appropriate SCM commands to add and delete entries, followed by a 54 | check-in. 55 | 56 | The <> parameter to the plugin avoids all 57 | SCM operations, and simply logs out the added, deleted, 58 | and changed files. 59 | 60 | The <> parameter omits the final checkin. 61 | This allows you to visit <<>>, and validate 62 | its contents before submitting to the SCM. 63 | 64 | * Publishing any content to SCM 65 | 66 | Even without any <<>>/Maven project, you can update SCM content with 67 | a local content: 68 | 69 | +-------+ 70 | mvn scm-publish:publish-scm -Dscmpublish.pubScmUrl=scm:... -Dscmpublish.content=...path-to-content... 71 | +-------+ 72 | 73 | SCM content will be checked-out to a temporary directory, then local content will 74 | be applied to the check-out, before it is checked-in back. 75 | 76 | See {{{./examples/importing-maven-site.html}maven.apache.org content import script}} for an 77 | example. 78 | 79 | <> 80 | 81 | * Known Limitations 82 | 83 | There are 2 known limitations: 84 | 85 | * for Subversion, the plugin can create the initial SCM directory if it does not exist. But for Git by example, if you use a branch, 86 | the branch won't be created: you have to {{{./various-tips.html#Git_branch}create it manually}}, 87 | 88 | * the plugin works well for multi-module websites publishing to a complete directory: 89 | you just need to publish <<>> content. But if one module does not publish 90 | its content to the same directory (like Surefire or Enforcer, which have a 91 | base directory and one plugin in <<>>), this staging area can't be simply imported. 92 | 93 | [] 94 | 95 | * Future Dreams 96 | 97 | Ideally, scm urls would be supported in <<<\>>> section of the POM, then 98 | publishing would simply be <<>>, without any problems for non-flat multi-modules 99 | sites. 100 | 101 | To reach such a dream, there are some steps: 102 | 103 | * fix inconsistent newlines generated by <<>> (caused by <<>> template and 104 | resources taken from skin jar without fixing newlines): {{{https://issues.apache.org/jira/browse/MSITE-121}MSITE-121}} 105 | is fixed in maven-site-plugin 3.4, 106 | 107 | * improve {{{/wagon/wagon-providers/wagon-scm/}<<>>}} to put a whole directory content 108 | in one commit, and not with one commit per file. 109 | 110 | [] 111 | 112 | Then this plugin would be outdated, replaced by natural <<>> goal. 113 | -------------------------------------------------------------------------------- /src/site/apt/usage.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Usage 3 | ------ 4 | Benson Margulies 5 | ------ 6 | 2012-02-25 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | 30 | Usage 31 | 32 | The maven-scm-publish-plugin submits modified content to SCM, sites being the most classical case. 33 | 34 | The standard use for sites is: 35 | 36 | +-----------+ 37 | mvn -Preporting site site:stage 38 | mvn scm-publish:publish-scm 39 | +-----------+ 40 | 41 | which will work both for multi-and mono-modules sites. 42 | -------------------------------------------------------------------------------- /src/site/apt/various-tips.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Various Tips 3 | ------ 4 | Olivier Lamy 5 | ------ 6 | 2012-09-04 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Various tips for using this plugin 30 | 31 | * URL format 32 | 33 | You must use a scm url format: 34 | 35 | +----------------+ 36 | scm: 37 | +----------------+ 38 | 39 | Example for svn: <<>> 40 | 41 | And configure is as it: 42 | 43 | +----------------+ 44 | 45 | 46 | site_id 47 | scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/plugins/maven-scm-publish-plugin/ 48 | 49 | 50 | +----------------+ 51 | 52 | <>: with svn, if the remote url doesn't exist, it will be created. 53 | 54 | * Git branch 55 | 56 | To use Git branch (for example: {{{https://help.github.com/articles/user-organization-and-project-pages/}GitHub <<>>}}) 57 | 58 | +----------------+ 59 | 60 | 61 | site_id 62 | ${project.scm.developerConnection} 63 | 64 | 65 | ... 66 | 67 | org.apache.maven.plugins 68 | maven-scm-publish-plugin 69 | ${project.version} 70 | 71 | gh-pages 72 | 73 | 74 | +----------------+ 75 | 76 | <>, as a Git orphan branch: 77 | 78 | 1. <<>> to create the branch locally, 79 | 80 | 2. <<>> to clean the branch content and let it empy, 81 | 82 | 3. copy an initial site content, 83 | 84 | 4. commit and push: <<>>, <<>>, <<>> 85 | 86 | [] 87 | 88 | * Improving SCM Checkout Performance 89 | 90 | By default, a complete checkout is done. You can configure the plugin to try update rather than a full checkout/clone 91 | 92 | +----------------+ 93 | 94 | org.apache.maven.plugins 95 | maven-scm-publish-plugin 96 | ${project.version} 97 | 98 | true 99 | 100 | 101 | +----------------+ 102 | 103 | By default, the scm content is checked-out/cloned to <<<$\{project.build.directory}/scmpublish-checkout>>>, so when running <<>>, 104 | all the content is deleted. You can configure a path to your machine to avoid full checkout. 105 | A recommended way is to use a property with a default value that your colleague will be able to override in their settings. 106 | 107 | +----------------+ 108 | 109 | ... 110 | 111 | ${user.home} 112 | \${siteMainDirectory}/my-site-content-scm 113 | ... 114 | 115 | 116 | 117 | org.apache.maven.plugins 118 | maven-scm-publish-plugin 119 | ${project.version} 120 | 121 | ${scmPubCheckoutDirectory} 122 | true 123 | 124 | 125 | +----------------+ 126 | -------------------------------------------------------------------------------- /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 | 23 | ${project.scm.url} 24 | 25 | 26 |

27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/site/xdoc/download.xml.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | Download ${project.name} Source 25 | 26 | 27 |
28 | 29 |

${project.name} ${project.version} is distributed in source format. Use a source archive if you intend to build 30 | ${project.name} yourself. Otherwise, simply use the ready-made binary artifacts from central repository.

31 | 32 |

You will be prompted for a mirror - if the file is not found on yours, please be patient, as it may take 24 33 | hours to reach all mirrors.

34 | 35 |

In order to guard against corrupted downloads/installations, it is highly recommended to 36 | verify the signature 37 | of the release bundles against the public KEYS used by the Apache Maven 38 | developers.

39 | 40 |

${project.name} is distributed under the Apache License, version 2.0.

41 | 42 |

We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.

43 | 44 | 45 | 46 | 47 |

48 | [if-any logo] 49 | 50 | logo 52 | 53 | [end] 54 | The currently selected mirror is 55 | [preferred]. 56 | If you encounter a problem with this mirror, 57 | please select another mirror. 58 | If all mirrors are failing, there are 59 | backup 60 | mirrors 61 | (at the end of the mirrors list) that should be available. 62 |

63 | 64 |
65 | Other mirrors: 66 | 83 | 84 |
85 | 86 |

87 | You may also consult the 88 | complete list of 89 | mirrors. 90 |

91 | 92 | 93 | 94 | 95 | 96 |

This is the current stable version of ${project.name}.

97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 |
LinkChecksumSignature
${project.name} ${project.version} (Source zip)maven/plugins/${project.artifactId}-${project.version}-source-release.zipmaven/plugins/${project.artifactId}-${project.version}-source-release.zip.sha512maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc
116 |
117 | 118 | 119 | 120 |

Older non-recommended releases can be found on our archive site.

121 | 122 |
123 |
124 | 125 |
126 | 127 | --------------------------------------------------------------------------------