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 201235 - Changes in files are not saved
Summary: Changes in files are not saved
Status: RESOLVED INVALID
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 99588
  Show dependency tree
 
Reported: 2011-08-23 06:42 UTC by meme
Modified: 2011-11-09 22:43 UTC (History)
0 users

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 meme 2011-08-23 06:42:52 UTC
I've got a maven project which uses the android plugin. When I try to edit the files main.xml and strings.xml (which are in res/layout and res/values) the changes are not saved.
This happens on a windows 7 (64bit) (Java 7) workstation and I could reproduce this behaviour on an Ubuntu 11.04 with Netbeans 7.0.1 (Java 6).

To reproduce follow these steps:
a) Create a maven project using this archetype: https://github.com/akquinet/android-archetypes/wiki/Android-release-archetype
b) Import the project in NB
c) try to edit strings.xml or main.xml (which are located under "Generated Sources (combined-resources)" (Yes, these are these which can be edited.)

When I do the changes using an vi on the commandline everything works as expected. When doing this in Netbeans nothing changes but the file is shown as "saved" in the tabs. I've also tried to delete the file and recreate them with netbeans. Everything works, but when I try to change the created files the same happens (no changes).

I haven't found any entries in the logs, regarding errors, exceptions, et al.


Marc
Comment 1 meme 2011-08-24 06:45:44 UTC
There is one workaround: When opening the files from the files-explorer (files-tab) then I'm able to save these files correctly.

I think it has to do with the maven plugin which might not allow to write to files in generated-source.
Comment 2 Jesse Glick 2011-08-24 18:19:06 UTC
(In reply to comment #0)
> a) Create a maven project using this archetype:
> https://github.com/akquinet/android-archetypes/wiki/Android-release-archetype
> b) Import the project in NB

I just used the IDE's File > New Project > Maven > Archetype > Add, but OK.

> c) try to edit strings.xml or main.xml (which are located under "Generated
> Sources (combined-resources)"

OK, I edited them and I saved them. So what?

> (Yes, these are these which can be edited.)

These are generated files under the target/ dir, so of course they will be clobbered every time you do a build. Perhaps you meant to edit the corresponding source files under the res/ dir?

(The Android plugin apparently does not follow Maven conventions for project layout, or else the IDE would display a node in the Projects tab under "Other Sources" for your resources. As it is, you can only get to res/ via the Files tab.)

Note that the IDE includes no special support for Maven Android projects; see: http://kenai.com/jira/browse/NBANDROID-119
Comment 3 meme 2011-08-25 06:45:56 UTC
(In reply to comment #2)
> These are generated files under the target/ dir, so of course they will be
> clobbered every time you do a build. Perhaps you meant to edit the
> corresponding source files under the res/ dir?

Ahhh... I thought the directories have been the ones in res/... Sorry for that.

> 
> (The Android plugin apparently does not follow Maven conventions for project
> layout, or else the IDE would display a node in the Projects tab under "Other
> Sources" for your resources. As it is, you can only get to res/ via the Files
> tab.)
> 
> Note that the IDE includes no special support for Maven Android projects; see:
> http://kenai.com/jira/browse/NBANDROID-119

Yes of course. Now I've got an easier solution than switching always to "files"-section:

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>res/</directory>
                <excludes>
                    <exclude>**/*</exclude>
                </excludes>
            </resource>
        </resources>
        ...
    </build>

Within the ide everything looks great. Now I've got to check if everything else is also working. ;)

Thanks for the hints.

m.
Comment 4 Jesse Glick 2011-08-25 16:45:18 UTC
(In reply to comment #3)
>             <resource>
>                 <directory>res/</directory>
>                 <excludes>
>                     <exclude>**/*</exclude>
>                 </excludes>
>             </resource>

OK, sort of a hack but should work so long as I do not implement bug #99588.