[cal10n-dev] [GIT] Compiler assisted localization library branch, master, updated. c6d309e74d99dd5788af73b512a2d60aeae6bef6

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Tue Sep 1 10:50:56 CEST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Compiler assisted localization library".

The branch, master has been updated
       via  c6d309e74d99dd5788af73b512a2d60aeae6bef6 (commit)
      from  27f1ec582de95317643cc8004bbe18672bb31e07 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=cal10n.git;a=commit;h=c6d309e74d99dd5788af73b512a2d60aeae6bef6
http://github.com/ceki/cal10n/commit/c6d309e74d99dd5788af73b512a2d60aeae6bef6

commit c6d309e74d99dd5788af73b512a2d60aeae6bef6
Author: Sebastien Pennec <ceki at qos.ch>
Date:   Tue Sep 1 10:49:41 2009 +0200

    - changing the way in which the URL for dependencies is constructed.
      The previous method did not work on Linux

diff --git a/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java b/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java
index 8a702ce..bdfe8fb 100644
--- a/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java
+++ b/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java
@@ -25,7 +25,6 @@ import java.io.File;
 import java.lang.reflect.Constructor;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -145,11 +144,9 @@ public class VerifyMojo extends AbstractMojo {
     String errMsg = "Failed to instantiate MessageCodeVerifier class";
     try {
 
-      URLClassLoader cl = (URLClassLoader) buildClassLoader();
-      Class<?> cla = Class.forName(Cal10nConstants.MessageCodeVerifier_FQCN, true, cl);
-
-      cla.newInstance();
-      
+      ThisFirstClassLoader thisFirstClassLoader = (ThisFirstClassLoader) buildClassLoader();
+      //Class<?> cla = thisFirstClassLoader.loadClass(Cal10nConstants.MessageCodeVerifier_FQCN, true);
+      Class<?> cla = Class.forName(Cal10nConstants.MessageCodeVerifier_FQCN, true, thisFirstClassLoader);
       Constructor<?> cons = cla.getConstructor(String.class);
       IMessageCodeVerifier imcv = (IMessageCodeVerifier) cons
           .newInstance(enumClassAsStr);
@@ -168,7 +165,6 @@ public class VerifyMojo extends AbstractMojo {
     classpathURLList.add(toURL(outputDirectory));
     classpathURLList.addAll(getDirectDependencies());
     ClassLoader parentCL = this.getClass().getClassLoader();
-    
     URL[] classpathURLArray = classpathURLList.toArray(new URL[] {});
     System.out.println("classpathURLArray="+Arrays.toString(classpathURLArray));
     return new ThisFirstClassLoader(classpathURLArray, parentCL);
@@ -177,11 +173,13 @@ public class VerifyMojo extends AbstractMojo {
   List<URL> getDirectDependencies() {
     ArrayList<URL> urlList = new ArrayList<URL>();
     for (Artifact a : projectArtifacts) {
-      // localRepository.getUrl() returns a bogus URL
-      String pathOfArtifact = localRepository.getBasedir() + "/"
-          + localRepository.pathOf(a);
+      String urlAsStr = localRepository.getUrl();  //returns a bogus URL
+      //String pathOfArtifact = localRepository.getBasedir() + "/"
+      //    + localRepository.pathOf(a);
+      urlAsStr += "/"+localRepository.pathOf(a);
       try {
-        URL url = new URL("file:/" + pathOfArtifact);
+        //URL url = new URL("file://" + pathOfArtifact);
+        URL url = new URL(urlAsStr);
         urlList.add(url);
       } catch (MalformedURLException e) {
         getLog().info("Failed to build URL", e);

-----------------------------------------------------------------------

Summary of changes:
 .../java/ch/qos/cal10n/plugins/VerifyMojo.java     |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Compiler assisted localization library


More information about the cal10n-dev mailing list