You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by BenDave <bd...@gmail.com> on 2008/05/16 16:34:21 UTC

Maven 2 Dependency on java source folder rather than jar file

Hi,

I am working on 2 projects, one is Dependant on the other. The usual way of
dealing with this is to add a dependency to a jar file located in the
repository. This works fine but the source project (on which the target
project depends) is constantly evolving, as we are doing some iterative
development. The source and target project are modified at the same time.
Consequently i don't want to work off a jar file of the source project,
because generating jar files and deploying them to the repository takes too
long (only 20 seconds but it adds up when this is done dozens / hundreds of
times per day ). 
I do not want to merge these two projects into one as the source is a common
project and is being used by other projects too, I need these two projects
to be distinct.

So the solution is to indicate to maven a source folder which the target
project depends on rather than a JAR file.

Can this be achieved ?

Thanks,

-- 
View this message in context: http://www.nabble.com/Maven-2-Dependency-on-java-source-folder-rather-than-jar-file-tp17276237p17276237.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Maven 2 Dependency on java source folder rather than jar file

Posted by BenDave <bd...@gmail.com>.
Thanks for all your answers, the only problem with this is that I am using
other eclipse plugins as part of my iterative build. For instance I use the
hibernate plugin in my POM file. This means that although eclipse will be
aware of the source dependency, the POM file is not. So it is true that this
solution is effective for compilation. However, any plugins defined in the
POM file will not be aware of it and still build off the JAR file :-(. There
is a workaround for this, which consists in using ant tasks as part of the
development rather that using the maven plugins. However this means that for
development I do not rely on maven at all, which defeats its purpose.

Thanks,


Thierry Lach-2 wrote:
> 
> This may not work for you, but I use Eclipse with the Maven plugin (
> http://m2eclipse.codehaus.org/) which will automatically do what you are
> asking with other dependent projects open in the workspace.
> 
> On Fri, May 16, 2008 at 10:34 AM, BenDave <bd...@gmail.com> wrote:
> 
>>
>> Hi,
>>
>> I am working on 2 projects, one is Dependant on the other. The usual way
>> of
>> dealing with this is to add a dependency to a jar file located in the
>> repository. This works fine but the source project (on which the target
>> project depends) is constantly evolving, as we are doing some iterative
>> development. The source and target project are modified at the same time.
>> Consequently i don't want to work off a jar file of the source project,
>> because generating jar files and deploying them to the repository takes
>> too
>> long (only 20 seconds but it adds up when this is done dozens / hundreds
>> of
>> times per day ).
>> I do not want to merge these two projects into one as the source is a
>> common
>> project and is being used by other projects too, I need these two
>> projects
>> to be distinct.
>>
>> So the solution is to indicate to maven a source folder which the target
>> project depends on rather than a JAR file.
>>
>> Can this be achieved ?
>>
>> Thanks,
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-2-Dependency-on-java-source-folder-rather-than-jar-file-tp17276237p17276237.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-2-Dependency-on-java-source-folder-rather-than-jar-file-tp17276237p17313164.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: Maven 2 Dependency on java source folder rather than jar file

Posted by Thierry Lach <th...@gmail.com>.
This may not work for you, but I use Eclipse with the Maven plugin (
http://m2eclipse.codehaus.org/) which will automatically do what you are
asking with other dependent projects open in the workspace.

On Fri, May 16, 2008 at 10:34 AM, BenDave <bd...@gmail.com> wrote:

>
> Hi,
>
> I am working on 2 projects, one is Dependant on the other. The usual way of
> dealing with this is to add a dependency to a jar file located in the
> repository. This works fine but the source project (on which the target
> project depends) is constantly evolving, as we are doing some iterative
> development. The source and target project are modified at the same time.
> Consequently i don't want to work off a jar file of the source project,
> because generating jar files and deploying them to the repository takes too
> long (only 20 seconds but it adds up when this is done dozens / hundreds of
> times per day ).
> I do not want to merge these two projects into one as the source is a
> common
> project and is being used by other projects too, I need these two projects
> to be distinct.
>
> So the solution is to indicate to maven a source folder which the target
> project depends on rather than a JAR file.
>
> Can this be achieved ?
>
> Thanks,
>
> --
> View this message in context:
> http://www.nabble.com/Maven-2-Dependency-on-java-source-folder-rather-than-jar-file-tp17276237p17276237.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>

Re: Maven 2 Dependency on java source folder rather than jar file

Posted by nicolas de loof <ni...@apache.org>.
If you are using Eclipse, this is allready supported by the
maven-eclipse-plugin : project dependencies are set as workspace project
dependencies in place of jars, so that you can code and test under eclipse
with no jar to install.

I also use the sysdeo-tomcat-maven-plugin from mojo to avoid creation of a
war to test webapp under Tomcat.

Nicolas.

2008/5/16 BenDave <bd...@gmail.com>:

>
> Hi,
>
> I am working on 2 projects, one is Dependant on the other. The usual way of
> dealing with this is to add a dependency to a jar file located in the
> repository. This works fine but the source project (on which the target
> project depends) is constantly evolving, as we are doing some iterative
> development. The source and target project are modified at the same time.
> Consequently i don't want to work off a jar file of the source project,
> because generating jar files and deploying them to the repository takes too
> long (only 20 seconds but it adds up when this is done dozens / hundreds of
> times per day ).
> I do not want to merge these two projects into one as the source is a
> common
> project and is being used by other projects too, I need these two projects
> to be distinct.
>
> So the solution is to indicate to maven a source folder which the target
> project depends on rather than a JAR file.
>
> Can this be achieved ?
>
> Thanks,
>
> --
> View this message in context:
> http://www.nabble.com/Maven-2-Dependency-on-java-source-folder-rather-than-jar-file-tp17276237p17276237.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>

Re: Maven 2 Dependency on java source folder rather than jar file

Posted by Manuel EVENO <ma...@gmail.com>.
Why don't you simply checkout the two projects and make a Eclipse dependency
between them ? Just for dev purpose of course, keep the maven dependency
configuration) ..

Manuel

On Fri, May 16, 2008 at 4:34 PM, BenDave <bd...@gmail.com> wrote:

>
> Hi,
>
> I am working on 2 projects, one is Dependant on the other. The usual way of
> dealing with this is to add a dependency to a jar file located in the
> repository. This works fine but the source project (on which the target
> project depends) is constantly evolving, as we are doing some iterative
> development. The source and target project are modified at the same time.
> Consequently i don't want to work off a jar file of the source project,
> because generating jar files and deploying them to the repository takes too
> long (only 20 seconds but it adds up when this is done dozens / hundreds of
> times per day ).
> I do not want to merge these two projects into one as the source is a
> common
> project and is being used by other projects too, I need these two projects
> to be distinct.
>
> So the solution is to indicate to maven a source folder which the target
> project depends on rather than a JAR file.
>
> Can this be achieved ?
>
> Thanks,
>
> --
> View this message in context:
> http://www.nabble.com/Maven-2-Dependency-on-java-source-folder-rather-than-jar-file-tp17276237p17276237.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>



-- 
Xebia IT Architects
Mail: meveno@xebia.fr
Mobile: +33 6 13 43 59 92
Xebia blogue ! http://blog.xebia.fr