2
votes

In order to have a constant JNDI name for remote calls, I want to remove the version from the EAR package name. I do it with the tag < finalName > in the maven-ear-plugin. It works fine but, when I deploy (run) the package with Netbeans (version 7.1.2), it raises an exception: java.lang.IllegalArgumentException: No archive for deployment

It seems Netbeans always expects a name like ${project.artifactId}-${project.version}.ear. How is it possible to change this behaviour?

Edit: It only happens when deploying on remote (Glassfish) servers.

Many thanks! JM

2

2 Answers

2
votes

I'm working on a Netbeans ear project with the same structure as yours, but when I run or debug the application from Netbeans it deploys the ${project.artifactId}-${project.version}.ear under the target folder, the ear generated from the maven-ear-plugin is not used by Netbeans, anyway you can deploy it manually, I've done it successfully. This is a known Netbeans behavior, for example you can refer to this link.

0
votes

To get a consistent name for your EJBs you first have to get a consistent name for your application. The name of the application can be set in the Application Descriptor File application.xml with the tag <application-name>YourGreatApp</application-name>.

If the application name is not set, the EAR file name will be used as application name. With maven you should always set your application name.

The application.xml file resides under META-INF/ in your EAR.