Or the source plugin. I tend to use assembly because it is more flexible -
but source is straightforward enough:
http://maven.apache.org/plugins/maven-source-plugin/

On 3/23/07, Eric Redmond <[EMAIL PROTECTED]> wrote:

Do not do that. It's telling Maven that the source is a resource and to
treat is as such. For example, if you chose to filter your resources, this
will also filter all of your Java code - not really desirable. Stick to the
Assembly plugin:
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#src

Eric

On 3/23/07, Balasubramanian, Ravi Shankar <[EMAIL PROTECTED]>
wrote:
>
> You can add the corresponding directory as a resource in your pom as
> follows:
>
> "
> <build>
>
>         <!--Add sources to jar files-->
>         <resources>
>             <resource>
>                 <directory>src/main/resources</directory>
>             </resource>
>
>             <resource>
>                 <directory>src/main/java</directory>
>             </resource>
>
>             <resource>
>                  <directory>whatever/directory/you/want/</directory>
>         </resources>
> "
>
> This will include the source code files to the jar file that "mvn
> package" generates for you.
>
> Regards,
> Ravi
>
> -----Original Message-----
> From: Boris Valkov [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 23, 2007 5:24 PM
> To: Maven Users List
> Subject: Include source files in jar
>
> Hello,
>
> I want to pack jar archive, but I need the *.java classes also included
> into this jar.
> I need this, because I want other people that use my jar project to see
> the documentation of all methods ?
> Not with maven assembly plugin, rather with "mvn package" and some
> additional option.
>
> Thanks in advance!
>
> ---
> Sincerely
> Boris Valkov
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Eric Redmond
http://codehaus.org/~eredmond <http://codehaus.org/%7Eeredmond>




--
Eric Redmond
http://codehaus.org/~eredmond

Reply via email to