Skip to content

Target servers of web project are not retained when upgrading #9410

Closed

Description

@NicolaIsotta

Apache NetBeans version

Apache NetBeans 30

What happened

I have multiple apache tomcat servers and multiple maven web projects. Every projects targets one servers. When I download a new Netbeans version and import data from an older versions, the target servers of these project are not imported and they all target the first server of the list.

Language / Project Type / NetBeans Component

Maven Web application projects

How to reproduce

Import configuration from an older NB version

Did this work correctly in an earlier version?

No / Don't know

Operating System

All

JDK

All

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

I can work on this, but I need some input first.
I found out the target server of maven web projects are saved in the file var/attributes.xml (which is not imported in the migration):

  • would it be ok to migrate the file? it contains other data
  • if it's not ok, which is the right place to save server data?

Are you willing to submit a pull request?

Yes

Activity

  1. added
    kind:bug
    needs:triage
    on May 28, 2026
  2. matthiasblaesing commented on Jun 8, 2026

    @matthiasblaesing
    Contributor

    Seems the properties for deployment are spread over two files:

    • inside the project I find a nb-configuration.xml which holds:
      <?xml version="1.0" encoding="UTF-8"?>
      <project-shared-configuration>
          <!--
      This file contains additional configuration written by modules in the NetBeans IDE.
      The configuration is intended to be shared among all the users of project and
      therefore it is assumed to be part of version control checkout.
      Without this configuration present, some functionality in the IDE may be limited or fail altogether.
      -->
          <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
              <!--
      Properties that influence various parts of the IDE, especially code formatting and the like. 
      You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
      That way multiple projects can share the same settings (useful for formatting rules for example).
      Any value defined here will override the pom.xml file value but is only applicable to the current project.
      -->
              <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>10-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
              <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
              <org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
          </properties>
      </project-shared-configuration>
    • in the attributes.xml I find the attribute AuxilaryConfiguration for the project directory, after decoding:
      <?xml version="1.0" encoding="UTF-8"?>
      <project-private>
          <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
              <org-netbeans-modules-maven-j2ee.netbeans_2e_deployment_2e_server_2e_id>tomcat101:home=/home/matthias/bin/apache-tomcat-10</org-netbeans-modules-maven-j2ee.netbeans_2e_deployment_2e_server_2e_id>
              <org-netbeans-modules-maven-j2ee.netbeans_2e_selected_2e_browser>default</org-netbeans-modules-maven-j2ee.netbeans_2e_selected_2e_browser>
          </properties>
      </project-private>
      

    I think the implementation can be found in org.netbeans.modules.maven.j2ee.JavaEEProjectSettingsImpl. I see there settings for the profile and the server id. And that makes sense to me:

    • the target server is dependend on the local installation, so it is stored in the users preferences outside the project
    • the target profile ("Jakarta EE 10") is a setting that is shared and thus stored in the project

    The property names that are the basis for the xml elements can be found in org.netbeans.modules.maven.j2ee.MavenJavaEEConstants.

    Not sure if that is really helpful. The original question was "Should var/attributes.xml be migrateable"? Looking at the above data and the also the data I saw in my normal runtime var/attributes.xml, I think yes, it would make sense.

  3. NicolaIsotta commented on Jun 9, 2026

    @NicolaIsotta
    ContributorAuthor

    I've checked my attributes.xml. In addition to the server entries, some are like this one:

    <fileobject name="C:|Users|xxx|AppData|Local|NetBeans|Cache|30|index|s157|java|16|gensrc|lombok|extern|log4j|Log4j2.java">
        <attr name="classfile-binaryName" stringvalue="lombok/extern/log4j/Log4j2"/>
        <attr name="classfile-root" urlvalue="jar:file:/C:/Users/xxx/.m2/repository/org/projectlombok/lombok/1.18.46/lombok-1.18.46.jar!/"/>
        <attr name="classfile-sourcefile" stringvalue="Log4j2.java"/>
        <attr name="disable-java-errors" boolvalue="true"/>
        <attr name="origin-hash" stringvalue="E9ADC3FA4CBE336B93779FA5484E8CA4"/>
    </fileobject>

    Is it safe to migrate, considering the hardcoded cache path?
    I'll make some tests

  4. matthiasblaesing commented on Jun 9, 2026

    @matthiasblaesing
    Contributor

    @NicolaIsotta you make a valid point. On the one hand I saw attributes that give me thought (as you mentioned references into cache), on the other hand there are attributes that should be migrated because people expect attributes you set once to be carried over.

    TL;DR: I think this needs testing.

  5. added
    Java EE/Jakarta EE
    enterprise
    and removed
    needs:triage
    on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java EE/Jakarta EEenterprisekind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions