首页 > 解决方案 > Netbeans 如何将 WAR 文件部署到 Wildfly?

问题描述

Wildfly 什么都没有: 未部署

然后从Netbeans部署运行并运行war,但是:

nicholas@mordor:~/NetBeansProjects/x$ 
nicholas@mordor:~/NetBeansProjects/x$ gradle tasks --all

> Task :tasks

------------------------------------------------------------
Tasks runnable from root project 'x'
------------------------------------------------------------

Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
testClasses - Assembles test classes.
war - Generates a war archive with all the compiled classes, the web-app content and the libraries.

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Documentation tasks
-------------------
javadoc - Generates Javadoc API documentation for the main source code.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'x'.
dependencies - Displays all dependencies declared in root project 'x'.
dependencyInsight - Displays the insight into a specific dependency in root project 'x'.
help - Displays a help message.
javaToolchains - Displays the detected java toolchains.
outgoingVariants - Displays the outgoing variants of root project 'x'.
projects - Displays the sub-projects of root project 'x'.
properties - Displays the properties of root project 'x'.
tasks - Displays the tasks runnable from root project 'x'.

Verification tasks
------------------
check - Runs all checks.
jacocoTestCoverageVerification - Verifies code coverage metrics based on specified rules for the test task.
jacocoTestReport - Generates code coverage report for the test task.
test - Runs the unit tests.

Other tasks
-----------
compileJava - Compiles main Java source.
compileTestJava - Compiles test Java source.
components - Displays the components produced by root project 'x'. [deprecated]
dependentComponents - Displays the dependent components of components in root project 'x'. [deprecated]
model - Displays the configuration model of root project 'x'. [deprecated]
prepareKotlinBuildScriptModel
processResources - Processes main resources.
processTestResources - Processes test resources.

Rules
-----
Pattern: clean<TaskName>: Cleans the output files of a task.
Pattern: build<ConfigurationName>: Assembles the artifacts of a configuration.

BUILD SUCCESSFUL in 686ms
1 actionable task: 1 executed
nicholas@mordor:~/NetBeansProjects/x$ 
nicholas@mordor:~/NetBeansProjects/x$ cat build.gradle 
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'war'

repositories {
    mavenCentral()
}

dependencies {
    providedCompile 'javax:javaee-web-api:8.0'
    
    testImplementation     'junit:junit:4.13'
}
nicholas@mordor:~/NetBeansProjects/x$ 

我没有看到明确的部署任务。

那么如何Netbeans部署war文件呢?

标签: gradledeploymentwebserverwildflywar

解决方案


推荐阅读