Merge branch 'pmd/5.4.x' into pmd/5.5.x

This commit is contained in:
Andreas Dangel
2017-02-25 20:31:17 +01:00
16 changed files with 451 additions and 268 deletions

View File

@ -1,20 +1,50 @@
sudo: false
addons:
apt:
packages:
- oracle-java8-installer
ssh_known_hosts:
- web.sourceforge.net
language: java
jdk: oraclejdk8
before_install:
- echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > "$HOME/.mavenrc"
- mkdir -p "$HOME/.m2"
- cp .travis-toolchains.xml "$HOME/.m2/toolchains.xml"
before_script:
- SHOULD_DEPLOY=no
- '[ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ] && SHOULD_DEPLOY=yes || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Deploy" )'
- export SHOULD_DEPLOY
- bash .travis/install-configure-maven.sh
- export M2_HOME=$HOME/apache-maven-3.3.9
- export PATH=$HOME/apache-maven-3.3.9/bin:${PATH}
- openssl aes-256-cbc -K $encrypted_5630fbebf057_key -iv $encrypted_5630fbebf057_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
- pushd .travis && tar xfv secrets.tar && popd
- mkdir -p "$HOME/.ssh"
- chmod 700 "$HOME/.ssh"
- mv .travis/id_rsa "$HOME/.ssh/id_rsa"
- chmod 600 "$HOME/.ssh/id_rsa"
- mkdir -p "$HOME/.gpg"
- gpg --batch --import .travis/release-signing-key-82DE7BE82166E84E.gpg
- rm .travis/secrets.tar
- rm .travis/release-signing-key-82DE7BE82166E84E.gpg
install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
before_script: true
script:
- '[ "${SHOULD_DEPLOY}" = "yes" ] && mvn test deploy --settings .travis-settings.xml || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Deploy" )'
- '[ "${SHOULD_DEPLOY}" = "yes" ] || mvn test'
- '[ "${SHOULD_DEPLOY}" = "yes" ] && mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Sonar" )'
branches:
except:
- /^pmd_releases\/\d/
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash .travis/build-pull-request.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ]; then bash .travis/build-push.sh; fi'
after_success: true
before_deploy: true
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file_glob: true
file:
- pmd-dist/target/pmd-*.zip
- target/pmd-doc-*.zip
# TODO : This won't copy the changelog to GitHub
skip_cleanup: true
on:
tags: true
repo: pmd/pmd
condition: "${TRAVIS_SECURE_ENV_VARS} = true"
after_deploy: bash .travis/release.sh
notifications:
email:
recipients:
@ -29,4 +59,33 @@ env:
- secure: KBEuB6U1p5RQXSYe157AwydFr/zpXQPA0IChVCgZV+X1mMyy9ZtrjH1J1AXuviseDDXDbaT25sRnsvpl82rfRw2xOkMGXHy4N95/ylTSr8DjHxTao71BhXsvFycNobFva5y2EGNWqDvpS8I2oSZo7Qk4la3yep3rcJQvcy6RDbbhpDTbL1QMFyadunIBm0WtqbunrMqtjSqaoPsXz8TiQuxHvX4vEXzVbaxV1QQt79Vi+daa6wAV3mRQAugnx+UffsC8JqMxgm06usWeJgCJzxgm8E7clZCLmf53B2TL8dK6bIYbqyvOY3uFxitsTG0d8Z0GOJwXBgZNgbniTRO8ZJSty5eZP8LBybbjVLSL25DNTWtCjADUL/uySnXIEidlMt2N/3QmH7zrGAfAk/tIwKpdRca2GLLydeXf6PSkiahnPEkIY/QupcsOLELhdifpdOjb8QW1OenA+vUbNM9dccLwKnX6Fj9cu4VQG601AcYDr2eyhq8WYkr3wYdw/6KdUa3hmplowTBs+qguppP+eOSgGuEsy38KLtqnvm6WlHy6tcLmcVYKG3DmR1b7TWXsOXC6/VMH8BHBkvsF1Qd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P3A+EBxmIlPibb1D6AZqVYzY4ZB9sJGMDcTwzfIYrNZOBI9v34t8qZxHMfUm3XweHGsDwmyc18PmHAgG8m/0rwlIjtVlmEm+fFrvVHRXP1Jz3aX0RmTvrhc9/koZvpqztylIsqy9rlSX2OxoksDx825QfkE+YfbqS/OmAgqtw55r4H385cQJS97Yzc3X2dA8BKfPus7ng+lRxL9sYxwqjvDJzOeBqhf62BircPeymlWc+Hc53gNirW2MG4vHY/zASvZDjg9Hr2sEUODY8u8i7EvfYfX+hNPXZNtWo8fHO5UviCbc16IMrADN497Y54cKvAtyD/2H3aFWg8ei96GpxOaL6W+l5gtlgNC1b9wPE3+pDloLc4TMbvvlSDPKGWgSgqv4haRJ81oIJK+KEvWhbX5Sn3l5QTM33/rn4KUEFqhGNpUxGrvCQOn5sO7A2wnk8JMlrcRZKBpk+wfEzeTEAqZ6Vt7pmceEpcs/NdJCsRjAOmlCdjLVHtrF9zGpBelAMzbIeKLMsTtR3PbpediWHkNwLaMCAEZPIPKeML6TXoPy/nlBpkK20rTbHRHhumFKACB3F3HCWm8v/SIU="
# Secure Keys, that need to be set for snapshot builds
#
# CI_DEPLOY_USERNAME - the user which can upload net.sourceforge.pmd:* to https://oss.sonatype.org/
# CI_DEPLOY_PASSWORD
#
# SONAR_TOKEN - the token used to update https://sonarqube.com/dashboard/?id=393826
#
# PMD_SF_USER - the sourceforge user, which is used to upload created binaries to sf files section. Note: an ssh key is
# required. See "before_install".
#
#
# Secure Keys, that need to be set for releases:
#
# PMD_SF_APIKEY - used to make the new release the default file in the files section. See https://sourceforge.net/auth/preferences/
# under "Release API Key"
#
# CI_SIGN_KEYNAME
# CI_SIGN_PASSPHRASE
# add the encrypted GPG keyring file to repo (https://docs.travis-ci.com/user/encrypting-files/#Automated-Encryption), decrypt it and install it at the beginning of .travis-deploy.sh
#
# GITHUB_OAUTH_TOKEN - the token used to upload the binaries to github releases
#

