{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/1205","repository_url":"https://api.github.com/repos/bitcoinj/bitcoinj","labels_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/1205/labels{/name}","comments_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/1205/comments","events_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/1205/events","html_url":"https://github.com/bitcoinj/bitcoinj/pull/1205","id":137068792,"number":1205,"title":"Fix core module build failures caused by Maven surefire plugin","user":{"login":"mruddy","id":6440430,"avatar_url":"https://avatars.githubusercontent.com/u/6440430?v=3","gravatar_id":"","url":"https://api.github.com/users/mruddy","html_url":"https://github.com/mruddy","followers_url":"https://api.github.com/users/mruddy/followers","following_url":"https://api.github.com/users/mruddy/following{/other_user}","gists_url":"https://api.github.com/users/mruddy/gists{/gist_id}","starred_url":"https://api.github.com/users/mruddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruddy/subscriptions","organizations_url":"https://api.github.com/users/mruddy/orgs","repos_url":"https://api.github.com/users/mruddy/repos","events_url":"https://api.github.com/users/mruddy/events{/privacy}","received_events_url":"https://api.github.com/users/mruddy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-28T16:25:39Z","updated_at":"2016-02-29T11:54:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/1205","html_url":"https://github.com/bitcoinj/bitcoinj/pull/1205","diff_url":"https://github.com/bitcoinj/bitcoinj/pull/1205.diff","patch_url":"https://github.com/bitcoinj/bitcoinj/pull/1205.patch"},"body":"Fix core module build failures caused by Maven surefire plugin running JUnit classes.\r\n\r\nI ran into this today: https://github.com/travis-ci/travis-ci/issues/2675\r\n\r\nBasically, I cloned the repo, `git fetch --all`, `mvn install` (wallet-template module fails), then whenever I run `mvn install` again it failed with:\r\n\r\n```\r\n[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ bitcoinj-core ---\r\n\r\n-------------------------------------------------------\r\n T E S T S\r\n-------------------------------------------------------\r\nRunning junit.extensions.RepeatedTest\r\nTests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.046 sec <<< FAILURE! - in junit.extensions.RepeatedTest\r\ninitializationError(junit.extensions.RepeatedTest)  Time elapsed: 0.009 sec  <<< ERROR!\r\njava.lang.Exception: Test class should have exactly one public zero-argument constructor\r\n\r\ninitializationError(junit.extensions.RepeatedTest)  Time elapsed: 0 sec  <<< ERROR!\r\njava.lang.Exception: No runnable methods\r\n\r\nRunning junit.extensions.TestDecorator\r\nTests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in junit.extensions.TestDecorator\r\ninitializationError(junit.extensions.TestDecorator)  Time elapsed: 0 sec  <<< ERROR!\r\njava.lang.Exception: Test class should have exactly one public zero-argument constructor\r\n\r\ninitializationError(junit.extensions.TestDecorator)  Time elapsed: 0 sec  <<< ERROR!\r\njava.lang.Exception: No runnable methods\r\n\r\nRunning junit.extensions.TestSetup\r\nTests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in junit.extensions.TestSetup\r\ninitializationError(junit.extensions.TestSetup)  Time elapsed: 0 sec  <<< ERROR!\r\njava.lang.Exception: Test class should have exactly one public zero-argument constructor\r\n\r\ninitializationError(junit.extensions.TestSetup)  Time elapsed: 0 sec  <<< ERROR!\r\njava.lang.Exception: No runnable methods\r\n\r\nRunning junit.framework.TestSuite\r\nTests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in junit.framework.TestSuite\r\ninitializationError(junit.framework.TestSuite)  Time elapsed: 0 sec  <<< ERROR!\r\njava.lang.IllegalArgumentException: Test class can only have one constructor\r\n```\r\n\r\nAfter some tinkering with `/opt/apache-maven-3.3.9/bin/mvn install -e -X`\r\n\r\nI saw that all these junit classes were getting into the config file for surefire to run:\r\n\r\n```\r\n> grep junit bitcoinj/core/target/surefire/surefire4281808258863620369tmp\r\ntc.5=org.junit.internal.runners.TestMethod\r\ntc.6=org.junit.internal.runners.TestClass\r\ntc.3=org.junit.rules.TestRule\r\ntc.4=org.junit.Test\r\ntc.1=org.junit.rules.TestWatcher\r\ntc.2=org.junit.rules.TestName\r\ntc.0=org.junit.rules.TestWatchman\r\ntc.9=org.junit.runners.parameterized.TestWithParameters\r\ntc.7=org.junit.runners.model.TestTimedOutException\r\ntc.87=junit.textui.TestRunner\r\ntc.8=org.junit.runners.model.TestClass\r\ntc.88=junit.extensions.RepeatedTest\r\ntc.90=junit.extensions.TestSetup\r\ntc.91=junit.runner.TestRunListener\r\ntc.92=junit.framework.TestResult\r\ntc.93=junit.framework.Test\r\ntc.94=junit.framework.TestFailure\r\ntc.95=junit.framework.TestCase\r\ntc.96=junit.framework.TestListener\r\ntc.97=junit.framework.TestSuite\r\ntc.10=org.junit.validator.TestClassValidator\r\ntc.11=org.junit.experimental.theories.suppliers.TestedOn\r\ntc.89=junit.extensions.TestDecorator\r\ntc.12=org.junit.experimental.theories.suppliers.TestedOnSupplier\r\n```\r\n\r\nI made the fix in this PR and those junit classes no longer get into the surefire config and the build works again.\r\nSo, this seems like some minor bug/oversight in surefire. But, it's easy to fix by excluding junit classes.\r\nNow I'm back to the wallet-template failing (and I don't care about that right now).\r\n\r\nReference: http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html"},"comment":{"url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/comments/190179525","html_url":"https://github.com/bitcoinj/bitcoinj/pull/1205#issuecomment-190179525","issue_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/1205","id":190179525,"user":{"login":"schildbach","id":743306,"avatar_url":"https://avatars.githubusercontent.com/u/743306?v=3","gravatar_id":"","url":"https://api.github.com/users/schildbach","html_url":"https://github.com/schildbach","followers_url":"https://api.github.com/users/schildbach/followers","following_url":"https://api.github.com/users/schildbach/following{/other_user}","gists_url":"https://api.github.com/users/schildbach/gists{/gist_id}","starred_url":"https://api.github.com/users/schildbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schildbach/subscriptions","organizations_url":"https://api.github.com/users/schildbach/orgs","repos_url":"https://api.github.com/users/schildbach/repos","events_url":"https://api.github.com/users/schildbach/events{/privacy}","received_events_url":"https://api.github.com/users/schildbach/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T11:54:14Z","updated_at":"2016-02-29T11:54:14Z","body":"So the issue is limited to the case of retrying a build that has already failed?\r\n\r\nI wonder why does the wallettemplate build fail in the first place? It doesn't fail for Travis, and it doesn't fail for me."}}