dependencyManagement
和之间有什么区别dependencies
?我在Apache Maven网站上看过这些文档.似乎dependencyManagement
可以在其子模块中使用在其下定义的依赖项而不指定版本.
例如:
父项目(Pro-par)在以下内容下定义依赖项dependencyManagement
:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8</version>
</dependency>
</dependencies>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)
然后在Pro-par的孩子,我可以使用junit:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
但是,我想知道是否有必要在父pom中定义junit?为什么不直接在所需的模块中定义它?
到目前为止,我使用了2.45.0版本的selenium,所有的等待都是这样完成的:
WebDriverWait wait = new WebDriverWait(webKitUtility.getWebDriver(), 5);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("role")));
Run Code Online (Sandbox Code Playgroud)
但我更新了selenium到3.1.0,我收到错误:
"FluentWait类型中的方法(谓词)不适用于参数(ExpectedCondition)"
我看到从2.45.0到3.1.0,有些东西被弃用了.我正在尝试调查现在最好的方法,但我不确定.我在谷歌上找到的大部分内容都是旧信息,解释方法与我目前使用的方式相同.
当我尝试调用100%正常工作的代码时,我从eclipse中得到错误.例如,它在我的netbeans中工作,但不是这个eclipse项目.错误是荒谬的,我几乎可以肯定它是由我正在使用的OPEN JPA的一些Maven依赖引起的.有什么指针吗?
Map<String,String> properties = new HashMap<String,String>();
properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "");
properties.put(PersistenceUnitProperties.JDBC_USER, "root");
properties.put(PersistenceUnitProperties.JDBC_URL, "jdbc:mysql://localhost:3306/mydb");
properties.put(PersistenceUnitProperties.JDBC_DRIVER, "com.mysql.jdbc.Driver");
emf = Persistence.createEntityManagerFactory("Persistentunitname", properties);
Run Code Online (Sandbox Code Playgroud)
错误发生在最后一行,错误是:
ClassFormat错误"在类文件javax/persistence/Persistence中不是本机或抽象的方法中的Absent Code属性"
关于pom.xml
Maven文件:
java.lang.IllegalStateException: No ExecutorFactory found to execute the application.
at org.apache.flink.core.execution.DefaultExecutorServiceLoader.getExecutorFactory(DefaultExecutorServiceLoader.java:84)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:1803)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1713)
at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:74)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1699)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1681)
at com.cep.StaticAlarmGenerationEntryTest.main(StaticAlarmGenerationEntryTest.java:149)
Run Code Online (Sandbox Code Playgroud)
我把FLink从1.10升级到1.11后遇到的错误,我的IDE是eclipse。我尝试添加 artifactId:flink-clients_${scala.binary.version},但仍然失败。任何人已经遇到并解决了这个问题,请告诉我。多谢。
早上好……此刻我完全迷失了。
我的应用程序每 5 分钟向 EMS 服务器发送一条 JMS 消息。在本地 tomcat 上启动它工作正常......但是当我将它部署到我们的 PRE 环境时,我在尝试将 Java 对象解析为 xml 字符串时收到此错误:
Exception in thread "Timer-8" java.lang.NoSuchMethodError: org.codehaus.stax2.XMLStreamWriter2.closeCompletely()V
at com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.close(ToXmlGenerator.java:1091)
at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3633)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2998)
at es.adif.icecof.ems.JmsHeartbeatSender.sendMessage(JmsHeartbeatSender.java:67)
at es.adif.icecof.common.ThreadHeartbeat$1.run(ThreadHeartbeat.java:42)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Run Code Online (Sandbox Code Playgroud)
到底会发生什么?
非常感谢...
maven ×3
java ×2
pom.xml ×2
apache-flink ×1
jackson ×1
jpa ×1
maven-3 ×1
multi-module ×1
openjpa ×1
selenium ×1