You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jiangshachina <ji...@gmail.com> on 2006/11/18 06:22:32 UTC
Use jars in local repo or other dirs?
Hi guys,
When use Maven for building project, we must need local repository.
But what about on developing time?
For example, I'm developing a complex Web application.
When the project started, I set many dependencies in pom.xml, and use
eclipse:eclipse to make Eclipse project descriptor files.The dependencies
are set in Eclipse Java Build Path.
But I don't set all dependencies at the beginning(maybe "mission
impossible"), other jars would be added to pom.xml as dependency in the
future.
Now, my question is "how do I add the jars to Eclipse Java Build Path".
I think there are two ways:
[1]via M2_REPO, use the jars in local repository.
[2]assembly the jars in one directory, and add them to build path directory.
Generally, which one is better?
May some friends puzzle that why the question released?
In fact, the project is developed by several co-workers, different persons
may use different jars.
And only one maintains the pom files and repository.
Some one need some jars, and he/she has had them, then he/she would add jars
to build path directly(way [2]), then advice the maintainer to add the jars
to dependencies and update repository.
I think the approach is dangerous. Because one's jars may not synchronous
with corresponding artifacts(especially version) in repository.
I want know how to deal with the matter in your organization.
Thanks!
a cup of Java, cheers!
Sha Jiang
--
View this message in context: http://www.nabble.com/Use-jars-in-local-repo-or-other-dirs--tf2658390s177.html#a7415269
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: Use jars in local repo or other dirs?
Posted by Wayne Fay <wa...@gmail.com>.
My rule for projects built using Maven is "if it doesn't build using
mvn from the command line, then the build is broken."
If code is added to the project which requires a dependency, and a
corresponding pom.xml modification is not added along with it, your
project will fail to build. So I would say the developer who added
code without a corresponding update of pom.xml "broke the build".
Even if it builds in Eclipse on their machine etc, unless it builds
from the command line, its broken. So they would need to coordinate
with the maintainer to get the proper jars added to the repository and
pom.xml, and only THEN check in the code which utilizes those new
dependencies.
Wayne
On 11/17/06, jiangshachina <ji...@gmail.com> wrote:
>
> Hi guys,
> When use Maven for building project, we must need local repository.
> But what about on developing time?
>
> For example, I'm developing a complex Web application.
> When the project started, I set many dependencies in pom.xml, and use
> eclipse:eclipse to make Eclipse project descriptor files.The dependencies
> are set in Eclipse Java Build Path.
> But I don't set all dependencies at the beginning(maybe "mission
> impossible"), other jars would be added to pom.xml as dependency in the
> future.
>
> Now, my question is "how do I add the jars to Eclipse Java Build Path".
> I think there are two ways:
> [1]via M2_REPO, use the jars in local repository.
> [2]assembly the jars in one directory, and add them to build path directory.
> Generally, which one is better?
>
> May some friends puzzle that why the question released?
> In fact, the project is developed by several co-workers, different persons
> may use different jars.
> And only one maintains the pom files and repository.
> Some one need some jars, and he/she has had them, then he/she would add jars
> to build path directly(way [2]), then advice the maintainer to add the jars
> to dependencies and update repository.
> I think the approach is dangerous. Because one's jars may not synchronous
> with corresponding artifacts(especially version) in repository.
> I want know how to deal with the matter in your organization.
> Thanks!
>
> a cup of Java, cheers!
> Sha Jiang
> --
> View this message in context: http://www.nabble.com/Use-jars-in-local-repo-or-other-dirs--tf2658390s177.html#a7415269
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Use jars in local repo or other dirs?
Posted by franz see <fr...@gmail.com>.
Good day to you, Sha Jiang,
Re-do mvn eclipse:eclipse. Personally, I do not have a problem with this
since I usually do mvn eclipse:eclipse -DdownlaodSources=true (that
definition includes the sources in eclipse's .classpath so that you can step
through the code while in debug mode). And the execution time of that
command is not that long anyway unless you're downloading a new artifact.
Cheers,
Franz
jiangshachina wrote:
>
> Hi guys,
> When use Maven for building project, we must need local repository.
> But what about on developing time?
>
> For example, I'm developing a complex Web application.
> When the project started, I set many dependencies in pom.xml, and use
> eclipse:eclipse to make Eclipse project descriptor files.The dependencies
> are set in Eclipse Java Build Path.
> But I don't set all dependencies at the beginning(maybe "mission
> impossible"), other jars would be added to pom.xml as dependency in the
> future.
>
> Now, my question is "how do I add the jars to Eclipse Java Build Path".
> I think there are two ways:
> [1]via M2_REPO, use the jars in local repository.
> [2]assembly the jars in one directory, and add them to build path
> directory.
> Generally, which one is better?
>
> May some friends puzzle that why the question released?
> In fact, the project is developed by several co-workers, different persons
> may use different jars.
> And only one maintains the pom files and repository.
> Some one need some jars, and he/she has had them, then he/she would add
> jars to build path directly(way [2]), then advice the maintainer to add
> the jars to dependencies and update repository.
> I think the approach is dangerous. Because one's jars may not synchronous
> with corresponding artifacts(especially version) in repository.
> I want know how to deal with the matter in your organization.
> Thanks!
>
> a cup of Java, cheers!
> Sha Jiang
>
--
View this message in context: http://www.nabble.com/Use-jars-in-local-repo-or-other-dirs--tf2658390s177.html#a7430392
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