Gehel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381403 )
Change subject: project creation ...................................................................... project creation Change-Id: I17c1998e682d028bd7290c9b5c638c1bfcbfd040 --- A .gitignore A .gitreview A .mvn/wrapper/maven-wrapper.jar A .mvn/wrapper/maven-wrapper.properties A mvnw A mvnw.cmd A pom.xml A src/assembly/intellij-config.xml A src/editors/intellij/IntelliJ IDEA Global Settings A src/editors/intellij/codestyles/Default.xml A src/editors/intellij/installed.txt A src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/checkstyle.xml A src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/suppressions.xml A src/main/resources/org/wikimedia/discovery/build/tools/forbidden/all-signatures.txt A src/main/resources/org/wikimedia/discovery/build/tools/forbidden/core-signatures.txt A src/main/resources/org/wikimedia/discovery/build/tools/forbidden/test-signatures.txt A src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml 17 files changed, 1,107 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/discovery-maven-tool-configs refs/changes/03/381403/1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0ad5930 --- /dev/null +++ b/.gitignore @@ -0,0 +1,142 @@ +# Created by .ignore support plugin (hsz.mobi) +### Maven template +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + +# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) +!/.mvn/wrapper/maven-wrapper.jar +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +.idea +*.iml + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +### Eclipse template + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..019ea33 --- /dev/null +++ b/.gitreview @@ -0,0 +1,5 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=wikimedia/discovery/discovery-maven-tool-configs.git +defaultbranch=master diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100755 index 0000000..41c70a7 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.jar Binary files differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100755 index 0000000..56bb016 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip \ No newline at end of file diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..e96ccd5 --- /dev/null +++ b/mvnw @@ -0,0 +1,227 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100755 index 0000000..48c810e --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,143 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2b10a59 --- /dev/null +++ b/pom.xml @@ -0,0 +1,333 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.wikimedia.discovery</groupId> + <artifactId>discovery-maven-tool-configs</artifactId> + <version>1.0-SNAPSHOT</version> + + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + <distribution>repo</distribution> + </license> + </licenses> + + <developers> + <developer> + <id>gehel</id> + <name>Guillaume Lederrey</name> + <email>guillaume.leder...@wikimedia.org</email> + <timezone>Europe/Zurich</timezone> + </developer> + </developers> + + <scm> + <connection>scm:git:https://gerrit.wikimedia.org/r/discovery/discovery-maven-tool-configs</connection> + <developerConnection>scm:git:https://gerrit.wikimedia.org/r/discovery/discovery-maven-tool-configs</developerConnection> + <url>https://gerrit.wikimedia.org/r/#/admin/projects/discovery/discovery-maven-tool-configs</url> + </scm> + + <issueManagement> + <system>Phabricator</system> + <url>https://phabricator.wikimedia.org/</url> + </issueManagement> + + <distributionManagement> + <snapshotRepository> + <id>ossrh</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + </snapshotRepository> + <site> + <id>discovery-parent-pom.site</id> + <name>Discovery documentation</name> + <!-- dummy URL for the site, just to make mvn site:stage happy --> + <url>https://test.net/</url> + </site> + </distributionManagement> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>com.github.ekryd.sortpom</groupId> + <artifactId>sortpom-maven-plugin</artifactId> + <version>2.8.0</version> + <configuration> + <predefinedSortOrder>recommended_2008_06</predefinedSortOrder> + <sortDependencies>scope,groupId,artifactId</sortDependencies> + <sortPlugins>groupId,artifactId</sortPlugins> + <lineSeparator>\n</lineSeparator> + <encoding>${project.build.sourceEncoding}</encoding> + <sortProperties>true</sortProperties> + <keepBlankLines>true</keepBlankLines> + <nrOfIndentSpace>4</nrOfIndentSpace> + <verifyFail>Stop</verifyFail> + </configuration> + <executions> + <execution> + <goals> + <goal>verify</goal> + </goals> + <phase>verify</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.17</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.6.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.4.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.20.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>1.6</version> + <executions> + <execution> + <id>sign-artifacts</id> + <goals> + <goal>sign</goal> + </goals> + <phase>verify</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>2.5.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.10.4</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-release-plugin</artifactId> + <version>2.5.3</version> + <configuration> + <releaseProfiles>release</releaseProfiles> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>3.6</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>3.0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.20</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.6.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jdepend-maven-plugin</artifactId> + <version>2.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>versions-maven-plugin</artifactId> + <version>2.4</version> + </plugin> + <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> + </configuration> + </plugin> + <plugin> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> + <version>2.2.3</version> + <configuration> + <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat> + <generateGitPropertiesFile>true</generateGitPropertiesFile> + <generateGitPropertiesFilename>target/classes/git.properties</generateGitPropertiesFilename> + </configuration> + <executions> + <execution> + <goals> + <goal>revision</goal> + </goals> + <phase>generate-resources</phase> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <groupId>com.github.ekryd.sortpom</groupId> + <artifactId>sortpom-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor>src/assembly/intellij-config.xml</descriptor> + </descriptors> + </configuration> + <executions> + <execution> + <id>intellij-config-assembly</id> + <goals> + <goal>single</goal> + </goals> + <phase>package</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>2.7</version> + <reportSets> + <reportSet> + <reports> + <report>index</report> + <report>dependencies</report> + <report>dependency-convergence</report> + <report>dependency-info</report> + <report>dependency-management</report> + <report>distribution-management</report> + <report>help</report> + <report>project-team</report> + <report>plugin-management</report> + <report>plugins</report> + <report>license</report> + <report>scm</report> + <report>modules</report> + <report>summary</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>versions-maven-plugin</artifactId> + <reportSets> + <reportSet> + <reports> + <report>dependency-updates-report</report> + <report>plugin-updates-report</report> + <report>property-updates-report</report> + </reports> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> + + <profiles> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-source</id> + <goals> + <goal>jar-no-fork</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> \ No newline at end of file diff --git a/src/assembly/intellij-config.xml b/src/assembly/intellij-config.xml new file mode 100644 index 0000000..6fea253 --- /dev/null +++ b/src/assembly/intellij-config.xml @@ -0,0 +1,16 @@ +<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> + <id>intellij-config</id> + <formats> + <format>jar</format> + </formats> + <baseDirectory>/</baseDirectory> + <fileSets> + <fileSet> + <directory>${basedir}/src/editors/intellij/</directory> + <outputDirectory>/</outputDirectory> + <useDefaultExcludes>true</useDefaultExcludes> + </fileSet> + </fileSets> +</assembly> diff --git a/src/editors/intellij/IntelliJ IDEA Global Settings b/src/editors/intellij/IntelliJ IDEA Global Settings new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/editors/intellij/IntelliJ IDEA Global Settings diff --git a/src/editors/intellij/codestyles/Default.xml b/src/editors/intellij/codestyles/Default.xml new file mode 100644 index 0000000..fdacb85 --- /dev/null +++ b/src/editors/intellij/codestyles/Default.xml @@ -0,0 +1,22 @@ +<code_scheme name="Default"> + <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" /> + <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" /> + <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> + <value /> + </option> + <option name="IMPORT_LAYOUT_TABLE"> + <value> + <package name="" withSubpackages="true" static="true" /> + <emptyLine /> + <package name="java" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="javax" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="org" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="com" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="" withSubpackages="true" static="false" /> + </value> + </option> +</code_scheme> diff --git a/src/editors/intellij/installed.txt b/src/editors/intellij/installed.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/editors/intellij/installed.txt diff --git a/src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/checkstyle.xml b/src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/checkstyle.xml new file mode 100644 index 0000000..193240f --- /dev/null +++ b/src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/checkstyle.xml @@ -0,0 +1,119 @@ +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> +<module name="Checker"> + <module name="SuppressWarningsFilter" /> + <module name="TreeWalker"> + <module name="SuppressWarningsHolder" /> + + <!-- Javadoc --> + <module name="JavadocType"> + <property name="allowMissingParamTags" value="true" /> <!-- Sometimes its just overkill --> + <property name="excludeScope" value="private" /> + </module> + <module name="JavadocMethod"> + <property name="allowUndeclaredRTE" value="true" /> <!-- You aren't supposed to declare these anyway... --> + <property name="allowMissingReturnTag" value="true" /> <!-- Sometimes its just overkill --> + <property name="allowMissingParamTags" value="true" /> <!-- Sometimes its just overkill --> + <property name="allowMissingThrowsTags" value="true" /> <!-- Sometimes its just overkill --> + <property name="allowMissingPropertyJavadoc" value="true" /> <!-- Sometimes its just overkill --> + <property name="tokens" value="METHOD_DEF" /> <!-- Constructors don't always need Javadoc --> + <property name="excludeScope" value="private" /> + </module> + <module name="JavadocStyle" /> + + <!-- Formatting --> + <module name="Indentation"> + <property name="basicOffset" value="4" /> + <property name="caseIndent" value="0" /> + </module> + <module name="LineLength"> + <property name="max" value="160" /> + </module> + <module name="MethodParamPad" /> + <module name="NoWhitespaceAfter" /> + <module name="NoWhitespaceBefore" /> + <module name="ParenPad" /> + <module name="TypecastParenPad"> + <property name="option" value="nospace" /> + </module> + <module name="WhitespaceAfter"> + <property name="tokens" value="COMMA, SEMI" /> <!-- not typecasts --> + </module> + <module name="WhitespaceAround"> + <property name="allowEmptyConstructors" value="true"/> + <property name="allowEmptyMethods" value="true"/> + <property name="allowEmptyTypes" value="true"/> + <property name="allowEmptyLoops" value="true"/> + <property name="allowEmptyLambdas" value="true"/> + <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/> + </module> + <module name="ModifierOrder" /> + <module name="RedundantModifier" /> + <module name="EmptyBlock"> + <!-- Put a comment in it if you need one explaining why --> + <property name="option" value="text" /> + </module> + <module name="LeftCurly" /> + <module name="RightCurly" /> + <module name="AvoidNestedBlocks"> + <property name="allowInSwitchCase" value="true" /> + </module> + <module name="EmptyStatement" /> + <module name="UpperEll" /> <!-- Lowercase l is hard to read --> + <module name="ArrayTypeStyle" /> + + <!-- Import --> + <module name="AvoidStarImport" /> + <module name="IllegalImport" /> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + <module name="ImportOrder"> + <property name="option" value="top"/> + <property name="groups" value="/^java\./,javax,org,com,"/> + <property name="ordered" value="false"/> + <property name="caseSensitive" value="false"/> + <property name="separated" value="true"/> + <property name="sortStaticImportsAlphabetically" value="true"/> + </module> + + <!-- Common coding problems/opinionates stuff --> + <module name="CovariantEquals" /> + <module name="EqualsHashCode" /> + <module name="InnerAssignment" /> <!-- Too suprising --> + <module name="MissingSwitchDefault" /> <!-- Just comment that its a noop if its a noop --> + <module name="ModifiedControlVariable" /> + <module name="SimplifyBooleanExpression" /> + <module name="SimplifyBooleanReturn" /> + <module name="StringLiteralEquality" /> + <module name="SuperClone" /> + <module name="SuperFinalize" /> + <module name="IllegalCatch" /> + <module name="IllegalThrows" /> + <module name="ExplicitInitialization" /> <!-- May as well let Java do what its going to do --> + <module name="DefaultComesLast" /> + <module name="FallThrough" /> + <module name="MultipleVariableDeclarations" /> + <module name="FinalClass" /> + <module name="HideUtilityClassConstructor" /> + <!-- This one usually offers good to interesting suggestions but its too much work to implement now. <module name="DesignForExtension"/> --> + <module name="MutableException" /> + <module name="UncommentedMain" /> + + <!-- Really opinionated. Probably wrong. --> + <module name="ClassFanOutComplexity"> + <property name="id" value="checkstyle:classfanoutcomplexity"/> + <property name="max" value="25"/> + </module> + <module name="CyclomaticComplexity" /> + <module name="NPathComplexity" /> + + </module> + + <!-- More formatting stuff that can't be in TreeWalker --> + <module name="NewlineAtEndOfFile" /> + <module name="RegexpSingleline"> + <property name="format" value="\s+$" /> + <property name="message" value="Line has trailing spaces." /> + </module> + +</module> diff --git a/src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/suppressions.xml b/src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/suppressions.xml new file mode 100644 index 0000000..664e38d --- /dev/null +++ b/src/main/resources/org/wikimedia/discovery/build/tools/checkstyle/suppressions.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2014 Wikimedia Foundation 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. --> +<!DOCTYPE suppressions PUBLIC + "-//Puppy Crawl//DTD Suppressions 1.1//EN" + "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> + +<suppressions> + <!-- Tests don't need anywhere near that Javadoc that production code does. --> + <suppress checks="JavadocType" files=".*Test.java" /> + <suppress checks="JavadocMethod" files=".*Test.java" /> + <suppress checks="JavadocVariable" files=".*Test.java" /> +</suppressions> diff --git a/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/all-signatures.txt b/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/all-signatures.txt new file mode 100644 index 0000000..4ef7050 --- /dev/null +++ b/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/all-signatures.txt @@ -0,0 +1,4 @@ +#Almost Elasticsearch's configuration. We use this here because we have access to everything in Elasticsearch so we should play by its rules. +@defaultMessage Convert to URI +java.net.URL#getPath() +java.net.URL#getFile() diff --git a/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/core-signatures.txt b/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/core-signatures.txt new file mode 100644 index 0000000..b338efa --- /dev/null +++ b/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/core-signatures.txt @@ -0,0 +1,43 @@ +@defaultMessage spawns threads with vague names; use a custom thread factory and name threads so that you can tell (by its name) which executor it is associated with + +java.util.concurrent.Executors#newFixedThreadPool(int) +java.util.concurrent.Executors#newSingleThreadExecutor() +java.util.concurrent.Executors#newCachedThreadPool() +java.util.concurrent.Executors#newSingleThreadScheduledExecutor() +java.util.concurrent.Executors#newScheduledThreadPool(int) +java.util.concurrent.Executors#defaultThreadFactory() +java.util.concurrent.Executors#privilegedThreadFactory() + +java.lang.Character#codePointBefore(char[],int) @ Implicit start offset is error-prone when the char[] is a buffer and the first chars are random chars +java.lang.Character#codePointAt(char[],int) @ Implicit end offset is error-prone when the char[] is a buffer and the last chars are random chars + +@defaultMessage Collections.sort dumps data into an array, sorts the array and reinserts data into the list, one should rather use Lucene's CollectionUtil sort methods which sort in place + +java.util.Collections#sort(java.util.List) +java.util.Collections#sort(java.util.List,java.util.Comparator) + +java.io.StringReader#<init>(java.lang.String) @ Use FastStringReader instead + +@defaultMessage Only use wait / notify when really needed try to use concurrency primitives, latches or callbacks instead. +java.lang.Object#wait() +java.lang.Object#wait(long) +java.lang.Object#wait(long,int) +java.lang.Object#notify() +java.lang.Object#notifyAll() + +@defaultMessage Beware of the behavior of this method on MIN_VALUE +java.lang.Math#abs(int) +java.lang.Math#abs(long) + +@defaultMessage Please do not try to stop the world +java.lang.System#gc() + +@defaultMessage Use Channels.* methods to write to channels. Do not write directly. +java.nio.channels.WritableByteChannel#write(java.nio.ByteBuffer) +java.nio.channels.FileChannel#write(java.nio.ByteBuffer, long) +java.nio.channels.GatheringByteChannel#write(java.nio.ByteBuffer[], int, int) +java.nio.channels.GatheringByteChannel#write(java.nio.ByteBuffer[]) +java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer) +java.nio.channels.ScatteringByteChannel#read(java.nio.ByteBuffer[]) +java.nio.channels.ScatteringByteChannel#read(java.nio.ByteBuffer[], int, int) +java.nio.channels.FileChannel#read(java.nio.ByteBuffer, long) diff --git a/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/test-signatures.txt b/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/test-signatures.txt new file mode 100644 index 0000000..2534ea8 --- /dev/null +++ b/src/main/resources/org/wikimedia/discovery/build/tools/forbidden/test-signatures.txt @@ -0,0 +1 @@ +#Almost Elasticsearch's configuration. We use this here because we have access to everything in Elasticsearch so we should play by its rules. diff --git a/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml b/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml new file mode 100644 index 0000000..3039b90 --- /dev/null +++ b/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<FindBugsFilter> + <!-- the following bugs are always ignored --> + <Match> + <!-- + Manually sizing collections is error prone and in most cases tend + to be a micro optimization. + --> + <Bug pattern="PSC_PRESIZE_COLLECTIONS"/> + </Match> + + <Match> + <!-- Softening exception is an acceptable pattern in this project. --> + <Or> + <Bug pattern="EXS_EXCEPTION_SOFTENING_HAS_CHECKED"/> + <Bug pattern="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS"/> + </Or> + </Match> + + <Match> + <!-- + Inverting comparison order when String literals are involved leads + to unnatural code. Proper null checking should always be done + anyway. + --> + <Bug pattern="LSC_LITERAL_STRING_COMPARISON"/> + </Match> + + <!-- specific exceptions --> + <Match classregex="org\.wikimedia\.search\.extra\.regex\.SourceRegexQueryBuilder.*"> + <!-- In this case, an array is accessed with known locations in array --> + <Bug pattern="CLI_CONSTANT_LIST_INDEX"/> + </Match> + +</FindBugsFilter> \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/381403 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17c1998e682d028bd7290c9b5c638c1bfcbfd040 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/discovery-maven-tool-configs Gerrit-Branch: master Gerrit-Owner: Gehel <guillaume.leder...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits