Skip to content

Commit

Permalink
Move checkstyle configs to its own resources package.
Browse files Browse the repository at this point in the history
The checkstyle config can read from the resources of a package. It can't
read from the resources of the package it is included in, though (plus
you can't use a jar as a parent, anyway).

See: http://stackoverflow.com/a/19690484/101923
  • Loading branch information
tswast committed Nov 10, 2016
1 parent 264a358 commit 1e1f9be
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ language: java
jdk:
- oraclejdk7
- oraclejdk8
install: cd checkstyle-config && mvn clean install && cd ..
script: mvn clean verify && cd test && mvn clean verify
after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
147 changes: 147 additions & 0 deletions checkstyle-config/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<!--
Copyright 2016 Google Inc. All Rights Reserved.
Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.google.cloud.samples</groupId>
<artifactId>checkstyle-configuration</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<description>A common checkstyle configuration for Google Cloud samples.</description>
<url>https://github.com/GoogleCloudPlatform/java-repo-tools</url>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Les Vogel</name>
<email>lesv@google.com</email>
<organization>Google Inc.</organization>
<organizationUrl>https://cloud.google.com</organizationUrl>
</developer>
<developer>
<name>Tim Swast</name>
<email>swast@google.com</email>
<organization>Google Inc.</organization>
<organizationUrl>https://cloud.google.com</organizationUrl>
</developer>
</developers>

<scm>
<url>https://github.com/GoogleCloudPlatform/java-repo-tools</url>
<connection>scm:git:https://github.com/GoogleCloudPlatform/java-repo-tools.git</connection>
<developerConnection>scm:git:ssh://git@github.com/GoogleCloudPlatform/java-repo-tools.git</developerConnection>
<tag>v1.0.0</tag>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<prerequisites>
<maven>3.1.0</maven>
</prerequisites>

<profiles>
<!-- Code signing for release: http://stackoverflow.com/a/14869692/101923 -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<pluginManagement>
<plugins>
<!-- Plugins for release. See: http://central.sonatype.org/pages/apache-maven.html -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingProfileId>2145015f0f5c04</stagingProfileId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagBase>scm:git:ssh://git@github.com/GoogleCloudPlatform/java-repo-tools.git</tagBase>
<tagNameFormat>v@{project.version}</tagNameFormat>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- Release (not inherited) -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<inherited>false</inherited>
</plugin>
</plugins>
</build>
</project>

File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ limitations under the License.
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<suppressionsLocation>suppressions.xml</suppressionsLocation>
</configuration>
<dependencies>
<!-- Add a dependency to use bundled resources.
See: http://stackoverflow.com/a/19690484/101923 -->
<dependency>
<groupId>com.google.cloud.samples</groupId>
<artifactId>checkstyle-configuration</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<executions>
<execution><goals><goal>check</goal></goals></execution>
</executions>
Expand Down

0 comments on commit 1e1f9be

Please sign in to comment.