test failures during mvn package
I am trying to add rules to the FlexPMD ruleset. I have checked out the code and initially it packaged and compiled correctly, however after adding a new rule and compiling it, the mvn package command fails.
I have never used maven before, so I am at a loss as to how to fix it. It has to do with the testing I do know. If I run the command “mvn –Dmaven.test.skip=true package” then I am able to get passed the fail and run FlexPMD with my new rule just fine. When I run just mvn package, here is part of the build including my error:
[INFO] ------------------------------------------------------------------------
[INFO] Building Adobe Flex PMD RuleSet API 1.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.0:unpack-dependencies (unpack-test-resource
s) @ flex-pmd-ruleset-api ---
[INFO] Unpacking C:\AndrewPMDSource\flex-pmd-test-resources\target\flex-pmd-test
-resources-1.2-resources.zipto
C:\AndrewPMDSource\flex-pmd-ruleset-api\target\test\generated-resources
with Includes **/*.as,**/*.mxml and excludes:null
[INFO] as3-parser-1.2.jar already exists in destination.
[INFO] as3-plugin-utils-1.2.jar already exists in destination.
[INFO] flex-pmd-files-1.2.jar already exists in destination.
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ flex-pmd
-ruleset-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ flex-pmd-rule
set-api ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
flex-pmd-ruleset-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 96 resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ flex-
pmd-ruleset-api ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ flex-pmd-ruleset-ap
i ---
[INFO] Surefire report directory: C:\AndrewPMDSource\flex-pmd-ruleset-api\target
\surefire-reports
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(Suref
ireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(S
urefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
69)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.inv
oke(ProviderFactory.java:103)
... 4 more
Caused by: java.lang.NoClassDefFoundError: JSAPException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(Reflectio
nUtils.java:57)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly
(JUnit3TestChecker.java:65)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUni
t3Test(JUnit3TestChecker.java:60)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUni
t3TestChecker.java:55)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUni
t4TestChecker.java:52)
at org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClas
ses(DefaultDirectoryScanner.java:80)
at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4P
rovider.java:164)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider
.java:86)
... 9 more
Caused by: java.lang.ClassNotFoundException: JSAPException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Adobe Flex PMD Java Parent ........................ SUCCESS [1.108s]
[INFO] As3 Parser API .................................... SUCCESS [3.603s]
[INFO] As3 Maven plugin Utils ............................ SUCCESS [2.215s]
[INFO] Adobe Flex PMD RuleSet test resources ............. SUCCESS [3.619s]
[INFO] Adobe Flex PMD Files .............................. SUCCESS [5.008s]
[INFO] As3 Parser ........................................ SUCCESS [3.104s]
[INFO] Adobe Flex PMD RuleSet API ........................ FAILURE [3.650s]
[INFO] Adobe Flex PMD RuleSet ............................ SKIPPED
[INFO] Adobe Flex CPD (Copy and Past Detector) ........... SKIPPED
[INFO] Adobe Flex CPD Ant task ........................... SKIPPED
[INFO] Adobe Flex PMD Core ............................... SKIPPED
[INFO] Adobe Flex CPD Maven plugin ....................... SKIPPED
[INFO] Adobe Flex PMD Command line API ................... SKIPPED
[INFO] Adobe Flex CPD Command line ....................... SKIPPED
[INFO] Adobe Flex PMD Ant task ........................... SKIPPED
[INFO] Adobe Flex PMD Maven plugin ....................... SKIPPED
[INFO] Adobe Flex PMD Command line ....................... SKIPPED
[INFO] Adobe Flex Metrics ................................ SKIPPED
[INFO] Adobe Flex Metrics command line ................... SKIPPED
[INFO] Adobe Flex Metrics Ant task ....................... SKIPPED
[INFO] Adobe Flex Metrics Maven plugin ................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.259s
[INFO] Finished at: Mon Jun 20 14:20:34 EDT 2011
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
7.2:test (default-test) on project flex-pmd-ruleset-api: There are test failures
.
[ERROR]
[ERROR] Please refer to C:\AndrewPMDSource\flex-pmd-ruleset-api\target\surefire-
reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :flex-pmd-ruleset-api
Any help or guidance would be greatly appreciated
Thanks,
Jennifer
![]()
