GitHub user svenrienstra opened a pull request:

    https://github.com/apache/maven-plugins/pull/65

    Try to replace absolute source directory paths with linked resources

    I have a project where one of the source folders is outside the main 
project path. With the build-helper-maven-plugin I have included this path in 
the maven source folders:
    
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>generate-sources</phase>
          <goals><goal>add-source</goal></goals>
          <configuration>
            <sources>
              <source>${basedir}/../shared/src/main/java</source>
            </sources>
          </configuration>
        </execution>
      </executions>
    </plugin>
    
    If i run the eclipse plugin with this setup it will generate the following 
classpath entry:
    <classpathentry kind="src" 
path="/Users/svenrienstra/Documents/***/git/***/shared/src/main/java" 
including="**/*.java"/>
    
    Eclipse does not accept this classpath entry. The change in this pull 
request will replace the absolute path with a linked resource. In the pom file 
I've added a linked resource:
    
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-eclipse-plugin</artifactId>
      <version>2.10</version>
      <configuration>
        <linkedResources combine.children="append"> 
         <linkedResource>
           <name>shared</name>
           <type>2</type>
           <locationURI>${basedir}/../shared/src</locationURI> 
         </linkedResource>
       </linkedResources>
      </configuration>
    </plugin>
    
    The code in this pull request will search through the source paths and 
replace any absolute path with a linked resource if there is a matching linked 
resource. This will result in the following classpath entry:
    
     <classpathentry kind="src" path="shared/main/java" including="**/*.java"/>
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/svenrienstra/maven-plugins trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-plugins/pull/65.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #65
    
----
commit 19ed898614a73170abde5e07e57ac4d4a247b00c
Author: Sven Rienstra <sven.riens...@nakedwines.com>
Date:   2015-10-19T09:56:56Z

    Try to replace absolute source directory paths with linked resources

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to