apache / apache/netbeans

Delete does not completely remove references to the deleted project.

Open
#7,987 3 comments 0 reactions 0 assignees View on GitHub
Ant Contribution welcome kind:bug kind:feature
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 23

### What happened

I created a new "Musician" project "Java with Ant" -> "Java Enterprise" -> "Enterprise Application Client", adding it with "Add to Enterprise Application" to an Ant Enterprise Application "Orchestra". Deleting afterwards the project "Musician", with the option "Also delete sources" does not remove all references to "Musician" from the following files: project.xml and project.properties. The directory ot the "Musician" project was correctly deleted.

project.xml after deleting the "Musician" project:

```xml

org.netbeans.modules.j2ee.earproject


Orchestra
1.6.5



${reference.Orchestra-war.dist-ear}
/


${reference.Orchestra-ejb.dist-ear}
/

**
${reference.Musician.j2ee-module-car}
/
**



**
Musician
j2ee_ear_archive
build.xml
dist-ear
clean-ear
j2ee-module-car
**

Orchestra-ejb
j2ee_ear_archive
build.xml
dist-ear
clean-ear
dist-ear


Orchestra-war
j2ee_ear_archive
build.xml
dist-ear
clean-ear
dist-ear


```

project.properties after deleting the "Musician" project:

```ini
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
build.dir=build
build.generated.dir=${build.dir}/generated
client.module.uri=Orchestra-war
client.urlPart=
debug.classpath=${javac.classpath}::${jar.content.additional}:${run.classpath}
display.browser=true
dist.dir=dist
dist.jar=${dist.dir}/${jar.name}
endorsed.classpath=
j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args}
j2ee.compile.on.save=true
j2ee.deploy.on.save=false
j2ee.platform=10
j2ee.platform.classpath=${j2ee.server.home}/modules/jakarta.activation-api.jar:${j2ee.server.home}/modules/jakarta.annotation-api.jar:${j2ee.server.home}/modules/jakarta.authentication-api.jar:${j2ee.server.home}/modules/jakarta.authorization-api.jar:${j2ee.server.home}/modules/jakarta.batch-api.jar:${j2ee.server.home}/modules/jakarta.ejb-api.jar:${j2ee.server.home}/modules/jakarta.el-api.jar:${j2ee.server.home}/modules/jakarta.enterprise.cdi-api.jar:${j2ee.server.home}/modules/jakarta.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/jakarta.enterprise.concurrent.jar:${j2ee.server.home}/modules/jakarta.enterprise.lang-model.jar:${j2ee.server.home}/modules/jakarta.faces.jar:${j2ee.server.home}/modules/jakarta.inject-api.jar:${j2ee.server.home}/modules/jakarta.interceptor-api.jar:${j2ee.server.home}/modules/jakarta.jms-api.jar:${j2ee.server.home}/modules/jakarta.json-api.jar:${j2ee.server.home}/modules/jakarta.json.bind-api.jar:${j2ee.server.home}/modules/jakarta.mail-api.jar:${j2ee.server.home}/modules/jakarta.mvc-api.jar:${j2ee.server.home}/modules/jakarta.persistence-api.jar:${j2ee.server.home}/modules/jakarta.resource-api.jar:${j2ee.server.home}/modules/jakarta.security.enterprise-api.jar:${j2ee.server.home}/modules/jakarta.security.enterprise.jar:${j2ee.server.home}/modules/jakarta.servlet-api.jar:${j2ee.server.home}/modules/jakarta.servlet.jsp-api.jar:${j2ee.server.home}/modules/jakarta.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/jakarta.transaction-api.jar:${j2ee.server.home}/modules/jakarta.validation-api.jar:${j2ee.server.home}/modules/jakarta.websocket-api.jar:${j2ee.server.home}/modules/jakarta.websocket-client-api.jar:${j2ee.server.home}/modules/jakarta.ws.rs-api.jar:${j2ee.server.home}/modules/jakarta.xml.bind-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=gfv700ee10
jar.compress=false
jar.content.additional=\
${reference.Orchestra-war.dist-ear}:\
${reference.Orchestra-ejb.dist-ear}:\
**${reference.Musician.j2ee-module-car}**
javac.debug=true
javac.deprecation=false
javac.source=17
javac.target=17
meta.inf=src/conf
no.dependencies=false
platform.active=default_platform
**project.Musician=../Musician**
project.Orchestra-ejb=Orchestra-ejb
project.Orchestra-war=Orchestra-war
**reference.Musician.j2ee-module-car=${project.Musician}/dist/Musician.jar**
reference.Orchestra-ejb.dist-ear=${project.Orchestra-ejb}/dist/Orchestra-ejb.jar
reference.Orchestra-war.dist-ear=${project.Orchestra-war}/dist/Orchestra-war.war
resource.dir=setup
run.classpath=
source.root=.
```

### Language / Project Type / NetBeans Component

Java / Ant Enterprise Application Client / Jakarta 10

### How to reproduce

Create an Ant Java Enterprise Application. Add to it an Ant Java Enterprise Application Client. Then, delete the brand new Java Enterprise Application Client. You will find the old references to the deleted client project in some files like project.xml and project.properties.

```xml

org.netbeans.modules.j2ee.earproject


Orchestra
1.6.5



${reference.Orchestra-war.dist-ear}
/


${reference.Orchestra-ejb.dist-ear}
/


${reference.Musician.j2ee-module-car}
/




**
Musician
j2ee_ear_archive
build.xml
dist-ear
clean-ear
j2ee-module-car
**

Orchestra-ejb
j2ee_ear_archive
build.xml
dist-ear
clean-ear
dist-ear


Orchestra-war
j2ee_ear_archive
build.xml
dist-ear
clean-ear
dist-ear


/reference>

```

project.properties
```ini
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
build.dir=build
build.generated.dir=${build.dir}/generated
client.module.uri=Orchestra-war
client.urlPart=
debug.classpath=${javac.classpath}::${jar.content.additional}:${run.classpath}
display.browser=true
dist.dir=dist
dist.jar=${dist.dir}/${jar.name}
endorsed.classpath=
j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args}
j2ee.compile.on.save=true
j2ee.deploy.on.save=false
j2ee.platform=10
j2ee.platform.classpath=
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=gfv700ee10
jar.compress=false
jar.content.additional=\
${reference.Orchestra-war.dist-ear}:\
${reference.Orchestra-ejb.dist-ear}:\
${reference.Musician.j2ee-module-car}
javac.debug=true
javac.deprecation=false
javac.source=17
javac.target=17
meta.inf=src/conf
no.dependencies=false
platform.active=default_platform
project.Musician=../Musician
project.Orchestra-ejb=Orchestra-ejb
project.Orchestra-war=Orchestra-war
reference.Musician.j2ee-module-car=${project.Musician}/dist/Musician.jar
reference.Orchestra-ejb.dist-ear=${project.Orchestra-ejb}/dist/Orchestra-ejb.jar
reference.Orchestra-war.dist-ear=${project.Orchestra-war}/dist/Orchestra-war.war
resource.dir=setup
run.classpath=
source.root=.
```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 10 Pro 22H2

### JDK

JDK 17

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

The problem always occurs.

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the deletion flow in Apache NetBeans 23 using an Ant Enterprise Application and an Enterprise Application Client. Inspect the generated project.xml and project.properties after deleting the client, focusing on the remaining references to Musician. Done means the deleted project's library, project reference, and related properties are removed without affecting the remaining modules.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.