View File

@ -0,0 +1,3 @@
#!/bin/bash
set -ev
mvn verify -B -V

38
.travis/build-push.sh Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
set -ev
VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
echo "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
if [[ "$VERSION" != *-SNAPSHOT && "$TRAVIS_TAG" != "" ]]; then
mvn deploy -Possrh,pmd-release -B -V
else
mvn deploy -Possrh -B -V
fi
bash .travis/build-site.sh
# create pmd-doc archive
(
cd target
mv staging pmd-doc-${VERSION}
zip -qr pmd-doc-${VERSION}.zip pmd-doc-${VERSION}/
)
# Uploading pmd distribution to sourceforge
if [ "$TRAVIS_TAG" = "" ]; then
rsync -avh pmd-dist/target/pmd-*-${VERSION}.zip target/pmd-doc-${VERSION}.zip ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/
rsync -avh src/site/markdown/overview/changelog.md ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/ReadMe.md
fi
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
# Uploading snapshot site...
rsync -ah --stats --delete target/pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
fi
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
# only do a clean build for sonar, if we are executing a snapshot build, otherwise we can't reuse the build from above for the release
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} -B -V
fi

48
.travis/build-site.sh Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
set -ev
# Do not log the output, to avoid the travis log length limit of 4MB
# Solution from http://stackoverflow.com/questions/26082444/how-to-work-around-travis-cis-4mb-output-limit/26082445#26082445
export PING_SLEEP=30s
export BUILD_OUTPUT=/tmp/build-site.out
export PING_PID_FILE=/tmp/build-site-ping.pid
touch $BUILD_OUTPUT
dump_output() {
echo Tailing the last 500 lines of output:
tail -500 $BUILD_OUTPUT
}
kill_ping() {
if [ -e $PING_PID_FILE ]; then
PING_LOOP_PID=$(cat $PING_PID_FILE)
kill $PING_LOOP_PID
rm $PING_PID_FILE
fi
}
error_handler() {
kill_ping
echo ERROR: An error was encountered with the build.
dump_output
exit 1
}
# If an error occurs, run our error handler to output a tail of the build
trap 'error_handler' ERR
# Set up a repeating loop to send some output to Travis.
bash -c "while true; do echo \$(date) - building ...; sleep $PING_SLEEP; done" &
PING_LOOP_PID=$!
echo "$PING_LOOP_PID" > $PING_PID_FILE
# Run the build, redirect output into the file
mvn site site:stage -Psite -B -V >> $BUILD_OUTPUT 2>&1
# The build finished without returning an error so dump a tail of the output
dump_output
# nicely terminate the ping output loop
kill_ping

1
.travis/id_rsa.pub Normal file
View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8yHVLHYDsKui8tYg/sFvkDqcs97pEZz0BzK9HtBF4O+/It1drRYRdUAFfjoImfprpKSxkJCTglHixGRp24eNaZ6woWVJ4/bmiMkEqEZAjr1NZ3qw7zIruMJMSkCV+YTtmL4cYcZlvMRPzzOZOnFbV05oi79oy41MUFHYjolK9QxMFNsVNN5iyzFxM3HqSFozz+ylKbFBtDk6ZHZQNRL/Xl2V9DJ69fVzjG4OZfcWNGmmKHHARmsnJyUOMeeKpLjDOe1M6ZdI8HkXWac8yCr9JTETNZZwemZAcS/RKoKCDqfIUOzkZfIPmyaznfVetTGsMi7yQrJhAyjznuNGF4+3lfgTcmRF8wz5FCeUkdYTmy2wNSFi5HiLPfC5OgRtjKzC6yb8rbRjDx6XQ2ph15PKOaXwzk49TaMc0xJvoiGDMZaTU0iTm3Y1/QUtfLvo3/jGMbtUdV3soWpuBAV2JUI4aB5xdLX9iNmcrVzoUe3y9DWuuTX46eoCvpUNXv/DXKhQw1D7xd7J67db5qUck/Akiqi0JR+e0SoBJvZFtYwVNLGC2bIJ/s8SR8X5Zp+1+ypf3WYjIylxQTkO1r4NfI0Cd9qXg7nmUrHAU7Z6xtJmUK8ZWzSST4wul8WkRJURtODLxt5firtlKhyZ93t9Mjuk6mATIPxr/b3x20T+IH463kw== ssh key for pmd. used for travis accessing sourceforge and github.

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -ev
# remember the current directory
SOURCE_HOME=$PWD
cd $HOME
wget -q http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar zxf apache-maven-3.3.9-bin.tar.gz
chmod +x apache-maven-3.3.9/bin/mvn
echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > .mavenrc
mkdir -p .m2
cp $SOURCE_HOME/.travis/travis-toolchains.xml .m2/toolchains.xml
cp $SOURCE_HOME/.travis/travis-settings.xml .m2/settings.xml

54
.travis/release.sh Normal file
View File

