Skip to content

Commit

Permalink
Add Maven Wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Feb 9, 2024
1 parent f0a6b14 commit 19c0577
Show file tree
Hide file tree
Showing 10 changed files with 548 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mvnw.cmd binary
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ jobs:
cache: 'maven'
- name: 'Install'
shell: bash
run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
run: ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- name: 'Test'
shell: bash
run: mvn test -B
run: ./mvnw test -B

publish_snapshot:
name: 'Publish snapshot'
Expand All @@ -94,4 +94,4 @@ jobs:
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
run: mvn -pl '!eclipse_plugin' source:jar deploy -B -DskipTests=true -Dinvoker.skip=true -Dmaven.javadoc.skip=true
run: ./mvn -pl '!eclipse_plugin' source:jar deploy -B -DskipTests=true -Dinvoker.skip=true -Dmaven.javadoc.skip=true
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:

- name: Bump Version Number
run: |
mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}"
mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" -pl eclipse_plugin
mvn tycho-versions:update-eclipse-metadata -pl eclipse_plugin
./mvnw --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}"
./mvnw --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" -pl eclipse_plugin
./mvnw tycho-versions:update-eclipse-metadata -pl eclipse_plugin
git ls-files | grep -E '(pom.xml|MANIFEST.MF)$' | xargs git add
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
Expand All @@ -47,11 +47,11 @@ jobs:
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run:
mvn --no-transfer-progress -pl '!eclipse_plugin' -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
./mvnw --no-transfer-progress -pl '!eclipse_plugin' -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"

- name: Build Eclipse plugin
run:
mvn --no-transfer-progress -pl 'eclipse_plugin' verify gpg:sign -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
./mvnw --no-transfer-progress -pl 'eclipse_plugin' verify gpg:sign -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"

- name: Push tag
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ target/
bin/
out/
eclipse_plugin/lib/

.mvn/wrapper/maven-wrapper.jar
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Your starting point should be the instance methods of
## Building from source

```
mvn install
./mvnw install
```

## Contributing
Expand Down
6 changes: 3 additions & 3 deletions eclipse_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ See https://github.com/google/google-java-format#eclipse

### Prerequisites

Before building the plugin, make sure to run `mvn
Before building the plugin, make sure to run `./mvnw
tycho-versions:update-eclipse-metadata` to update the bundle version in
`META-INF/MANIFEST.MF`.

### Building the Plugin

1) Run `mvn clean package` in the `eclipse_plugin` directory. This will first copy the dependencies
1) Run `./mvnw clean package` in the `eclipse_plugin` directory. This will first copy the dependencies
of the plugin to `eclipse_plugin/lib/` and then triggers the tycho build that uses these
dependencies (as declared in `build.properties`) for the actual Eclipse plugin build.<br><br>
If you also want to add the build artifact to the local maven repository, you can use
`mvn clean install -Dtycho.localArtifacts=ignore` instead. Note, however, that you then must use
`./mvnw clean install -Dtycho.localArtifacts=ignore` instead. Note, however, that you then must use
this build command for every build with that specific version number until you clear the build
artifact (or the
[p2-local-metadata.properties](https://wiki.eclipse.org/Tycho/Target_Platform#Locally_built_artifacts))
Expand Down
Loading

0 comments on commit 19c0577

Please sign in to comment.