You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by rohit aman <ro...@gmail.com> on 2008/02/15 02:05:09 UTC
rltd to maven sources plugin - adding java sources jar to class path
Hi,
I recently started using gwt in my struts project. We use maven as a
project management tool. Since GWT needs java sources to be in the class
path for it to compile the java files and my gwt module uses other module
java classes, I thought of trying "maven sources plugin" to generate the
source files jars for all the modules of my project. the maven plugin
creates one jar file for .class file and one for .java file...
so for ex ... if there is a project called "java-proj" , the plugin will
create
com/my/company/java-proj/1.0-SNAPSHOT/java-proj-1.0-SNAPSHOT.jar
com/my/company/java-proj/1.0-SNAPSHOT/java-proj-1.0-SNAPSHOT-sources.jar
now if my gwt project uses some classes from the above project so I need to
define the dependency...
for classes I can say
<dependency>
<groupId>com.my.company</groupId>
<artifactId>java-proj</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
and it looks for java-proj-1.0-SNAPSHOT.jar in
com/my/company/java-proj/1.0-SNAPSHOT/ directory
but I am not able to figure out how to define the dependency on source file
because if I say
<dependency>
<groupId>com.my.company</groupId>
<artifactId>java-proj</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
it looks for java-proj-1.0-SNAPSHOT-sources.jar in
com/my/company/java-proj/1.0-SNAPSHOT-sources but the jar is in
com/my/company/java-proj/1.0-SNAPSHOT.
Any idea on how to define dependency on "java-proj-1.0-SNAPSHOT-sources.jar"
which not in "com/my/company/java-proj/1.0-SNAPSHOT-sources" but in
"com/my/company/java-proj/1.0-SNAPSHOT-sources "
Any input is appreciated
Thanks
Re: rltd to maven sources plugin - adding java sources jar to class path
Posted by Wayne Fay <wa...@gmail.com>.
Add <classifier>sources</classifier> to your dependency declaration as needed.
Wayne
On 2/14/08, rohit aman <ro...@gmail.com> wrote:
> Hi,
>
> I recently started using gwt in my struts project. We use maven as a
> project management tool. Since GWT needs java sources to be in the class
> path for it to compile the java files and my gwt module uses other module
> java classes, I thought of trying "maven sources plugin" to generate the
> source files jars for all the modules of my project. the maven plugin
> creates one jar file for .class file and one for .java file...
>
> so for ex ... if there is a project called "java-proj" , the plugin will
> create
>
> com/my/company/java-proj/1.0-SNAPSHOT/java-proj-1.0-SNAPSHOT.jar
> com/my/company/java-proj/1.0-SNAPSHOT/java-proj-1.0-SNAPSHOT-sources.jar
>
> now if my gwt project uses some classes from the above project so I need to
> define the dependency...
>
> for classes I can say
> <dependency>
> <groupId>com.my.company</groupId>
> <artifactId>java-proj</artifactId>
> <version>1.0-SNAPSHOT</version>
> </dependency>
> and it looks for java-proj-1.0-SNAPSHOT.jar in
> com/my/company/java-proj/1.0-SNAPSHOT/ directory
>
> but I am not able to figure out how to define the dependency on source file
> because if I say
>
> <dependency>
> <groupId>com.my.company</groupId>
> <artifactId>java-proj</artifactId>
> <version>1.0-SNAPSHOT</version>
> </dependency>
>
> it looks for java-proj-1.0-SNAPSHOT-sources.jar in
> com/my/company/java-proj/1.0-SNAPSHOT-sources but the jar is in
> com/my/company/java-proj/1.0-SNAPSHOT.
> Any idea on how to define dependency on "java-proj-1.0-SNAPSHOT-sources.jar"
> which not in "com/my/company/java-proj/1.0-SNAPSHOT-sources" but in
> "com/my/company/java-proj/1.0-SNAPSHOT-sources "
>
> Any input is appreciated
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org