saiddfhi / gwt-maven

Automatically exported from code.google.com/p/gwt-maven
0 stars 0 forks source link

Project source files and resources should by first on classpath in compile.sh #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Is this Maven 1 or Maven 2?

What steps will reproduce the problem?
1. run a compile and check the file compile.sh

What is the expected output? What do you see instead?
The line export CLASSPATH=.. should contain project source and class
folders first.
Instead, GWT jars are listed first.

What version of the product are you using? On what operating system?
2.0-beta26 on Mac OS X

Please provide any additional information below.
Motivation: This change will make it possible to patch GWT classes in your
project.

Patch:
---------------------
Index: src/main/java/com/totsp/mavenplugin/gwt/util/BuildClasspathUtil.java
===================================================================
--- src/main/java/com/totsp/mavenplugin/gwt/util/BuildClasspathUtil.java
(revision 956)
+++ src/main/java/com/totsp/mavenplugin/gwt/util/BuildClasspathUtil.java
(working copy)
@@ -66,20 +66,6 @@

       Set<File> items = new LinkedHashSet<File>();

-      // inject GWT jars and relative native libs for all scopes
-      // (gwt-user and gwt-dev should be scoped provided to keep them out of
-      // other maven stuff - not end up in war, etc - this util is only
used for GWT-Maven scripts)
-      // TODO filter the rest of the stuff so we don't double add these
-      if (gwtHome != null) {
-         mojo.getLog().info(
-                  "google.webtoolkit.home (gwtHome) set, using it for GWT
dependencies - " + gwtHome.getAbsolutePath());
-         items.addAll(BuildClasspathUtil.injectGwtDepsFromGwtHome(gwtHome,
mojo));
-      }
-      else {
-         mojo.getLog().info("google.webtoolkit.home (gwtHome) *not* set,
using project POM for GWT dependencies");
-         items.addAll(BuildClasspathUtil.injectGwtDepsFromRepo(mojo));
-      }
-
       // add sources
       if (mojo.getSourcesOnPath()) {
          BuildClasspathUtil.addSourcesWithActiveProjects(project, items,
DependencyScope.COMPILE);
@@ -93,13 +79,27 @@
       // add classes dir
       items.add(new File(project.getBasedir(), "classes"));

+      // inject GWT jars and relative native libs for all scopes
+      // (gwt-user and gwt-dev should be scoped provided to keep them out of
+      // other maven stuff - not end up in war, etc - this util is only
used for GWT-Maven scripts)
+      // TODO filter the rest of the stuff so we don't double add these
+      if (gwtHome != null) {
+         mojo.getLog().info(
+                 "google.webtoolkit.home (gwtHome) set, using it for GWT
dependencies - " + gwtHome.getAbsolutePath());
+         items.addAll(BuildClasspathUtil.injectGwtDepsFromGwtHome(gwtHome,
mojo));
+      }
+      else {
+         mojo.getLog().info("google.webtoolkit.home (gwtHome) *not* set,
using project POM for GWT dependencies");
+         items.addAll(BuildClasspathUtil.injectGwtDepsFromRepo(mojo));
+      }
+      
       // if runtime add runtime
       if (scope == DependencyScope.RUNTIME) {
          for (Iterator it =
project.getRuntimeClasspathElements().iterator(); it.hasNext();) {
             items.add(new File(it.next().toString()));
          }
       }
-
+ 
       // if test add test
       if (scope == DependencyScope.TEST) {
          for (Iterator it = project.getTestClasspathElements().iterator();
it.hasNext();) {

Original issue reported on code.google.com by m.vog...@gmail.com on 19 Feb 2009 at 1:17

GoogleCodeExporter commented 9 years ago
Thanks for the patch. This makes perfect sense to me, it will go in the next 
release. 

I think this fixes issue 177 too - but will have to look at that more closely 
to make
sure it's the same thing (I just glanced at it). 

Original comment by charlie....@gmail.com on 20 Feb 2009 at 12:02

GoogleCodeExporter commented 9 years ago
I am going to punt on this.

Please attach your patches and don't paste them into the test area. The word 
wrap breaks them and I can't easily 
apply them. 

If I get back around to this, I will fix it later today.

Original comment by keber...@gmail.com on 22 Mar 2009 at 8:48

GoogleCodeExporter commented 9 years ago
Sorry, commented on the wrong issue.

We have cycled back and forth on this.

The problem with this is people using filtered resources.

Please us resourcesOnPath and sourcesOnPath property in the config now. This is 
either put them at the top 
of the path, or not at all, and assume you are going to get them places in 
target/classes+target/webapp/WEB-INF/classes somewhere else.

Original comment by keber...@gmail.com on 22 Mar 2009 at 9:41

GoogleCodeExporter commented 9 years ago
In 2.0-RC1. 

Original comment by charlie....@gmail.com on 3 Apr 2009 at 1:16