--- /dev/null
+#!/bin/bash
+
+# Copyright © 2019 Red Hat, Inc. and others.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+
+# Find modules using JSR 305
+for module in $(git grep -lf ${0%/*}/jsr305.txt |
+ awk -F/ '{ for (i = NF; i > 0; i--) { if ($i == "src") { NF = i - 1; print; next } } }' OFS="/" |
+ sort -u); do
+ # If they don't already pull in jsr305...
+ if ! grep -q jsr305 ${module}/pom.xml; then
+ # ... add the dependency
+ xmlstarlet ed -P -L -N mvn=http://maven.apache.org/POM/4.0.0 \
+ -s /mvn:project/mvn:dependencies -t elem -n dependencyTMP -v "" \
+ -s //dependencyTMP -t elem -n groupId -v "com.google.code.findbugs" \
+ -s //dependencyTMP -t elem -n artifactId -v "jsr305" \
+ -s //dependencyTMP -t elem -n optional -v "true" \
+ -r //dependencyTMP -v dependency \
+ ${module}/pom.xml
+ fi
+done
--- /dev/null
+javax.annotation.CheckForNull
+javax.annotation.CheckForSigned
+javax.annotation.CheckReturnValue
+javax.annotation.concurrent.GuardedBy
+javax.annotation.concurrent.Immutable
+javax.annotation.concurrent.NotThreadSafe
+javax.annotation.concurrent.ThreadSafe
+javax.annotation.Detainted
+javax.annotation.MatchesPattern
+javax.annotation.meta.Exclusive
+javax.annotation.meta.Exhaustive
+javax.annotation.meta.TypeQualifier
+javax.annotation.meta.TypeQualifierDefault
+javax.annotation.meta.TypeQualifierNickname
+javax.annotation.meta.TypeQualifierValidator
+javax.annotation.meta.When
+javax.annotation.Nonnegative
+javax.annotation.Nonnull
+javax.annotation.Nullable
+javax.annotation.OverridingMethodsMustInvokeSuper
+javax.annotation.ParametersAreNonnullByDefault
+javax.annotation.ParametersAreNullableByDefault
+javax.annotation.PropertyKey
+javax.annotation.RegEx
+javax.annotation.Signed
+javax.annotation.Syntax
+javax.annotation.Tainted
+javax.annotation.Untainted
+javax.annotation.WillClose
+javax.annotation.WillCloseWhenClosed
+javax.annotation.WillNotClose