apache / apache/netbeans

Error creating Enterprise Application with Maven

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

Description

### Apache NetBeans version

Latest release

### What happened

When I try to create an Enterprise application with Maven the process fails and generates a corrupt project. The last version of Netbeans where it worked correctly for me is 8.2, which I still have to generate the base projects. All new versions of netbeans fail the same way.

### How to reproduce

1) New Project
2) Categories: Java with Maven
3) Enterprise application
4) fill in the fields normally
5) Select any server
6) Java EE version: Jakarta EE 8
7) Check create EJB Module
8) Check Web App module and assembly module
9) Finish

wizard01

wizard02

**Project creation result:**

Log output:
```

Generating project in Batch mode
Archetype not found in any catalog. Falling back to central repository.
Add a repository with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
----------------------------------------------------------------------------
Using following parameters for creating project from Archetype: webapp-jakartaee8:1.0.0
----------------------------------------------------------------------------
Parameter: groupId, Value: testapp
Parameter: artifactId, Value: enterpriseApplicationWithMaven-ejb
Parameter: version, Value: 1.0.0
Parameter: package, Value: testapp.enterpriseApplicationWithMaven-ejb
Parameter: packageInPathFormat, Value: testapp/enterpriseApplicationWithMaven-ejb
Parameter: package, Value: testapp.enterpriseApplicationWithMaven-ejb
Parameter: groupId, Value: testapp
Parameter: artifactId, Value: enterpriseApplicationWithMaven-ejb
Parameter: version, Value: 1.0.0
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.155 s
Finished at: 2022-02-03T09:34:46-03:00
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project enterpriseApplicationWithMaven: Unable to add module to the current project as it is not of packaging type 'pom' -> [Help 1]

```
Full log is attached:
[project_creation.log](https://github.com/apache/netbeans/files/7994587/project_creation.log)

**Finally:**
A series of directories are created with the correct structure, but the pom.xml is not created properly and all modules seem to be of WAR type.

project-view

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

- [X] This used to work!

### Operating System

macOS Monterey, Windows 10, Windows 11

### JDK

zulu11, zulu8, jdk1.7.0_80, jdk1.8.0_271

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

I assume that the problem lies in the archetype used

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

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow the Apache Software Foundation's [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure through the Java with Maven Enterprise application wizard using the listed Jakarta EE 8, EJB, web, and assembly options. Start with the Maven archetype-generation log and inspect the generated project directories and pom.xml files. Done means project creation completes without the packaging error and produces a correctly packaged parent project with the selected 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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.