saiddfhi / gwt-maven

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

sourcesOnPath no longer honored in 2.0-beta26 #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Our build relies on sourcesOnPath = false. This was my solution for
resource filtering. I prefer to keep properties files used by GWT within
the main java source tree. I have configured the build to copy (and filter)
properties files out of the source tree. The maven resources goal would
place the filtered properties files in the target/classes where they would
be in the classpath for the GWT compiler.

This doesn't appear to be working any more as of 2.0-beta26. The classpath
passed to GWT contains my main java source path as the first entry (right
after the gwt library jars), overriding the filtered versions that were
placed in the target folder.

My resources config:

<resources>
  <resource>
    <directory>src/main/java</directory>
    <filtering>true</filtering>
    <includes>
      <!-- Property files -->
      <include>**/*.properties</include>
    </includes>
  </resource>
</resources>

Original issue reported on code.google.com by mark.ren...@gmail.com on 1 Dec 2008 at 10:28

GoogleCodeExporter commented 9 years ago
Ok. Not a bug. I've figured out what happened. 

As of beta24, there just the <sourcesOnPath> configuration property. The code 
behind
it looked like this:

  // add sources and resources
  if (mojo.getSourcesOnPath()) {
    BuildClasspathUtil.addSourcesAndResourcesWithActiveProjects(project, items,
DependencyScope.COMPILE);
  }

Our build has had sourcesOnPath set to false for a while.

Then in beta26, the <resourcesOnPath> property was added, which defaults to 
true. And
the code looks like this now:

  // add sources
  if (mojo.getSourcesOnPath()) {
    BuildClasspathUtil.addSourcesWithActiveProjects(project, items,
DependencyScope.COMPILE);
  }

  // add resources
  if (mojo.getResourcesOnPath()) {
    BuildClasspathUtil.addResourcesWithActiveProjects(project, items,
DependencyScope.COMPILE);
  }

So without changing my build, this broke things, since the resources started 
getting
put into my classpath. Since my resources include items from my source path (in 
order
to perform filtering) the sourcepath was inserted into classpath. A bit 
confusing,
but it makes sense now.

In all cases, I want only the target path to be in my classpath. So we have to 
set
resourcesOnPath = false as well to keep things working the same way.

A short summary of changes in each release, especially convering new 
configuration
options and their impact (and defaults) would be greatly appreciated in the 
future.

Original comment by mark.ren...@gmail.com on 2 Dec 2008 at 10:58

GoogleCodeExporter commented 9 years ago
Thanks for the info Mark and excellent point about documenting changes - I will 
try
to do a better job with that. 

To be honest, I wasn't aware the recent changes (which were based on patches 
from
contributors) would cause that issue.  I should have noticed it, but in my 
testing I
didn't see it.  (Will try to do that better too ;).)

Original comment by charlie....@gmail.com on 10 Dec 2008 at 10:41