@ -0,0 +1,54 @@
#!/bin/bash
set -ev
RELEASE_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
# Deploy to ossrh has already been done with the usual build. See build-push.sh
# The site has been built before, the files have already been uploaded to sourceforge.
# Since this is a release, making the binary the new default file...
curl -H "Accept: application/json" -X PUT -d "default=windows&default=mac&default=linux&default=bsd&default=solaris&default=others" \
-d "api_key=${PMD_SF_APIKEY}" https://sourceforge.net/projects/pmd/files/pmd/${RELEASE_VERSION}/pmd-bin-${RELEASE_VERSION}.zip
# Assumes, the release has already been created by travis github releases provider
RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" https://api.github.com/repos/pmd/pmd/releases/tags/pmd_releases/${RELEASE_VERSION}|jq ".id")
RELEASE_NAME="PMD ${RELEASE_VERSION} ($(date -u +%d-%B-%Y))"
RELEASE_BODY=$(cat src/site/markdown/overview/changelog.md)
RELEASE_BODY="${RELEASE_BODY//$'\\'/\\\\}"
RELEASE_BODY="${RELEASE_BODY//$'\r'/}"
RELEASE_BODY="${RELEASE_BODY//$'\n'/\\r\\n}"
RELEASE_BODY="${RELEASE_BODY//$'"'/\\$'"'}"
cat > release-edit-request.json <<EOF
{
"name": "$RELEASE_NAME",
"body": "$RELEASE_BODY"
}
EOF
echo "Updating release at https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID}..."
RESPONSE=$(curl -i -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" -H "Content-Type: application/json" --data-binary "@release-edit-request.json" -X PATCH https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID})
if [[ "$RESPONSE" != *"HTTP/1.1 200"* ]]; then
echo "$RESPONSE"
else
echo "Update OK"
fi
echo "Adding the site to pmd.github.io..."
# clone pmd.github.io. Note: This uses the ssh key setup earlier
git clone --depth 1 git@github.com:pmd/pmd.github.io.git
rsync -a target/pmd-doc-${RELEASE_VERSION}/ pmd.github.io/pmd-${RELEASE_VERSION}/
(
cd pmd.github.io
git config user.email "adangel@users.sourceforge.net"
git config user.name "Andreas Dangel (PMD Releases)"
git add pmd-${RELEASE_VERSION}
git commit -m "Added pmd-${RELEASE_VERSION}"
git rm -qr latest
cp -a pmd-${RELEASE_VERSION} latest
git add latest
git commit -m "Copying pmd-${RELEASE_VERSION} to latest"
git push origin
)

BIN
.travis/secrets.tar.enc Normal file

Binary file not shown.

View File

@ -9,13 +9,21 @@
<pluginGroups/>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<id>ossrh</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
<mirrors/>
<proxies/>
<profiles/>
<profiles>
<profile>
<id>ossrh</id>
<properties>
<gpg.keyname>${env.CI_SIGN_KEYNAME}</gpg.keyname>
<gpg.passphrase>${env.CI_SIGN_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles/>
</settings>
</settings>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<!-- place this file in ${user.home}/.m2/toolchains.xml -->
<!-- see: https://github.com/travis-ci/travis-cookbooks/blob/master/cookbooks/travis_java/templates/ubuntu/jdk_switcher.sh.erb -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.6</version>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-6-openjdk-amd64</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-7-openjdk-amd64</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-8-oracle</jdkHome>
</configuration>
</toolchain>
</toolchains>

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,7 @@ public class DBTypeTest {
@After
public void tearDown() throws Exception {
testProperties = null;
absoluteFile.delete();
}
/**

View File

@ -24,6 +24,9 @@
<exclude>**/.pmd</exclude>
<exclude>**/.ruleset</exclude>
<exclude>**/.git</exclude>
<exclude>**/.travis/secrets.tar</exclude>
<exclude>**/.travis/id_rsa</exclude>
<exclude>**/.travis/*.gpg</exclude>
</excludes>
<directoryMode>0755</directoryMode>
<fileMode>0644</fileMode>

View File

@ -156,7 +156,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* Test parsing of HTML <script> element.
* Test parsing of HTML &lt;script&gt; element.
*/
@Test
public void testHtmlScript() {
@ -167,7 +167,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* Test parsing of HTML <script src="x"/> element. It might not be valid html
* Test parsing of HTML &lt;script src="x"/&gt; element. It might not be valid html
* but it is likely to appear in .JSP files.
*/
@Test
@ -180,7 +180,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* Test parsing of HTML <script> element.
* Test parsing of HTML &lt;script&gt; element.
*/
@Test
public void testHtmlScriptWithAttribute() {
@ -206,7 +206,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* Test parsing of HTML <script> element.
* Test parsing of HTML &lt;script&gt; element.
*/
@Test
public void testInlineCss() {
@ -319,7 +319,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
/**
* A dangling unopened ( just </closed> ) tag should not influence the parsing.
* A dangling unopened ( just &lt;/closed&gt; ) tag should not influence the parsing.
*/
@Test
@Ignore // sadly the number of
@ -346,7 +346,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
/**
* Test parsing of HTML <script> element.
* Test parsing of HTML &lt;script&gt; element.
*/
@Test
public void textAfterOpenAndClosedTag() {
@ -418,7 +418,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* tests whether parse correctly detects presence of JSP expression <%= %>
* tests whether parse correctly detects presence of JSP expression &lt;%= %&gt;
* within an non-quoted attribute value
*/
@Test
@ -478,7 +478,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* tests whether parse does not fail in the presence of unclosed JSP expression <%=
* tests whether parse does not fail in the presence of unclosed JSP expression &lt;%=
* within an non-quoted attribute value
*/
@Test
@ -490,7 +490,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* test a no quote attribute value which contains a scriptlet <% %>
* test a no quote attribute value which contains a scriptlet &lt;% %&gt;
* within its value
*/
@Test
@ -504,7 +504,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* test a no quote attribute value can contain a tag (e.g. attr=<bean:write property="value" />)
* test a no quote attribute value can contain a tag (e.g. attr=&lt;bean:write property="value" /&gt;)
*
*/
@Test
@ -518,7 +518,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* test a quote attribute value can contain a tag (e.g. attr="<bean:write property="value" />" )
* test a quote attribute value can contain a tag (e.g. attr="&lt;bean:write property="value" /&gt;" )
* Not sure if it's legal JSP code but most JSP engine accept and properly treat
* this value at runtime
*/
@ -615,7 +615,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* <html> <a1> <a2/> <b/> </a1> </html>
* &lt;html&gt; &lt;a1&gt; &lt;a2/&gt; &lt;b/&gt; &lt;/a1&gt; &lt;/html&gt;
*/
@Test
public void nestedEmptyTags(){
@ -651,7 +651,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* <html> <a1> <a2> <a3> </a2> </a1> <b/> <a4/> </html>
* &lt;html&gt; &lt;a1&gt; &lt;a2&gt; &lt;a3&gt; &lt;/a2&gt; &lt;/a1&gt; &lt;b/&gt; &lt;a4/&gt; &lt;/html&gt;
*/
@Test
public void nestedMultipleTags(){
@ -699,8 +699,8 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* will test <x> <a> <b> <b> </x> </a> </x> .
* Here x is the first tag to be closed thus rendering the next close of a (</a>)
* will test &lt;x&gt; &lt;a&gt; &lt;b&gt; &lt;b&gt; &lt;/x&gt; &lt;/a&gt; &lt;/x&gt; .
* Here x is the first tag to be closed thus rendering the next close of a (&lt;/a&gt;)
* to be disregarded.
*/
@Test
@ -737,11 +737,11 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
/**
* <x> <a> <b> <b> </z> </a> </x>
* &lt;x&gt; &lt;a&gt; &lt;b&gt; &lt;b&gt; &lt;/z&gt; &lt;/a&gt; &lt;/x&gt;
* An unmatched closing of 'z' appears randomly in the document. This
* should be disregarded and structure of children and parents should not be influenced.
* in other words </a> should close the first <a> tag , </x> should close the first
* <x>, etc.
* in other words &lt;/a&gt; should close the first &lt;a&gt; tag , &lt;/x&gt; should close the first
* &lt;x&gt;, etc.
*/
@Test
public void unmatchedTagDoesNotInfluenceStructure(){
@ -776,10 +776,10 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
}
/**
* <a> <x> <a> <b> <b> </z> </a> </x>
* &lt;a&gt; &lt;x&gt; &lt;a&gt; &lt;b&gt; &lt;b&gt; &lt;/z&gt; &lt;/a&gt; &lt;/x&gt;
* An unmatched closing of 'z' appears randomly in the document. This
* should be disregarded and structure of children and parents should not be influenced.
* Also un unclosed <a> tag appears at the start of the document
* Also un unclosed &lt;a&gt; tag appears at the start of the document
*/
@Test
public void unclosedStartTagWithUnmatchedCloseOfDifferentTag(){
@ -821,7 +821,7 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
/**
* {@link #TEST_UNCLOSED_END_OF_DOC}
* <tag:x> <tag:y>
* &lt;tag:x&gt; &lt;tag:y&gt;
* Tests whether parser breaks on no closed tags at all
*/
//This is yet to be improved. If a closing tag does not
@ -1036,21 +1036,21 @@ public class JspDocStyleTest extends AbstractJspNodesTst {
"<html> <a1> <a2> <a3> </a2> </a1> <b/> <a4/> </html>";
/**
* </x> will close before </a>, thus leaving <a> to remain unclosed
* &lt;/x&gt; will close before &lt;/a&gt;, thus leaving &lt;a&gt; to remain unclosed
*/
private static final String TEST_UNCLOSED_END_AFTER_PARENT_CLOSE =
"<x> <a> <b> <b> </x> </a> aa </x> bb </x>";
/**
* </z> is just a dangling closing tag not matching any parent. The parser should
* &lt;/z&gt; is just a dangling closing tag not matching any parent. The parser should
* disregard it
*/
private static final String TEST_UNCLOSED_UNMATCHED_CLOSING_TAG =
"<x> <a> <b> <b> </z> </a> </x>";
/**
* First <a> tag does not close. The first closing of </a> will match the
* second opening of a. Another rogue </z> is there for testing compliance
* First &lt;a&gt; tag does not close. The first closing of &lt;/a&gt; will match the
* second opening of a. Another rogue &lt;/z&gt; is there for testing compliance
*/
private static final String TEST_UNCLOSED_START_TAG_WITH_UNMATCHED_CLOSE =
"<a> <x> <a> <b> <b> </z> </a> </x>";

52
pom.xml
View File

@ -7,13 +7,6 @@
<packaging>pom</packaging>
<name>PMD</name>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<relativePath />
</parent>
<description>
PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex, PLSQL, Apache Velocity, XML, XSL.
@ -244,6 +237,14 @@ Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code
<tag>HEAD</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>
<site>
<id>local</id>
<url>file:///tmp/pmd-site</url>
@ -336,7 +337,7 @@ Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code
<version>2.5.2</version>
<configuration>
<releaseProfiles>pmd-release</releaseProfiles>
<pushChanges>false</pushChanges>
<pushChanges>true</pushChanges>
<localCheckout>true</localCheckout>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>pmd_releases/@{project.version}</tagNameFormat>
@ -476,6 +477,11 @@ Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
</plugin>
<!--This plugin's configuration is used to store Eclipse
m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
@ -625,6 +631,18 @@ Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- if autoReleaseAfterClose is true, then the artifacts will be
automatically promoted to maven central -->
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
@ -916,6 +934,24 @@ Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code
<properties>
<pmd.website.baseurl>https://pmd.github.io/pmd-${project.version}/${project.artifactId}</pmd.website.baseurl>
</properties>
<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>
<profile>

View File

@ -524,6 +524,56 @@ you'll need a java8 runtime environment.
* [#1492](https://sourceforge.net/p/pmd/bugs/1492/): \[core] PMD CLI: IncompatibleClassChangeError when running PMD
## 25-Februar-2017 - 5.4.5
The PMD team is pleased to announce PMD 5.4.5
This is a bug fixing release.
### Table Of Contents
* [New and noteworthy](#New_and_noteworthy)
* [Modified Rules](#Modified_Rules)
* [Fixed Issues](#Fixed_Issues)
* [External Contributions](#External_Contributions)
### New and noteworthy
#### Modified Rules
* The Java rule `UnusedModifier` (ruleset java-unusedcode) has been expanded to consider more redundant modifiers.
* Annotations marked as `abstract`.
* Nested annotations marked as `static`.
* Nested annotations within another interface or annotation marked as `public`.
* Classes, interfaces or annotations nested within an annotation marked as `public` or `static`.
* Nested enums marked as `static`.
### Fixed Issues
* general
* [#234](https://github.com/pmd/pmd/issues/234): \[core] Zip file stream closes spuriously when loading rulesets
* [#256](https://github.com/pmd/pmd/issues/256): \[core] shortnames option is broken with relative paths
* java-basic
* [#232](https://github.com/pmd/pmd/issues/232): \[java] SimplifiedTernary: Incorrect ternary operation can be simplified.
* java-coupling
* [#270](https://github.com/pmd/pmd/issues/270): \[java] LoD false positive
* java-design
* [#216](https://github.com/pmd/pmd/issues/216): \[java] \[doc] NonThreadSafeSingleton: Be more explicit as to why double checked locking is not recommended
* [#219](https://github.com/pmd/pmd/issues/219): \[java] UnnecessaryLocalBeforeReturn: ClassCastException in switch case with local variable returned
* java-optimizations
* [#215](https://github.com/pmd/pmd/issues/215): \[java] RedundantFieldInitializer report for annotation field not explicitly marked as final
* java-unusedcode
* [#246](https://github.com/pmd/pmd/issues/246): \[java] UnusedModifier doesn't check annotations
* [#247](https://github.com/pmd/pmd/issues/247): \[java] UnusedModifier doesn't check annotations inner classes
* [#248](https://github.com/pmd/pmd/issues/248): \[java] UnusedModifier doesn't check static keyword on nested enum declaration
* [#257](https://github.com/pmd/pmd/issues/257): \[java] UnusedLocalVariable false positive
### External Contributions
* [#266](https://github.com/pmd/pmd/pull/266): \[java] corrected invalid reporting of LoD violation
## 28-January-2017 - 5.4.4
The PMD team is pleased to announce PMD 5.4.4