You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by tim tim <ti...@googlemail.com> on 2008/11/10 18:35:40 UTC

using the maven-source-plugin

hello all,

i have problems using the maven-source-plugin.
the problem is that when i call

> mvn install

the project is build and deployed into my local repository, but the
sources are not.

i am following the instructions  "Installing the sources along with
your artifact"
on

 http://maven.apache.org/plugins/maven-source-plugin/usage.html

and hence the build section of my pom looks like this:
  <build>
	    <pluginManagement>
		    <plugins>
			    <plugin>
				    <groupId>org.apache.maven.plugins</groupId>
				    <artifactId>maven-eclipse-plugin</artifactId>
				    <version>2.4</version>
				    <configuration>
					    <downloadSources>true</downloadSources>
					    <downloadJavadocs>true</downloadJavadocs>
				    </configuration>
			    </plugin>
			    <plugin>
				    <groupId>org.apache.maven.plugins</groupId>
				    <artifactId>maven-dependency-plugin</artifactId>
			    </plugin>

			    <plugin>
				    <groupId>org.apache.maven.plugins</groupId>
				    <artifactId>maven-source-plugin</artifactId>
				    <executions>
					    <execution>
						    <id>attach-sources</id>
						    <phase>verify</phase>
						    <goals>
							    <goal>jar</goal>
						    </goals>
					    </execution>
				    </executions>
			    </plugin>
		    </plugins>
	    </pluginManagement>

    </build>

thanks a lot, tim

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


Re: using the maven-source-plugin

Posted by Baptiste MATHUS <ml...@batmat.net>.
Here's what I have in my pom.xml. Works fine :
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Cheers.

2008/11/10 tim tim <ti...@googlemail.com>

> hello all,
>
> i have problems using the maven-source-plugin.
> the problem is that when i call
>
> > mvn install
>
> the project is build and deployed into my local repository, but the
> sources are not.
>
> i am following the instructions  "Installing the sources along with
> your artifact"
> on
>
>  http://maven.apache.org/plugins/maven-source-plugin/usage.html
>
> and hence the build section of my pom looks like this:
>  <build>
>            <pluginManagement>
>                    <plugins>
>                            <plugin>
>
>  <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-eclipse-plugin</artifactId>
>                                    <version>2.4</version>
>                                    <configuration>
>
>  <downloadSources>true</downloadSources>
>
>  <downloadJavadocs>true</downloadJavadocs>
>                                    </configuration>
>                            </plugin>
>                            <plugin>
>
>  <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-dependency-plugin</artifactId>
>                            </plugin>
>
>                            <plugin>
>
>  <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-source-plugin</artifactId>
>                                    <executions>
>                                            <execution>
>                                                    <id>attach-sources</id>
>                                                    <phase>verify</phase>
>                                                    <goals>
>                                                            <goal>jar</goal>
>                                                    </goals>
>                                            </execution>
>                                    </executions>
>                            </plugin>
>                    </plugins>
>            </pluginManagement>
>
>    </build>
>
> thanks a lot, tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: using the maven-source-plugin

Posted by Wayne Fay <wa...@gmail.com>.
> and hence the build section of my pom looks like this:
>  <build>
>            <pluginManagement>
>                    <plugins>
>                            <plugin>
>                                    <groupId>org.apache.maven.plugins</groupId>
>                                    <artifactId>maven-eclipse-plugin</artifactId>

You need to also add those plugins into the build section itself. One
fix would be to simply delete the <pluginManagement> at the top and
corresponding close node.

PluginManagement simply allows you to manage plugins with a shared
configuration across multiple projects for example. Without declaring
the plugins themselves in the build, those configurations are not
inherited into this specific build, and thuse are ignored.

If you check the page you sent, you'll see the plugin node is directly
inside build, not in pluginManagement as you have configured.

Wayne

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