Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Wildfly Maven插件-命令似乎没有效果_Java_Maven_Wildfly_Wildfly Maven Plugin - Fatal编程技术网

Java Wildfly Maven插件-命令似乎没有效果

Java Wildfly Maven插件-命令似乎没有效果,java,maven,wildfly,wildfly-maven-plugin,Java,Maven,Wildfly,Wildfly Maven Plugin,我正在使用Wildfly Maven插件,它正在工作,因为它打开并运行web应用程序,但是我的自定义配置遇到了问题,即: 将根记录器和控制台记录器设置为调试模式 允许从0.0.0.0:8080或本地主机以外的其他设备进行连接 以下是我的设置: <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactI

我正在使用Wildfly Maven插件,它正在工作,因为它打开并运行web应用程序,但是我的自定义配置遇到了问题,即:

  • 将根记录器和控制台记录器设置为调试模式
  • 允许从
    0.0.0.0:8080
    或本地主机以外的其他设备进行连接
以下是我的设置:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>2.0.2.Final</version>
    <executions>
        <execution>
            <phase>install</phase>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <java-opts>
            <java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044</java-opt>
        </java-opts>
        <commands>
            <!-- **These are the commands that aren't going through** -->
            <command>/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG") </command>
            <command>/subsystem=logging/console-handler=CONSOLE:write-attribute(name="level", value="DEBUG")</command>
            <command>/subsystem=logging/file-handler=debug:add(level=DEBUG,autoflush=true,file={"relative-to"=>"jboss.server.log.dir", "path"=>"debug.log"})</command>
            <command>/subsystem=logging/logger=org.jboss.as:add(level=DEBUG,handlers=[debug])</command>
            <command>/subsystem-----Enable Remote access here?</command>
        </commands>
        <add-user>
            <users>
                <user>
                    <username>admin</username>
                    <password>admin.1234</password>
                </user>
                <user>
                    <username>admin-user</username>
                    <password>user.1234</password>
                    <groups>
                        <group>admin</group>
                        <group>user</group>
                    </groups>
                    <application-user>true</application-user>
                </user>
                <user>
                    <username>default-user</username>
                    <password>user.1234</password>
                    <groups>
                        <group>user</group>
                    </groups>
                    <application-user>true</application-user>
                </user>
            </users>
        </add-user>
    </configuration>
</plugin>

org.wildfly.plugins
然后手动将日志记录从默认信息级别更改为调试:


所以我的问题是,在允许远程访问的同时,如何将日志记录级别作为命令更改为maven wildfly插件

您需要升级插件版本才能使其正常工作。2.0.x版本不具备从运行或部署目标执行CLI命令的能力

如果需要坚持使用的版本,则需要定义
executecommands
目标。然后您可以使用嵌入式服务器来配置服务器

<commands>
    <!-- **These are the commands that aren't going through** -->
    <command>embed-server</command>
    <command>/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG") </command>
    <command>/subsystem=logging/console-handler=CONSOLE:write-attribute(name="level", value="DEBUG")</command>
    <command>/subsystem=logging/file-handler=debug:add(level=DEBUG,autoflush=true,file={"relative-to"=>"jboss.server.log.dir", "path"=>"debug.log"})</command>
    <command>/subsystem=logging/logger=org.jboss.as:add(level=DEBUG,handlers=[debug])</command>
    <command>/subsystem-----Enable Remote access here?</command>
    <command>stop-embedded-server</command>
</commands>

嵌入式服务器
/subsystem=logging/root logger=root:write属性(name=“level”,value=“DEBUG”)
/子系统=日志记录/控制台处理程序=控制台:写入属性(name=“level”,value=“DEBUG”)
/subsystem=logging/file handler=debug:add(level=debug,autoflush=true,file={“relative to”=>“jboss.server.log.dir”,“path”=>“debug.log”})
/subsystem=logging/logger=org.jboss.as:add(level=DEBUG,handlers=[DEBUG])
/子系统------在此处启用远程访问?
停止嵌入式服务器

谢谢!我没有意识到这是一个“新”功能。至于远程访问-你知道我应该使用什么命令来允许从0.0.0.0进行远程访问吗?Nvm发现它是
-Djboss.bind.address=0.0.0.0
你也可以使用
-b=0.0.0