Configuration of Hudson in eclipse - java

I have a eclipse Dynamic web project java base and use maven for creating project .But i want to build the project in Hudson for testing purpose .
So please anyone can give me steps to configure Hudson for building project in eclipse.
Thanks

0) Read a guide about Hudson an CI.
1) Create a new taks on hudson based on maven project.
2) Configure the task to checkout the code from your svn/git.
3) Configure the mvn step to execute "mvn test".
4) Check your results.

Related

How can i do a gradle publish on teamcity to publish a gradle build that uses the maven plugin?

I have teamcity currently configured to use the maven mojo, to publish the gradle jar as a nexus snapshot with just the gav.
I observe that if i use the maven plugin and do a gradle install in the IDE, i am able to see the generated pom.
1) Can i use this pom to publish the jar in nexus repo in teamcity ? I know that i can do it for a pure maven build by using it's pom.
2) Is there a way to not use this pom, and istead configure teamcity build steps to publish from gradle build directly ?
Gradle can of course take care of the publication. It will leverage the build information to produce a POM file that represents best what is declared in your project.
It will then be trivial to invoke that Gradle task from the Teamcity build.
Have a look at the publishing documentation for details on how to set it up.

Spring tool suite maven project localhost is not working

I am a beginner in Spring Tool Suite. I installed it on my mac machine and imported the project (It is for working an API for angular project). After that, I went to "Right click project -> run as -> maven build.."
On that window I gave the command "clean install" and checked the skip tests check box. Then when I click on run, it is showing the message like below:
BUILD SUCCESS
Total time: 10.938 s
Finished at: 2019-10-10T12:38:55+05:30
But when I try the url on angular, it is showing the below error
OPTIONS http://localhost:8082/home/language/?timestamp=1570691353510 net::ERR_CONNECTION_REFUSED
I have doubt about the port and not sure how to check that in Spring tool suite.
Any idea on how can I fox this? Any help could be appreciated. Thank you
Running Maven's clean install does not run your app. It only assembles it in a distributable package and places it in your Maven repository.
You should probably execute spring-boot:run to run your Spring Boot app, or a custom task (may be just run or tomcat:run) if it is an old-fashioned Spring MVC app.

Starting a simple JUnit / Maven project in IntelliJ Idea

I'm trying to find the quickest way to get a simple JUnit test up and running with IntelliJ IDEA and Maven. This is what I do:
File > New Project
Maven > Create from Archetype > org.apache.maven.archetypes:maven-archetype-quickstart
Give it a unique GroupId and ArtifactId ("testingmaven")
Give it a project name ("testingmaven")
Click Finish
At this point, I get the following file structure:
project
|_src
|_main
|_java
|_testingmaven
|_App.java
|_test
|_java
|_testingmaven
|_AppTest.java
But I can't run anything. When I put a simple JUnit test in AppTest.java and click "Build > Run" it forces me to update configurations. It doesn't seem to recognise my files as Java.
I just want to be able to start a Maven project, write a simple JUnit test, and run the test.
I'm coming from Ruby, so I know I'm just not used to package organisation and IDE configuration.
Am I missing something?
Is it because of the archetype I'm starting with?
When I tried to start a Maven project without an archetype, I didn't get pom.xml.
Is there a better archetype for my purposes?
The fasters way for creation Maven project is generating it from a console -> import to IDE.
for this purpose you can use maven-archetype-quickstart archetype.
Just execute following command:
mvn archetype:generate -DgroupId={com.mycompany.app} -DartifactId={my-app-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
You have to replace {...} params with your data, like project name and packages.
maven-archetype-quickstart automatically adds junit to pom file and creates test stub. By default, junit version is 3. My suggestion is to update it to 4.
After this you can easily import this project with Intellij Idea:
File > New > Project from Existing Sources > select pom.xml (double click) > Next ... > Finish
Also don't forget about formatting shortcut Ctrl+Alt+L
Useful link:
How to create a Java project with Maven
Steps if you've already created your maven project with IntelliJ without archetype:
Place cursor somewhere inside your class
Press <Alt>+<Insert>
Select Test...
Choose the methods you want tested and any other options
Source
Notes: in my case, I chose JUnit5. I had to import those modules into the project afterwards (the contextual help offered by pressing <Alt>+<Enter> did the trick).

How add alfresco extension to project which is build on alfresco maven sdk?

Suppos that repo and share module were generated from maven alfresco archetype as described here. And now it needed to install one of alvex addons. It is clear that jars/amp can be build from sources, but what to do with this? Where to put they in generated maven project to get them installed in alfresco when mvn integration-test -Pamp-to-war is executed?
That tutorial assumes two separate maven projects created using the repo archetype and the share archetype, respectively.
If you want to be able to run integration tests with multiple AMPs you may rather use the all-in-one archetype instead.
See How to use external AMP in alfresco Maven Project

Jenkins - Ant Build Maven Deploy

I have a project with a complicated ant build that we would like to remain as ant at the moment (will be converted to maven eventually).
I am using jenkins at the moment to build/test our application. After build/test, I now want to push the built artefact to a Nexus repository.
For a Maven project, I can use the post build action "Deploy Artefacts to Maven Repository" to do this.
Whats the best way to structure my Jenkins jobs to achieve an ant build and then deploy the code to Nexus?
Have you seen the example Ant scripts in the Sonatype website?
They actually include pushing artefacts to Nexus:
http://central.sonatype.org/pages/apache-ant.html#signing-and-deployments-using-the-maven-ant-tasks
Or there is also some more docs at Sonatype:
http://books.sonatype.com/nexus-book/reference/staging-deployment.html#staging-ant

Categories