I have a Junit test suite which depends on around 30 JARs. The Junit source code is on GitHub and I want to trigger the test suite from Jenkins. I can do this by using GitHub plugin. I.e. using Fressstyle project and then selecting source code management as GitHub.
Now my Junit itself depends on around 30 JARs. These are not present on GitHub. So cannot use sub-module option. They reside on our application server.
My question is:- How do I refer these when Junit runs? Should I upload all of these 30 JARs to GitHub (seems incorrect). Is there a way? Thank you.
Use a tool for building your software that handles the dependency management. E.g. Ant with Ivy, Maven or Gradle. Otherwise you have to reinvent the wheel.
Related
I am developing (Single developer) a Spring based project for a Traveling based website.
and this is my first Spring based project, I want to use Maven in my project, because hosting sites like Cloud Bees expecting maven based project for deployment.
Is Maven required to develop Spring based project in Single developer environment.
FYI I am using eclipse IDE.
No it is not required.
You can develop in Spring using Ant or Maven or Gradle etc. or nothing at all.
Although it might be easier to do it with Maven (for library management)
It is not required per se, but you will run into some serious pain down the road if you don't use Maven or Gradle.
The first and foremost reason to use Maven or Gradle is to be able to very simply run tasks that occur ofter (like building a war or running the tests) and to be able to declaratively obtain the required dependencies (which in the case of a typical Spring application are plentiful).
If you are just starting to use build tool, I would suggest you take look at Gradle instead of Maven.
I have recently started out on Maven. I am trying to integrate Maven+eclipse(Juno)+tomcat7.
I have downloaded m2e-wtp plugin for eclipse and created a Maven project whose structure follows a standard Maven project structure. It is also configured a dynamic web project.
It is a multi module project with two modules of flex(f1 AND f2) and one module of webapp(w).I have configured all the plugins correctly and there is no problem with configuration of POMs.
What I want to achieve is :
When I clean and Build project in Eclipse using Project-->Clean,Eclipse does not build the war in target folder of my web application project (w). I also does not copy any of the flex resources to target folder. However,
When I run the project as maven build by right-clicking the web application project and running it as a "maven install" it creates everything as expected.
My question is that if it is possible to achieve what I mentioned in point (1)? Or the only correct way to do this is the way mentioned in point (2).
I am also not able to deploy the generted files in step 2 automatically in tomcat.
Do I need to use another maven plugin for this?
Please note that this i my first experience with Maven + eclispe. I have followed certain tutorials. So, Please be lenient while voting negatively.
From what I know it is not possible to force Eclipse to use Maven directly (I would gladly be proven wrong).
Eclipse does not use Maven to build (1). Using the m2e plugin, it is possible to run maven to perform the build as you discovered (2).
If you are looking for that kind of tight integration you can look at NetBeans or IntelliJ who are using Maven natively.
EDIT:
About (3) there is a Tomcat-Maven-Plugin that can deploy the WAR file created on a running tomcat instance. Check the Usage page for more details.
I have multi module maven project.
One of the modules is actual web application, the JBoss is the server.
Other subprojects are dependencies for the web project.
I am running it in JBoss embedded in eclipse. Pretty straightforward configuration.
When executed from within eclipse, if I do mvn clean, mvn package - then clean + publish to JBoss, everything works wonderfully.
If I change source code for the web project, eclipse detects the need to republish automatically and does job well.
However if I change source in the non-web subproject, eclipse does not detect change and I have to mvn clean, mvn package, then publish to JBoss manually for it to pick the code change.
This is annoying since packaging job takes about a minute, then publishing job takes another 30 seconds. I have to clean since simply packaging without clean does not pick the change either.
Is there a way to configure things in the eclipse so that any source change in any subproject/module is automatically recognized by eclipse and it would republish to JBoss upon selecting "run"?
There is another bad side effect - debugging of the source that is not web project is impossible - eclipse's debugger does not see that source. It sees only source of the web module.
Thanks,
Nikolay
Make sure that your web project has dependencies on the other modules(projects) defined in the pom and in the eclipse project. you can check that in the build settings. If they are not there then it probably means that the project file was not generated from your maven .pom file. You can generate that by running
mvn eclipse:eclipse
I wish to setup an eclipse project for implementing a simple module but not a service for axis. I wonder if there're any templates I could use?
Secondly, I would like to ask if there are any information sources such as links around on how to build complex Axis2 applications in eclipse mainly focusing on module building as well
I appreciate your hints.
Best regards,
Alex
I could come along with this issue with my own solution:
Using an customized build.xml based on axis2 module builds I am able to build a module project in Eclipse using ant. I trigger this via key shortcut.
The build.xml has an deploy.module target that puts the module back to the axis2 $HOME/repository folder. Running there ant build.xml will deploy axis2 at whole as an war-file (EAR) the module containing there within to be ready to deploy in a container such as jboss.
The eclipse project is based on common java project (no dynamic web project) containing the $AXIS2/lib in CLASSPATH.
Since Jboss supports hot deployment on update, you can run jboss in a terminal or withing eclipse. I customized the latter build.xml to support easy jboss deployment.
This is a good solution for me.
How to build Spring Roo project without maven?
P.S. I use STS to create Roo project. I use maven for dependency management. Thanks to m2eclipse I have all libraries on eclipse classpath.
I have other non-Maven referenced. So maven fails to build.
You can't. Well, I suppose you could manually create an Ant-based build file that would do the same thing, but why?
One of the purposes behind Roo is that it helps manage the dependencies and build processes necessary for your chosen data persistence architecture. Maven is currently the standard build tool for doing just that, and you get its best practices implemented for you by creating the project via Roo.
Alternatively, if you're just trying to import a Roo-created project into Eclipse try ...
roo> perform eclipse
...
That will generate Eclipse project files that you can import.
This is about using custom maven artifacts.
Create a custom Maven repository, place your referenced jars in there and include them as dependencies in your pom.xml file.
Learn some Maven, it would really help - specially when working with Roo.