您好我想使用浏览器监控Java应用程序,但同时利用现有的JMX基础架构.
我知道JMX提供了一个HTTP接口,但我认为它提供了一个标准的web gui,并且不可能将其功能与现有系统混搭.
您是否知道JMX的任何REST接口?
我对谷歌的研究表明,有一个项目 可以做类似的事情.这是唯一的选择吗?
我想在我的插件中创建一个执行顺序,它包含一个maven插件,前后执行另一个maven插件.所有3次执行都是部署阶段的一部分.
这是我想要做的一个例子:
注意:url:get是我自己的custo mojo,只是使用commons httpClient执行http get.
我通常会在下一阶段附加after插件执行,但不幸的是deploy是jar生命周期的最后一个阶段.
先感谢您,
科斯塔斯
注意:我的pom文件中的以下插件段创建了以下不期望的执行顺序:
插件片段:
<plugin>
<groupId>com.blabla.stpadmin</groupId>
<artifactId>maven-url-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>stop-stpadmin-service</id>
<phase>deploy</phase>
<goals>
<goal>get</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>deploy</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.blabla.stpadmin</groupId>
<artifactId>maven-url-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>start-stpadmin-service</id>
<phase>deploy</phase>
<goals>
<goal>get</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud) 我想在关闭钩子运行时确定进程的退出状态.
我想要一个基于状态代码(0或非零)的逻辑
(例如:如果零则不执行其他非零发送警报电子邮件)
你知道我怎么能得到这些信息吗?
在我基于maven的IntelliJ项目中,我有2个模块 - 模块A和B.
当我导入maven模块时,IntelliJ在模块B的依赖项中添加模块的A源代码(忽略"withdeps"分类器).
是否有可能强制Intellij将模块A依赖项添加到B作为"maven库"而不是默认的"项目源代码/ Intellij模块"?如果没有,我该怎么做才能解决IntelliJ中的编译错误(Ctrl + F9)
谢谢
当依赖项直接包含在pom文件中时,我的汇编描述符会正确应用包含和排除.
但是,当我将依赖项放在父pom文件中时,程序集:目录目标报告尚未触发包含和排除.
你知道为什么maven-assembly-plugin会忽略父依赖吗?我该如何解决?
这是maven和程序集描述符:
装配描述符:
<assembly>
<id>distribution</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<includes>
<include>readme.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>org.tanukisoftware:wrapper:exe:3.3.5</exclude>
</excludes>
</dependencySet>
<dependencySet>
<outputDirectory>/bin</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<includes>
<include>org.tanukisoftware:wrapper:exe:3.3.5</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>
Run Code Online (Sandbox Code Playgroud)
Child POM程序集插件定义:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>directory</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
父POM依赖项:
<dependencies>
<dependency>
<groupId>org.tanukisoftware</groupId>
<artifactId>wrapper</artifactId>
<version>3.3.5</version>
<type>dll</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.tanukisoftware</groupId>
<artifactId>wrapper</artifactId>
<version>3.3.5</version>
<type>exe</type>
<scope>runtime</scope>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) 我是scala的新手,拥有java背景.
有没有办法在类继承树中模式匹配超类(或特征),叶子作为案例类和节点抽象类或特征?据我所知,不允许使用case类继承.
我认为在大型继承树中匹配抽象类的模式会非常有用
在下面的代码中,编译期间匹配语句错误的最后一种情况
sealed trait Person {
def name: String
}
case class Customer(name: String, email: String) extends Person
sealed trait Employee extends Person {
def id: Int
}
case class Worker(name: String, id: Int, skills: Array[String]) extends Employee
case class Manager(name: String, id: Int, title: String) extends Employee
def process(p: Person) = p match {
case Customer(_, email) => email
case Employee(name, _) => name + "@acme.com"
}
Run Code Online (Sandbox Code Playgroud) 我注意到在jdk源代码中,更具体地说,在集合框架中,在表达式中读取变量之前,首先要分配变量.这只是一个简单的偏好还是一些我不知道的更重要的东西?我能想到的一个原因是该变量仅在此表达式中使用.
由于我不熟悉这种风格,我觉得很难读懂.代码非常简洁.下面你可以看到一个例子java.util.HashMap.getNode()
Node<K,V>[] tab; Node<K,V> first, e; int n; K k;
if ((tab = table) != null && (n = tab.length) > 0 && ...) {
...
}
Run Code Online (Sandbox Code Playgroud) java ×2
maven ×2
maven-2 ×2
case-class ×1
http ×1
jmx ×1
maven-plugin ×1
rest ×1
scala ×1
shutdown ×1