0
votes

I am trying to build my IBM MobileFirst 7.1 application war file using ant war-builder tasks. The ant console says the build was successful, but there is a warning that states:

Ignoring contents of server/java folder. To include this folder , set the 'compileJava' property to true.

As soon as I add this property to the ant task in build.xml, the result turns to error and I get the following log:

[war-builder] Copied 8 empty directories to 7 empty directories under ./bin/classes

[war-builder] Compiling 9 source files to ./bin/classes

[war-builder] CustomAuthenticator.java:7: error: package javax.servlet does not exist

[war-builder] import javax.servlet.ServletException;

[war-builder] CustomAuthenticator.java:8: error: package javax.servlet.http does not exist

[war-builder] import javax.servlet.http.HttpServletRequest;

[war-builder] CustomAuthenticator.java:9: error: package javax.servlet.http does not exist

[war-builder] import javax.servlet.http.HttpServletResponse;

[war-builder] CustomAuthenticator.java:12: error: package com.worklight.server.auth.api does not exist

[war-builder] import com.worklight.server.auth.api.AuthenticationResult;

[war-builder] CustomAuthenticator.java:13: error: package com.worklight.server.auth.api does not exist

[war-builder] import com.worklight.server.auth.api.AuthenticationStatus;

Of course, I am importing all this packages into my custom Authenticator, but the war-builder is failing to add them to the war. Can you help me to understand this situation and how to fix it?

1

1 Answers

0
votes

Unless you have custom code in the server\java folder, you don't need it.
If you do need it, then you need to add the class folder attribute for the build process to take the contents of said folder.

The classesFolder attribute specifies a folder with compiled Java™ classes to add to the .war file. .jar files in the projectfolder\server\lib directory are added automatically

Please follow the documentation: https://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_deploy_projects.html