This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 170700 - Add sources from build-helper-maven-plugin
Summary: Add sources from build-helper-maven-plugin
Status: RESOLVED DUPLICATE of bug 187595
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 192460 (view as bug list)
Depends on:
Blocks: 142251 191864
  Show dependency tree
 
Reported: 2009-08-20 12:54 UTC by galet
Modified: 2011-06-01 18:10 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description galet 2009-08-20 12:54:30 UTC
org.codehaus.mojo:build-helper-maven-plugin plugin contains useful goal to include additional sources to the build path.
It would be very useful if the netbeans detects the plugin configuration and adds those directories to the project.

Eg.

<build>
    <plugins>
      <!-- Adds mock sources to the tests build tree -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>add-mocks-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/mock</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
Comment 1 Milos Kleint 2009-08-20 13:59:14 UTC
we do add build-helper roots for main sources, but don't add any generated source roots to test sources currently
Comment 2 galet 2009-08-20 14:30:16 UTC
Yes, you are right. I have found that the plugin configuration has to be done outside of execution element.

eg:
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>add-mocks-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sources>
            <source>src/test/mock</source>
          </sources>
        </configuration>
      </plugin>
Comment 3 Milos Kleint 2009-08-21 08:25:14 UTC
the code in netbeans looks first in execution element for "add-sources" goal, if not found uses the generic
configuration. In both cases the sources are however put into the main sources group. If the generated sources depend on
something from test classpath, you will get error badges in the IDE.
Comment 4 Antonin Nebuzelsky 2010-07-30 15:17:25 UTC
Reassigning to default owner.
Comment 5 Jesse Glick 2010-11-29 17:56:28 UTC
*** Bug 192460 has been marked as a duplicate of this bug. ***
Comment 6 Jesse Glick 2011-06-01 18:10:56 UTC
Handling this as part of bug #187595, since the code is so closely related.

*** This bug has been marked as a duplicate of bug 187595 ***