Tag: maven

Java EJB JNDI Bean查找失败

我有以下结构: 4.0.0 com.screening screening 1.0-SNAPSHOT pom Screening Java Parent Module1 Module2 org.apache.maven.plugins maven-compiler-plugin 2.3.2 1.6 1.6 ${endorsed.dir} org.apache.maven.plugins maven-ejb-plugin 2.3 3.1 org.apache.maven.plugins maven-dependency-plugin 2.1 validate copy ${endorsed.dir} true javax javaee-endorsed-api 6.0 jar 以上是pom,它是以下模块的父级: com.screening screening 1.0-SNAPSHOT 4.0.0 com.screening module1 1.0-SNAPSHOT ejb Module1 com.screening screening 1.0-SNAPSHOT 4.0.0 com.screening module2 1.0-SNAPSHOT ejb Module2 我有一些无状态的bean,例如: @Stateless @Local public […]

如何告诉Maven和TestNG运行特定的测试类或suite.xml文件?

我正在使用Maven对网站运行TestNG集成测试。 目前,我可以使用此命令来运行特定的测试类: mvn -Dit.test=”MyTestClassname” verify 我还希望能够指定一个TestNG套件XML文件来运行一堆类和特定参数。 我可以在我的POM中设置Failsafe插件来接受一个suiteXmlFiles参数,如下所示: 1 ${basedir}/src/test/resources/suites/${suiteFile} ${browser} ${environment} ${debugMode} ${caseId} 这让我发出这个命令: mvn -DsuiteFile=”MyTestSuite.xml” 但是现在我不能使用-Dit.test =“MyTestClassname”选项,因为Maven现在尝试传递一个空值作为套件名称。 有没有解决的办法? 再一次,我想要: 指定一个测试类(在命令行中有一堆参数) 指定包含一堆测试类和不同参数的testng XML文件。

从命令行运行maven插件的语法是什么。

我看到这里已经有人问过: 如何从命令行执行maven插件? 但我真的不明白答案。 看起来语法的forms如下: mvn foo:bar 但我不确定foo和bar应该是什么。 具体来说,我已经配置了maven-resource-plugin,如下所示: maven-resources-plugin 2.5 copy-resources prepare-package copy-resources 我已经尝试了mvn artifactId|id|phase|goal:artifactidId|id|phase|goal几种排列mvn artifactId|id|phase|goal:artifactidId|id|phase|goal但它们都没有工作。 我想我会停止试图强暴它,只是问互联网。 此外,这是在任何地方记录?

在maven构建阶段更新jsp脚本标记

我想更新src / main / webapp / jsp下的jsp文件中所有脚本标签内的内容。 如何在maven构建阶段执行此操作? 我正在使用java + spring + maven堆栈。 好的,这是我想要实现的例子: 源代码: 在maven构建之后,它应该存在于目标文件夹中 <script type="text/javascript" src="js/core/validator.js?version=''”> <script type="text/javascript" src="js/app/util/core-util.js?version=''”> 请注意src =“”末尾的version参数。 更新:最后,我能够按照以下方式开展工作。 如果有的话,请随意提出替代方案。 准备好shell脚本来生成类似这样的属性文件 JS /核心/ validator.js = JS /核心/ validator.js?版本\ = MD5SUM-JS的-/核心/ validator.js JS /应用/ util的/芯util.js中= JS /应用程序/ util的/芯util.js中?版本\ = MD5SUM-JS的-/应用/ util的/芯util.js中 配置maven-replacer-plugin以将此属性文件用作标记值映射并过滤target / app / jsp文件夹下的所有jsp文件。

maven在编译时获取属性

如何在编译时在源文件中获取Maven属性 pom.xml myApp 1.0.0 Main.java public class Main { private static final String artifactId = “project.artifactId”; private static final String version = “project.version”; } 是否有可能在课堂上鳕鱼?

javax.annotations.Nonnull上的TypeNotPresentException

我已将maven surefire插件(2.17)添加到我们的项目中,但构建失败并出现以下错误。 Error injecting: org.apache.maven.plugin.surefire.SurefirePlugin java.lang.TypeNotPresentException: Type javax.annotation.Nonnull not present at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:39) at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:51) at com.ibm.oti.reflect.Method.getDeclaredAnnotations(Method.java:35) at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:719) at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:187) at com.ibm.oti.reflect.Method.getAnnotation(Method.java:21) at java.lang.reflect.Method.getAnnotation(Method.java:693) at com.google.inject.spi.InjectionPoint.getAtInject(InjectionPoint.java:478) at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:676) at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:366) at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165) at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:609) at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:565) at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:551) at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:865) at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:790) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:278) at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:210) at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:986) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1019) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:982) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032) at […]

如何在Jenkins中运行Cucumber JVM测试

我有一个与Maven和Cucumber集成的Selenium Automation Framework。 我想用jenkins进行黄瓜测试。 我正在按照步骤运行它: 创建新作业>选择Maven项目 提供POM.xml的路径 添加Post Build Action Cucumber-JVM报告 保存 立即建造 执行这些步骤后黄瓜测试没有运行,但Build是成功的。

gradle存储库指向具有多个库的本地目录

我对本地存储库的build.gradle中的构建依赖关系有疑问(即使用本地目录) dependencies { compile fileTree(include: [‘*.jar’], dir: ‘libs’) } 它是仅解决了libs目录中的依赖关系还是解析了lib目录的所有子文件夹的依赖关系? 如果它不解析子文件夹/子目录的依赖关系,如何解决依赖关系? 注意:我们的项目依赖于大量的jar文件(而不是为每个jar / libs提供完整的文件名),所以想知道任何替代方式。

m2e-wtp覆盖未加载到Eclipse发布的EAR或WAR文件中

我无法让Eclipse在本地正确地将重叠的WAR发布到weblogic服务器上。 正确运行maven clean package会在导入适当的webapp内容的情况下组装EAR。 我发现了几个类似的问题,但似乎没有一个是近期或同一个问题。 查看我的org.eclipse.wst.common.component文件,也可以正确生成覆盖资源的依赖模块。 我正在使用m2e-wtp 1.0.1.20130911-1545 是否需要执行其他配置才能使服务器发布以读取该叠加层? 使用更多信息进行编辑:以下是WARs pom.xml的摘录 com.abc core-webcontent 0.0.1-SNAPSHOT war runtime org.apache.maven.plugins maven-war-plugin 2.4 com.abc core-webcontent 以下是组件文件的摘录 consumes consumes 我尝试在本地进行EAR导出,以便我可以查看EAR并查看文件是否被添加到其他位置,但似乎这种类型的设置根本不起作用。

Maven可以从私有s3存储桶中引用父POM吗?

当使用私有 AWS S3存储桶作为Maven存储库时,有很多正在运行的s3旅行车提供商可以使用s3:// [bucket] /文件夹协议来部署和提取依赖关系。 但是,当您尝试使用父POM引用执行此操作时,即 com.my.company my-parent-pom 1.0.0 它仅存在于私有 S3 Maven仓库中,似乎Maven只检查基于HTTP的定义存储库,并且不会尝试查看S3仓库。 该项目中的S3旅行车被定义为 org.springframework.build aws-maven 5.0.0.RELEASE 对于正常的依赖项,它再次正常工作,而不是父POM引用 寻找在S3 Maven仓库中正确解析父POM的方法