NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
shymon Posted via mailing list.
|
Posted: Wed Sep 09, 2009 10:38 am Post subject: Netbeans 6.7 and Maven repositories |
|
|
I'm using NB 6.7 and Maven 2.2.1.
I have configured central repository and java.net repository (in maven
repositories window).
In my current project I want to use Jersey which is only in java.net repo.
I can add dependency but while building app maven looks for dependencies
only in central repo - build failed because jersey-server artifact was not
found.
Then I have manually added java.net repo definition to the pom.xml and
project was built without any problems.
But now I wonder if it is the only way? If I can configure many repositories
from Netbeans GUI level, why those repositories are not added to the
pom.xml. What am I missing? Do I have to edit pom.xml file myself?
--
View this message in context: http://www.nabble.com/Netbeans-6.7-and-Maven-repositories-tp25362356p25362356.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com. |
|
| Back to top |
|
 |
Ed Hillmann Posted via mailing list.
|
Posted: Wed Sep 09, 2009 10:16 pm Post subject: Netbeans 6.7 and Maven repositories |
|
|
On Wed, Sep 9, 2009 at 8:38 PM, shymon <address-removed ([email]address-removed[/email])> wrote:
| Quote: |
I'm using NB 6.7 and Maven 2.2.1.
I have configured central repository and java.net repository (in maven
repositories window).
In my current project I want to use Jersey which is only in java.net repo.
I can add dependency but while building app maven looks for dependencies
only in central repo - build failed because jersey-server artifact was not
found.
Then I have manually added java.net repo definition to the pom.xml and
project was built without any problems.
But now I wonder if it is the only way? If I can configure many repositories
from Netbeans GUI level, why those repositories are not added to the
pom.xml. What am I missing? Do I have to edit pom.xml file myself?
| Setting up the Maven repositories in NetBeans allows you to view the contents of the repositories from within NetBeans, but you're still deferring the dependency resolution to Maven. |
|
| Back to top |
|
 |
shymon Posted via mailing list.
|
Posted: Thu Sep 10, 2009 10:34 am Post subject: Netbeans 6.7 and Maven repositories |
|
|
Thanks a lot for your answer!
Maven is rather new to me and I didn't understand all it's principles.
Now I know a little bit more :)
Thanks once more
--
View this message in context: http://www.nabble.com/Netbeans-6.7-and-Maven-repositories-tp25362356p25380919.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com. |
|
| Back to top |
|
 |
Dafe Simonek Posted via mailing list.
|
Posted: Thu Sep 10, 2009 10:57 am Post subject: Netbeans 6.7 and Maven repositories |
|
|
Hello Ed,
Thanks for answering, I think that mkleint (Milos Kleint), author of
vast majority of Maven support in NB will be very pleased to read your
answer, because from the start he followed basic principle to not
interfere with Maven tool and let it drive the show.
Btw your ideas in last two paragraphs seems interesting, something like
that would be useful. But some questions remain - for example current
Repositories window is global, while displaying repositories defined in
pom would be context sensitive, and mixing those two types of
information may be confusing. Anyway, it might be worth to record such
ideas in enhancement request...
Dafe
Ed Hillmann wrote:
| Quote: | On Wed, Sep 9, 2009 at 8:38 PM, shymon <address-removed
<mailto:address-removed>> wrote:
I'm using NB 6.7 and Maven 2.2.1.
I have configured central repository and java.net
<http://java.net> repository (in maven
repositories window).
In my current project I want to use Jersey which is only in
java.net <http://java.net> repo.
I can add dependency but while building app maven looks for
dependencies
only in central repo - build failed because jersey-server artifact
was not
found.
Then I have manually added java.net <http://java.net> repo
definition to the pom.xml and
project was built without any problems.
But now I wonder if it is the only way? If I can configure many
repositories
from Netbeans GUI level, why those repositories are not added to the
pom.xml. What am I missing? Do I have to edit pom.xml file myself?
Setting up the Maven repositories in NetBeans allows you to view the
contents of the repositories from within NetBeans, but you're still
deferring the dependency resolution to Maven. While NetBeans supports
Maven projects (quite nicely, IMO), it's still letting the Maven
plugins control the show, not NetBeans. And I'm quite fine with that.
When you had the repositories in NetBeans but not in the pom.xml file,
Maven still didn't know about the new repository. Because Maven
doesn't use NetBeans. By keeping these definitions in Maven, the
build is more portable. You can build from within NetBeans, you can
also build from the command-line, or any other process that supports
Maven (eg, Hudson).
Plus, you can add additional repositories more than one way. You
don't have to add it to the pom.xml file, you can use settings and
profiles to include additional repositories that will be used when
processing dependencies. So, while NetBeans does make the setting.xml
available, it can't know automatically how you want to set it up.
Maybe a good compromise would be to pick a repository in the NetBeans
Repositories Window and provide an option to add the repository to the
project file or to the settings file? This way, you can explicitly
add items to your project.
Although I think a better option would be for the Repositories Window
to display the repositories defined by the pom/settings automatically,
rather than having to manually add them to the window.
Thanks,
Ed |
|
|
| Back to top |
|
 |
Ed Hillmann Posted via mailing list.
|
Posted: Thu Sep 10, 2009 9:47 pm Post subject: Netbeans 6.7 and Maven repositories |
|
|
On Thu, Sep 10, 2009 at 8:56 PM, Dafe Simonek <address-removed ([email]address-removed[/email])> wrote:
| Quote: | Hello Ed,
Thanks for answering, I think that mkleint (Milos Kleint), author of vast majority of Maven support in NB will be very pleased to read your answer, because from the start he followed basic principle to not interfere with Maven tool and let it drive the show.
Btw your ideas in last two paragraphs seems interesting, something like that would be useful. But some questions remain - for example current Repositories window is global, while displaying repositories defined in pom would be context sensitive, and mixing those two types of information may be confusing. Anyway, it might be worth to record such ideas in enhancement request...
Dafe
|
Thanks Dafe. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|