This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228780 - Can't add runtime library to Maven project.
Summary: Can't add runtime library to Maven project.
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-19 19:44 UTC by Goober
Modified: 2013-05-30 13:34 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Goober 2013-04-19 19:44:26 UTC
Instructions on adding a runtime library to a project refer to the Run-Time Libraries list in the Project Properties window. For a Maven project, there appears to be no such list.

Note: the need is for a runtime library, not a build-time library. So the dependency is NOT listed in the POM, and it is NOT to be added to the POM.
Comment 1 Goober 2013-04-19 19:55:47 UTC
To be more precise:

Referring to the section called "Setting the Runtime Classpath" at https://netbeans.org/kb/docs/java/project-setup.html:

"To add projects, libraries, JAR files, and folders to the project's runtime classpath, use the buttons on the right side of the Run-time Libraries list in the Project Properties dialog box.

"If your project uses special libraries dynamically at runtime through an indirect interface or reflection (like JDBC drivers or JAXP implementations), you have to add these libraries to the runtime classpath. You also have to adjust your runtime classpath if the runtime dependencies between your projects do not match the compilation dependencies between the projects. For example, imagine that project A compiles against project B, and project B compiles against project C, but project A does not compile against project C. This means that project A only has project B on its runtime classpath. If project A requires both project B and project C during execution, you have to add project C to project A's runtime classpath."
Comment 2 Milos Kleint 2013-04-20 09:37:42 UTC
runtime dependencies are added just like compile dependencies or test dependencies to the pom. That's not done in the project properties but right clicking on any of the Dependencies nodes in project view and selecting Runtime scope.

https://netbeans.org/kb/docs/java/project-setup.html refers to ant based projects and is irrelevant for maven project UI.


everything appears to be working for me correctly (as designed), closing as worksforme, please consult the maven documentation on the runtime scope dependencies.
Comment 3 Goober 2013-04-20 14:20:24 UTC
Thank you for the reminder about Maven runtime scope.

There seems to be no Dependencies node in project view. This is perhaps because this is a "parent POM", and it includes no dependencies. So I am reopening this issue.
Comment 4 Milos Kleint 2013-04-20 17:02:46 UTC
http://hg.netbeans.org/core-main/rev/0514885f320f

apparently the previous maintainer changed the behaviour, in older versions the compile Dependencies node was always shown. I've changed it back to always show when there is no other node to show.

please note that to get the Add Dependency dialog shown you can also use the Insert Code... action in pom.xml editor.
Comment 5 Goober 2013-04-20 17:09:45 UTC
No doubt. I can also use vi. :-)

Thank you!
Comment 6 Quality Engineering 2013-04-22 02:03:09 UTC
Integrated into 'main-golden', will be available in build *201304212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0514885f320f
User: Milos Kleint <mkleint@netbeans.org>
Log: #228780 in projects without any dependencies node, always add teh compile time deps node even if empty, so that people can add dependencies from popup.
Comment 7 Tomas Danek 2013-05-02 09:37:12 UTC
verified in Product Version: NetBeans IDE Dev (Build 201304292301)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.3 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev

please backport.
Comment 8 Milos Kleint 2013-05-03 12:41:30 UTC
http://hg.netbeans.org/releases/rev/97c44a5aac61
Comment 9 Quality Engineering 2013-05-05 00:26:46 UTC
Integrated into 'releases', will be available in build *201305042200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/97c44a5aac61
User: Milos Kleint <mkleint@netbeans.org>
Log: #228780 in projects without any dependencies node, always add teh compile time deps node even if empty, so that people can add dependencies from popup. -  merge into release73
Comment 10 Tomas Danek 2013-05-10 08:18:17 UTC
Verified in 7.3 + patch 2
Product Version: NetBeans IDE 7.3.1 (Build 201305082200)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.3 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.3
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.3
Comment 11 Tomas Danek 2013-05-30 13:26:34 UTC
unfortunately,  this fix is causing regression bug 230525. For 7.3.1, this fix will be reverted. For trunk, new bug 230532 has been filed to find some solution that would try to make everyone happy.
Comment 12 Jiri Rechtacek 2013-05-30 13:34:23 UTC
Due to some unexpected consequences in UI, is was fixed in 7.4 only, not for 7.3.1.