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 251780 - Wrong .bowerrc path in Java Web project
Summary: Wrong .bowerrc path in Java Web project
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Tools (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on: 251977
Blocks:
  Show dependency tree
 
Reported: 2015-04-12 15:14 UTC by Vladimir Riha
Modified: 2015-04-22 08:38 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed fix (5.87 KB, patch)
2015-04-14 12:58 UTC, Tomas Mysik
Details | Diff
Proposed fix for Ant Web Project (8.02 KB, patch)
2015-04-16 06:18 UTC, Tomas Mysik
Details | Diff
Proposed fix for Maven (Web) Project (9.04 KB, patch)
2015-04-21 08:24 UTC, Tomas Mysik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2015-04-12 15:14:13 UTC
Please try:
 - create a new Java Web project, all default
 - create a new .bowerrc file using New File wizard

 => content in created file is 

{
    "directory": "bower_components"
}


but it should point to web folder, e.g. 

{
    "directory": "web/bower_components"
}


Thank you


Product Version: NetBeans IDE Dev (Build 201504110001)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.13.0-45-generic running on amd64; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2015-04-12 15:16:51 UTC
Similar problem is with Maven Web Project. I don't know Maven that good enough but since NetBeans can show "Web Pages" node in Projects view, .bowerrc could point to that folder as well I guess :)
Comment 2 Tomas Mysik 2015-04-14 12:58:14 UTC
Since the fix needs to be done in java.api.common module, adding Tomas to CC. Tome, is it OK to push this change? If yes, can I do it?

Thanks.
Comment 3 Tomas Mysik 2015-04-14 12:58:33 UTC
Created attachment 153188 [details]
proposed fix
Comment 4 Tomas Zezula 2015-04-15 11:08:18 UTC
Tome is it really needed.
The dependency of the java.api.common on the web.* seems suspicious to me.
The template system asks all the registered CreateFromTemplateAttributesProviders and collects all the attributes.

Other solution is to create a new WebCreateFromTemplateAttributesProviderImpl in the web module adding the webRoot attribute and register it into projects lkp (better) or global lkp (worse).
Comment 5 Tomas Mysik 2015-04-15 12:46:35 UTC
After discussion with Tomas, I will decorate class from java.api.common.

Thanks.
Comment 6 Tomas Mysik 2015-04-16 06:15:43 UTC
So, I am able to easily do it for Ant Web Project.

Unfortunately, no idea how this should be done for Maven. In Maven, TemplateAttrProvider in "maven" module is used, apparently even for Maven Web Project. So, one solution would be to simply add it there but not sure if it is correct; I don't think so, I would expect maven.j2ee to be the proper module for it. Martine, could you please advice?

Thanks.
Comment 7 Tomas Mysik 2015-04-16 06:18:43 UTC
Created attachment 153225 [details]
Proposed fix for Ant Web Project

Could be easily improved and put in j2ee.common module and used in both Ant and Maven Web projects, if needed (via @ProjectServiceProvider).
Comment 8 Tomas Mysik 2015-04-21 08:23:43 UTC
After discussion with Martin, the common TemplateAttrProvider can be improved to handle also project.webRootPath. Attaching diff.Thanks.
Comment 9 Tomas Mysik 2015-04-21 08:24:32 UTC
Created attachment 153283 [details]
Proposed fix for Maven (Web) Project
Comment 10 Tomas Mysik 2015-04-21 08:25:33 UTC
BTW the patch for Maven requires adding dependency on web.common module (which is in the ide cluster).

Thanks.
Comment 11 Tomas Mysik 2015-04-21 11:31:21 UTC
Should be fixed now, for both Ant and Maven Web Project types. Please verify, thanks.

http://hg.netbeans.org/web-main/rev/a26cb51895ff
http://hg.netbeans.org/web-main/rev/6442baa35516
Comment 12 Quality Engineering 2015-04-22 02:04:29 UTC
Integrated into 'main-silver', will be available in build *201504220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a26cb51895ff
User: Tomas Mysik <tmysik@netbeans.org>
Log: #251780 - Wrong .bowerrc path in Java Web project

Ant Web Project part.