Author: chatellier Date: 2009-04-07 13:14:20 +0000 (Tue, 07 Apr 2009) New Revision: 2080 Modified: isis-fish/trunk/pom.xml isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java Log: Proper test coding (use forkMode=once :() Remove bad java hack for this Modified: isis-fish/trunk/pom.xml =================================================================== --- isis-fish/trunk/pom.xml 2009-04-07 10:22:14 UTC (rev 2079) +++ isis-fish/trunk/pom.xml 2009-04-07 13:14:20 UTC (rev 2080) @@ -362,6 +362,9 @@ <xmlrpc.version>3.1</xmlrpc.version> <javadoc.version>2.5</javadoc.version> + <!-- for compilation test to run --> + <maven.test.forkMode>once</maven.test.forkMode> + <!--Main class in JAR --> <maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class> @@ -497,7 +500,6 @@ </execution> </executions> </plugin> - </plugins> <pluginManagement> @@ -508,7 +510,7 @@ <archive> <manifest> <addClasspath>true</addClasspath> - <classpathPrefix>./lib/</classpathPrefix> + <classpathPrefix>lib/</classpathPrefix> </manifest> </archive> </configuration> @@ -518,6 +520,24 @@ </build> + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.5</version> + <configuration> + <links> + <link>http://java.sun.com/javase/6/docs/api/</link> + <link>http://lutinutil.labs.libre-entreprise.org/lutinutil/apidocs/</link> + <link>http://lutinmatrix.labs.libre-entreprise.org/lutinmatrix/apidocs/</link> + <link>http://topia.labs.libre-entreprise.org/topia/topia-persistence/apidocs/</link> + </links> + </configuration> + </plugin> + </plugins> + </reporting> + <!-- ************************************************************* --> <!-- *** Build Environment ************************************** --> <!-- ************************************************************* --> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-07 10:22:14 UTC (rev 2079) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-07 13:14:20 UTC (rev 2080) @@ -216,16 +216,22 @@ } /** - * @return + * Return full classpath (for compilation or javadoc) as string. + * Separated by {@link File.pathSeparator}. + * + * Add : + * <ul> + * <li>System.getProperty("java.class.path") + * <li>All first jar dependency (META-INF/MANIFEST.MF) + * <li>target/classes (if exists : for maven tests) + * </ul> + * @return classptah as string */ private static String getClassPathAsString(List<File> classpath) throws Exception { String result = StringUtils.join(classpath.iterator(), File.pathSeparator) + File.pathSeparator + System.getProperty("java.class.path"); - if (log.isDebugEnabled()) { - log.debug("Result : " + result); - } // Ajout des jars for (Enumeration<?> e = CompileHelper.class.getClassLoader() @@ -241,10 +247,10 @@ result += File.pathSeparator + jarName; // FIX to launch isis with java -jar - URL jarURL = new URL("jar",null,jarName); + URL jarURL = new URL("jar", null, jarName); URL[] urls = Resource.getClassPathURLsFromJarManifest(jarURL); for (URL url2 : urls) { - String jarName2 = url2.getFile(); + String jarName2 = url2.getPath(); if (!result.contains(jarName2)) { result += File.pathSeparator + jarName2; } @@ -253,14 +259,6 @@ } } - // FIXME just for test to run in maven - // In this case, current project in not packaged ad jar - // and no META-INF/MANIFEST.MF could be found... - File targetClassesFile = new File("target", "classes"); - if (targetClassesFile.isDirectory()) { - result += File.pathSeparator + targetClassesFile.getAbsolutePath(); - } - if (log.isDebugEnabled()) { log.debug("CLASSPATH : " + result); }