maven-2

Test class extending test class in dependency module

旧巷老猫 提交于 2019-12-02 18:08:43
I've got a test class in a module that extends another test class in one of its dependency modules. How can I import the dependency's test code into the test scope of the dependent module? To illiterate, I've got two modules, "module-one" being a dependency of "module-two". SubTestCase is a subclass of TestCase . module-one \src\test\java\com\example\TestCase.java module-two \src\test\java\com\example\SubTestCase.java But the build is failing because the test code of "module-one" is not being imported into "module-two", just the main code. Usually this is solved by building and deploying

How to use Maven in my Java Project and Why?

浪子不回头ぞ 提交于 2019-12-02 18:06:46
I am trying to figure out the use of Maven and I got many articles describing its features and uses. But I am just not able to understand the actual use of Maven from productivity standpoint. From what I am used to in our school projects was just create a new Java project in Eclipse, write your Code, create a .war (if web-based) and paste the code to the webapps folder of Tomcat and start the server! So, Where does Maven come into picture? I have used Ant and I understand Ants benefit of a standardized build process. But why do we need an advanced Ant in form of Maven? In any case, I need to

Setting project for eclipse using maven

泪湿孤枕 提交于 2019-12-02 17:42:38
I'm trying to start modifying an existing application with Eclipse. Actually I had it working before, but I deleted the project, and now with "mvn eclipse:eclipse" I get the following: [INFO] Resource directory's path matches an existing source directory. Resources will be merged with the source directory src/main/resources [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Request to merge when 'filtering' is not identical. Original=resource src/main

OSGi - How mature is this technology?

一世执手 提交于 2019-12-02 17:41:43
I have a requirement where I need to share some web resources ( jsp , html , js , images , css etc.) across different Spring based Struts 2 applications. And seems like OSGi can be used to achieve this? Can some one give some pointers on how to achieve this with OSGi ? And secondly I want to know is OSGi mature enough to be used in production applications? Thanks in advance! EDIT: I went through this post and seems like people are able to share a web bundle across web applications. The only difference is that they did it with Spring MVC. I want to know whether this can be achieved with Struts2

How to check pom.xml for updated dependencies

巧了我就是萌 提交于 2019-12-02 17:37:19
I am fairly new to Maven and pom.xml. Is there a way I can find out which of my dependencies that are outdated, so that I can update version numbers in my pom.xml. In other languages, for instance, Ruby has the command gem list outdated that gives me a list of dependencies (rubygems) I can update I am using IntelliJ Idea if that can help. Pascal Thivent You can do this with the Versions Maven Plugin . Check the following goals: versions:display-dependency-updates scans a project's dependencies and produces a report of those dependencies which have newer versions available. versions:display

How to modularize a (large) Java App?

血红的双手。 提交于 2019-12-02 17:21:53
I have a rather large (several MLOC) application at hand that I'd like to split up into more maintainable separate parts. Currently the product is comprised of about 40 Eclipse projects, many of them having inter-dependencies. This alone makes a continuous build system unfeasible, because it would have to rebuild very much with each checkin. Is there a "best practice" way of how to identify parts that can immediately be separated document inter-dependencies visually untangle the existing code handle "patches" we need to apply to libraries (currently handled by putting them in the classpath

Declare dependency in <dependencyManagement> section even if dependency not used everywhere?

女生的网名这么多〃 提交于 2019-12-02 17:14:23
We're using maven 2.1.0. I have multiple modules that are completely separate, but still have many common dependencies. Like log4J, but some modules don't need it. I am wondering if it is a good idea to declare all common dependencies in one parent file in the <dependencyManagement> section or is there a better way to deal with this? A follow up question about <dependencyManagement> . If I declare Log4J in the <dependencyManagement> section of the parent and a sub project does not use it, will it be included anyway? Each module should have its own POM and where it declares its own dependencies

Jenkins time-out while fetching from Github in 10 mins.

↘锁芯ラ 提交于 2019-12-02 17:10:58
I've stuck with this issue while configuring Jenkins for Nightly build. Please note that the repository project "project1" is large and is about 900MB. Please let me know how should I go around this problem. Started by user anonymous Building in workspace C:\Users\user1\.jenkins\jobs\Nightly Build\workspace Fetching changes from the remote Git repository Fetching upstream changes from git@github.com:MyOrg/projectgroup/project1 ERROR: Timeout after 10 minutes FATAL: Failed to fetch from git@github.com:MyOrg/projectgroup/project1 hudson.plugins.git.GitException: Failed to fetch from git@github

Use maven repository as local ivy cache

↘锁芯ラ 提交于 2019-12-02 17:07:39
Is there any possibility to use local Maven repository (~/.m2) as local Ivy cache (~/.ivy)? They have different layouts. Sometimes I use Maven and sometimes I use SBT which uses Ivy underneath, so I have 2 copies of same libs in both Maven and Ivy. I would like to use same dir thus saving disk space and network. Thanks. You can specify the cache and the layout of the cache by using the <cache/> Tag . I think you will have to alter the patterns for the artifacts/ivy.xml files. The Tag is described here: http://ant.apache.org/ivy/history/2.0.0/settings/caches.html . It seems that it should work,

Maven - Skip building test classes

孤街浪徒 提交于 2019-12-02 16:56:02
Is there a simple way to not build the test classes? mvn clean install -Dmaven.test.skip=true Walter According to the documentation on the Maven Surefire Plugin, -Dmaven.test.skip should skip both compilation and execution of the tests. By contrast, -DskipTests just skips the test execution : the tests are still compiled. Just to be explicitly clear: skipTests will compile anything in the <testSourceDirectory> , but will not execute them. maven.test.skip will NOT compile any tests, but WILL execute any compiled tests that made their way into the <testOutputDirectory> . So the behavior of the