You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by to...@gi-de.com on 2009/05/25 14:57:19 UTC

use relative "..\..." Path in and of maven-source-plugin?

Hi, 

I´m trying to include some additional files in my sources.jar:

src\main\java
src\main\groovy

I use the following configuration:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
                <!-- relative to the input directory whose contents is 
being packaged into the JAR  -->
                <!-- must be src\main\java than? -->
                <includes>
                        <include>**/*.java</include>
                        <include>../**/*.groovy</include>
                </includes>
                <includePom>true</includePom>
                <useDefaultExcludes>false</useDefaultExcludes>
              </configuration>
      </plugin>

=> I couldn't get that to work with relativepath parallel to src\main\java 
using the "..\" operator - only fileset pattern relative to src\main\java 
are applyable.

Any idea?

thanx, 

torsten

Re: Re: use relative "..\..." Path in and of maven-source-plugin?

Posted by Stephen Connolly <st...@gmail.com>.
Well this sounds like a fault of the groovy compiler plugin...

if it has source folders or test source folders it should be adding them as
a souce root IMHO.... of course this could have unwanted side effects, but
that would be what I think we should be aiming for, and not having to add
the folders via build helper

-Stephen

2009/5/27 <to...@gi-de.com>

>
> Hi,
>
> yes that works.
>
> I´ve added the build-helper-maven-plugin and joined at the test phase
> (before packaging):
>
> <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>build-helper-maven-plugin</artifactId>
>                                 <executions>
>                                         <execution>
>                                                 <id>add-groovy-source</id>
>                                                 <!-- before package phase
> -->
>                                                 <phase>test</phase>
>                                                 <goals>
>
> <goal>add-source</goal>
>                                                 </goals>
>                                                 <configuration>
>                                                         <sources>
>
> <source>${basedir}/src/main/groovy</source>
>                                                         </sources>
>                                                 </configuration>
>                                         </execution>
>                                         <execution>
>
> <id>add-groovy-test-source</id>
>                                                 <!-- before package phase
> -->
>                                                 <phase>test</phase>
>                                                 <goals>
>
> <goal>add-test-source</goal>
>                                                 </goals>
>                                                 <configuration>
>                                                         <sources>
>
> <source>${basedir}/src/test/groovy</source>
>                                                         </sources>
>                                                 </configuration>
>                                         </execution>
>
>                                 </executions>
>       </plugin>
>
> But it´s not very obvious to use that plugin to add some source files -
> instead of having it directly at the maven-source-plugin where one would
> suggest it.
>
> Thanx !
>
> torsten
>
>
>
>
>  *Martin Höller <ma...@xss.co.at>*
>
> 26.05.2009 09:06
>  Bitte antworten an
> "Maven Users List" <us...@maven.apache.org>
>
>   An
> "Maven Users List" <us...@maven.apache.org>  Kopie
>   Thema
> Re: use relative "..\..." Path in <includes> and <excludes> of
> maven-source-plugin?
>
>
>
>
> Hi!
>
> On Monday 25 May 2009 torsten.reinhard@gi-de.com wrote:
> > I´m trying to include some additional files in my sources.jar:
> >
> > src\main\java
> > src\main\groovy
>
> I never used it, but I guess you have to use the build helper maven plugin
> to add additional source paths to you project. See
> http://mojo.codehaus.org/build-helper-maven-plugin/usage.html for details.
>
> hth,
> - martin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Antwort: Re: use relative "..\..." Path in and of maven-source-plugin?

Posted by to...@gi-de.com.
Hi, 

yes that works. 

I�ve added the build-helper-maven-plugin and joined at the test phase 
(before packaging):

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <id>add-groovy-source</id>
                                                <!-- before package phase 
-->
                                                <phase>test</phase>
                                                <goals>
 <goal>add-source</goal>
                                                </goals>
                                                <configuration>
                                                        <sources>
 <source>${basedir}/src/main/groovy</source>
                                                        </sources>
                                                </configuration>
                                        </execution>
                                        <execution>
 <id>add-groovy-test-source</id>
                                                <!-- before package phase 
-->
                                                <phase>test</phase>
                                                <goals>
 <goal>add-test-source</goal>
                                                </goals>
                                                <configuration>
                                                        <sources>
 <source>${basedir}/src/test/groovy</source>
                                                        </sources>
                                                </configuration>
                                        </execution>
 
                                </executions> 
      </plugin>

But it�s not very obvious to use that plugin to add some source files - 
instead of having it directly at the maven-source-plugin where one would 
suggest it.

Thanx !

torsten





Martin H�ller <ma...@xss.co.at> 
26.05.2009 09:06
Bitte antworten an
"Maven Users List" <us...@maven.apache.org>


An
"Maven Users List" <us...@maven.apache.org>
Kopie

Thema
Re: use relative "..\..." Path in <includes> and <excludes> of 
maven-source-plugin?






Hi!

On Monday 25 May 2009 torsten.reinhard@gi-de.com wrote:
> I�m trying to include some additional files in my sources.jar:
>
> src\main\java
> src\main\groovy

I never used it, but I guess you have to use the build helper maven plugin 

to add additional source paths to you project. See 
http://mojo.codehaus.org/build-helper-maven-plugin/usage.html for details.

hth,
- martin


Re: use relative "..\..." Path in and of maven-source-plugin?

Posted by Martin Höller <ma...@xss.co.at>.
Hi!

On Monday 25 May 2009 torsten.reinhard@gi-de.com wrote:
> I´m trying to include some additional files in my sources.jar:
>
> src\main\java
> src\main\groovy

I never used it, but I guess you have to use the build helper maven plugin 
to add additional source paths to you project. See 
http://mojo.codehaus.org/build-helper-maven-plugin/usage.html for details.

hth,
- martin