Hi Madhu,

As suggested earlier, did you try the maven-source-plugin? It might be
easier for you.

        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.2</version>
          <!-- Build source JARs in addition to binary ones. -->
          <executions>
            <execution>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

This will generate a JAR file like target/myArtifact-x.y.z-sources.jar
containing your sources and resources with Maven metadata including the
POM. You can even deploy the sources JAR to your Maven repository so that
other developers on your team have easy access to the code that goes along
with each binary release.

Alternately, if you really want to use the assembly plugin... your error
message indicates that no descriptors are configured, which is strange
given your plugin block in the POM. Are you using "mvn assembly:single"?
Did you try adding the <executions> block suggested by Jim and just using
"mvn package" to create the assembly?

HTH,
Curtis


On Wed, Sep 12, 2012 at 8:26 AM, Madhu <[email protected]> wrote:

> This is how my code looks which I wrote:
> This is my source.xml file
> <assembly
> xmlns="
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>
> xsi:schemaLocation="
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
> http://maven.apache.org/xsd/assembly-1.1.0.xsd";>
>   <id>src</id>
>   <formats>
>     <format>zip</format>
>   </formats>
>   <fileSets>
>     <fileSet>
>       <directory>${project.basedir}</directory>
>       <includes>
>         <include>src/main/*.java</include>
>         <include>src/main/resources/*.*</include>
>         <include>pom.xml</include>
>       </includes>
>       <useDefaultExcludes>true</useDefaultExcludes>
>     </fileSet>
>     <fileSet>
>
>       <directory>${project.basedir}/src/main</directory>
>       <useDefaultExcludes>true</useDefaultExcludes>
>     </fileSet>
>   </fileSets>
> </assembly>
>
> and in the pom.xml I have written this
>
>
>                                 <plugin>
>
> <artifactId>maven-assembly-plugin</artifactId>
>                                 <version>2.3</version>
>                                 <configuration>
>                                                 <descriptors>
>
> <descriptor>src/assemble/source.xml</descriptor>
>                                                 </descriptors>
>                                 </configuration>
>                         </plugin>
>
> I am not able to understand about goal and where to define the same.
>
> Please advice me what I am missing to make it work correctly.
>
> Thank you.
>
>
>
>
>
> -----
> Madhu
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/How-to-zip-the-source-code-separately-using-Maven-tp5721257p5721532.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to