You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bill Brown <wb...@colorfulsoftware.com> on 2009/09/21 21:40:42 UTC

how do I include test-sources in the release:prepare and release:preform targets.

Greetings: 

I'm trying to include the "test" sources into a maven repository but am
struggling getting them to generate.  I want them to be included during the
'mvn release' targets, but so far they aren't.  I've taken a look at the
maven-source-plugin documentation but haven't been able to piece together
the correct syntax.  I have the following for my configuration with
<build><plugins>... 
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-source-plugin</artifactId>
	<configuration>
		<includes>
			<include>src/main/java/**</include>
			<include>src/test/java/**</include>
		</includes>
	</configuration>
</plugin>


I would prefer the test sources to be in their own jar file but they can be
mixed in with the regular sources if that is the only way this will work. 
Can someone on the list here give me a hint for how to do this? 

Thanks for your input.
Bill

-- 
View this message in context: http://www.nabble.com/how-do-I-include-test-sources-in-the-release%3Aprepare-and-release%3Apreform-targets.-tp25530447p25530447.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: how do I include test-sources in the release:prepare and release:preform targets.

Posted by Bill Brown <wb...@colorfulsoftware.com>.
Greetings: 

I found the answer to my question in the maven-source-plugin wiki page here:
http://docs.codehaus.org/display/MAVENUSER/Source+Plugin

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-source-plugin</artifactId>
  <configuration>
    <attach>true</attach>
  </configuration>
  <executions>
    <execution>
      <phase>install</phase>
      <goals>
        <goal>jar</goal>
        <goal>test-jar</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Now when I invoke 'mvn release:perform', the test-sources are included in
the list of artifacts deployed to the maven repository.  

Thanks.
Bill.

-- 
View this message in context: http://www.nabble.com/how-do-I-include-test-sources-in-the-release%3Aprepare-and-release%3Apreform-targets.-tp25530447p25530749.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: how do I include test-sources in the release:prepare and release:preform targets.

Posted by Stephen Connolly <st...@gmail.com>.
Ahh much nicer... I should have guessed there was a second mojo!

2009/9/22 Nick Stolwijk <ni...@gmail.com>

> Add a second execution which executes the test-jar goal[1].
>
> <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-source-plugin</artifactId>
>         <executions>
>             <execution>
>                   <id>test-jar</id>
>                   <goals>
>                     <goal>test-jar</goal>
>                   <goals
>             </execution>
>        </executions>
>  </plugin>
>
> [1] http://maven.apache.org/plugins/maven-source-plugin/test-jar-mojo.html
>
> Hth,
>
> Nick Stolwijk
> ~Java Developer~
>
> IPROFS BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> http://www.iprofs.nl
>
>
>
> On Mon, Sep 21, 2009 at 11:39 PM, Stephen Connolly
> <st...@gmail.com> wrote:
> > add a second execution with a configuration defining a different
> classifier
> > (test-src) and a different includes pattern
> >
> > 2009/9/21 Bill Brown <wb...@colorfulsoftware.com>
> >
> >>
> >> Greetings:
> >>
> >> I'm trying to include the "test" sources into a maven repository but am
> >> struggling getting them to generate.  I want them to be included during
> the
> >> 'mvn release' targets, but so far they aren't.  I've taken a look at the
> >> maven-source-plugin documentation but haven't been able to piece
> together
> >> the correct syntax.  I have the following for my configuration with
> >> <build><plugins>...
> >> <plugin>
> >>        <groupId>org.apache.maven.plugins</groupId>
> >>        <artifactId>maven-source-plugin</artifactId>
> >>        <configuration>
> >>                <includes>
> >>                        <include>src/main/java/**</include>
> >>                        <include>src/test/java/**</include>
> >>                </includes>
> >>        </configuration>
> >> </plugin>
> >>
> >>
> >> I would prefer the test sources to be in their own jar file but they can
> be
> >> mixed in with the regular sources if that is the only way this will
> work.
> >> Can someone on the list here give me a hint for how to do this?
> >>
> >> Thanks for your input.
> >> Bill
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/how-do-I-include-test-sources-in-the-release%3Aprepare-and-release%3Apreform-targets.-tp25530447p25530447.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: how do I include test-sources in the release:prepare and release:preform targets.

Posted by Nick Stolwijk <ni...@gmail.com>.
Add a second execution which executes the test-jar goal[1].

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
             <execution>
                   <id>test-jar</id>
                   <goals>
                     <goal>test-jar</goal>
                   <goals
             </execution>
        </executions>
 </plugin>

[1] http://maven.apache.org/plugins/maven-source-plugin/test-jar-mojo.html

Hth,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl



On Mon, Sep 21, 2009 at 11:39 PM, Stephen Connolly
<st...@gmail.com> wrote:
> add a second execution with a configuration defining a different classifier
> (test-src) and a different includes pattern
>
> 2009/9/21 Bill Brown <wb...@colorfulsoftware.com>
>
>>
>> Greetings:
>>
>> I'm trying to include the "test" sources into a maven repository but am
>> struggling getting them to generate.  I want them to be included during the
>> 'mvn release' targets, but so far they aren't.  I've taken a look at the
>> maven-source-plugin documentation but haven't been able to piece together
>> the correct syntax.  I have the following for my configuration with
>> <build><plugins>...
>> <plugin>
>>        <groupId>org.apache.maven.plugins</groupId>
>>        <artifactId>maven-source-plugin</artifactId>
>>        <configuration>
>>                <includes>
>>                        <include>src/main/java/**</include>
>>                        <include>src/test/java/**</include>
>>                </includes>
>>        </configuration>
>> </plugin>
>>
>>
>> I would prefer the test sources to be in their own jar file but they can be
>> mixed in with the regular sources if that is the only way this will work.
>> Can someone on the list here give me a hint for how to do this?
>>
>> Thanks for your input.
>> Bill
>>
>> --
>> View this message in context:
>> http://www.nabble.com/how-do-I-include-test-sources-in-the-release%3Aprepare-and-release%3Apreform-targets.-tp25530447p25530447.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: how do I include test-sources in the release:prepare and release:preform targets.

Posted by Stephen Connolly <st...@gmail.com>.
add a second execution with a configuration defining a different classifier
(test-src) and a different includes pattern

2009/9/21 Bill Brown <wb...@colorfulsoftware.com>

>
> Greetings:
>
> I'm trying to include the "test" sources into a maven repository but am
> struggling getting them to generate.  I want them to be included during the
> 'mvn release' targets, but so far they aren't.  I've taken a look at the
> maven-source-plugin documentation but haven't been able to piece together
> the correct syntax.  I have the following for my configuration with
> <build><plugins>...
> <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-source-plugin</artifactId>
>        <configuration>
>                <includes>
>                        <include>src/main/java/**</include>
>                        <include>src/test/java/**</include>
>                </includes>
>        </configuration>
> </plugin>
>
>
> I would prefer the test sources to be in their own jar file but they can be
> mixed in with the regular sources if that is the only way this will work.
> Can someone on the list here give me a hint for how to do this?
>
> Thanks for your input.
> Bill
>
> --
> View this message in context:
> http://www.nabble.com/how-do-I-include-test-sources-in-the-release%3Aprepare-and-release%3Apreform-targets.-tp25530447p25530447.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>