mvn package error when generating .war

177 views
Skip to first unread message

Olivier Rubinger

unread,
Sep 20, 2024, 2:44:25 PM9/20/24
to DSpace Technical Support
Hey DSpace Tech Team,

After using the command "mvn package" inside the dspace 8 backend, I get success on all steps.

But for some reason it never generates the .war files inside webapps/server

The structure always stays like this:

META-INF
WEB-INF
.gitignore

All the other files are missing. 
I've tried doing all dspace installation steps on other two machines and It never works.
I've had the same problem with DSpace 7.

I'm using maven 3.9.9 and jdk-17

I get these warnings when using "mvn package":

[WARNING] Some problems were encountered while building the effective model for org.dspace.modules:server:war:8.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-dependency-plugin @ line 71, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]

[INFO] Copying files to C:\DSpace8\DSpace-dspace-8.0\dspace\target\dspace-installer
[INFO] 1008 files copied to C:\DSpace8\DSpace-dspace-8.0\dspace\target\dspace-installer
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for DSpace Parent Project 8.0:
[INFO]
[INFO] DSpace Parent Project .............................. SUCCESS [  2.405 s]
[INFO] DSpace Services Framework :: API and Implementation  SUCCESS [  7.625 s]
[INFO] DSpace Kernel :: API and Implementation ............ SUCCESS [01:13 min]
[INFO] DSpace Addon Modules ............................... SUCCESS [  0.626 s]
[INFO] DSpace Kernel :: Additions and Local Customizations  SUCCESS [  5.058 s]
[INFO] DSpace IIIF ........................................ SUCCESS [  4.622 s]
[INFO] DSpace OAI-PMH ..................................... SUCCESS [  9.064 s]
[INFO] DSpace RDF ......................................... SUCCESS [  3.250 s]
[INFO] DSpace SWORD ....................................... SUCCESS [  7.622 s]
[INFO] DSpace SWORD v2 .................................... SUCCESS [  5.828 s]
[INFO] DSpace Server Webapp ............................... SUCCESS [01:14 min]
[INFO] DSpace Server Webapp:: Tomcat deployable WAR ....... SUCCESS [  8.811 s]
[INFO] DSpace Server Webapp:: Executable JAR .............. SUCCESS [  3.937 s]
[INFO] DSpace Assembly and Configuration .................. SUCCESS [  6.672 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

DSpace Technical Support

unread,
Oct 3, 2024, 12:08:49 PM10/3/24
to DSpace Technical Support
Hi,

DSpace doesn't package *.war files by default.  Instead, DSpace will build an "unzipped" war under "[dspace-src]/dspace/target/dspace-installer/webapps/server".   That "server" directory *is a valid web application*, but it's not zipped up as a *.war.

See the backend installation guide for more details, especially step 11 where you deploy that "server" directory to Tomcat.  https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-BackendInstallation

Tim

Olivier Rubinger

unread,
Oct 3, 2024, 1:02:59 PM10/3/24
to DSpace Technical Support
Hey,
Thanks for the reply!

I've tried to follow the installation guide meticulously, but files are still missing.

After I run "mvn package" inside dspace8 backend, I get success on all steps.
Then I go to " [dspace-source]/dspace/target/dspace-installer  " and run "ant fresh_install", and I also get the BUILD SUCCESS message.

The next step is to  "Deploy WAR application to Tomcat".
So when I go to " [dspace]/webapps/server" I'm supposed to see 5 files inside the folder, but I only see 2! (META-INF, WEB-INF)

I've tried doing the whole installation on my laptop as well, but the files are still missing. 
The server folder structure is supposed to be like this:

js
META-INF
WEB-INF
index.html
login.html
style.css

Even when i try to execute the server-boot.jat it doesn't work as intended.
I'll send screenshots for every step here.

Thanks!


antfreshinstallsuccess.PNG
mvnsuccess.PNG
webappsmissing.PNG
antfreshinstall.PNG
mvnwarning.PNG

DSpace Technical Support

unread,
Oct 3, 2024, 3:13:11 PM10/3/24
to DSpace Technical Support
Hi,

Ok, I see the confusion.  You are correct that the DSpace 8 Installation guide was misleading in using the description: "Deploy WAR application to Tomcat".  I've corrected it to say "Deploy web application to Tomcat" because there is no WAR file created. https://wiki.lyrasis.org/display/DSDOC8x/Installing+DSpace

As for the build process itself, the behavior you are seeing is correct.   In DSpace 8, the "server" folder should ONLY include:
* META-INF
* WEB-INF
* .gitignore (may appear...but it's not required)

The JS and CSS files that you seem to be expecting have now moved to be under WEB-INF/classes/static.  They no longer exist at the root directory.

So, I don't see any issues with your build.  It appears to be working correctly and you just need to finish the installation.

Tim

Olivier Rubinger

unread,
Oct 4, 2024, 1:02:31 AM10/4/24
to DSpace Technical Support
Hey Tim,

Thanks for the help! 
Saved me a lot!

Olivier
Reply all
Reply to author
Forward
0 new messages