I have a question regarding building and integrate my Java project. My source is located on BitBucket. Is there an online tool where I can build and install my Maven project? My goal is that the source on BitBucket is used and compiled. Afterwards it would be great to download the generated jar-file from the provider.
Thanks for your help,
Thomas
If your question is about online development
You can open your project in a Gitpod. It provides a full fledged editor and terminal wherein you can install dependencies and build your application. Has a bitbucket integration to directly port your code to the editor.
If your question is about continuous integration
You can add CI integration with BitBucket Pipelines or Circle CI to your application and write Jobs and Stages in a dedicated config file ( depending on your chosen CI tool ) to build, test and deploy your java application.
Related
Current state:
Multi-module Java 6 project using Eclipse plugins, application is distributed for Windows platform only as an exe file with directories with many jars and some init and configuration files. These client distribution is build via Jenkins using Eclipse Buckminster plugin. These project was written around years 2010-2012 and desperately needs refresh.
I mavenized project, which means that each module has now its own pom.xml with dependecies. All modules were successfully built using mvn install command.
Question is how to build and distribute complete application with maven and say goodbye to jenkins & buckminster.
Where I see problem(s):
I don't fully understand what Buckminster actually do and how to set up properly OSGi/Eclipse Equinox launcher. There are few files like .cspex, .cquery, .rmap and even some Ant xml files where some magic happened, but it's not clear for me.
Is it even possible to use Maven (maven shade plugin) to build such app? Has somebody experience with it?
I was wondering what could be the good answer to "Why was the need to use Maven and Not Jenkins or other framework"
This is with respect to an automation project created in selenium and testNG with Maven framework
There are a couple of fundamental and functional difference between the usability of Maven and Jenkins
Maven :
Apache Maven popularly known as Maven is a Software Project Management tool. Based on the concept of a Project Object Model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information dynamically which is configured through a file pom.xml.
From Selenium Framework perspective, Maven enables you to to get rid of the manual configuration of Selenium JARS and WebDrivers. You can easily switch over from one version of the underlying software to another through a simple update in pom.xml.
Jenkins :
Jenkins is a popular tool for Continous Integration (CI) which can be used as a simple CI server or turned into the continuous delivery hub for any project. Jenkins being a self-contained Java-based Program is always ready to run out-of-the-box with packages for Windows, Mac OSX and other Unix-like operating systems. Jenkins can be easily configured through its web interface to integrate on-the-fly check-ins and built-in help.
From Selenium Test Automation perspective, through Jenkins you would be able to schedule the Test Execution whenever you require and as many times you may require.
I have modified the Web content folder & then did the Clean project followed by build project. But still there is no change in project.
I am using tomcat server 7 & JRE1.7.
What is the best way to build a java dynamic web project? How to ensure each & every file of the project gets re-build?
I cannot create a comment on this question so have to put it up as an answer..
Java dynamic web project is not building
What kind of build tool are you using? i.e Maven, Gradle, Ant
I have modified the Web content folder & then did the Clean project
followed by build project. But still there is no change in project. I
am using tomcat server 7 & JRE1.7.
Tomcat is there to deploy your web project, so if your build is failing you will not be able to deploy it successfully to your tomcat server. Maybe you could provide us with some sort of error message?
What is the best way to build a java dynamic web project? How to
ensure each & every file of the project gets re-build?
Don't think you will find any "best way", but there's several options out there you can use. Fast google search for build tool
Maven
Gradle
Ant
This is just a few.
I've got a Java web application that builds with Maven. My project uses RequireJS. I use a maven plugin at build time to compress the JS artifacts (https://github.com/bringking/requirejs-maven-plugin). The plugin calls out to NodeJS (with the r.js compressor) to do the actual work.
Local builds work wonderfully.
On Heroku, however, NodeJS is not available using the Heroku Java buildpack (the default for Java/Maven applications).
For now, I run the requireJS maven plugin locally using an active Maven profile that isn't present on the Heroku server. This prevents the RequireJS plugin from running on the Heroku server. This is less than ideal because it requires me to run the plugin locally, then check in the resulting build artifact. It's far better to generate the compressed JS file at build time in the Heroku system.
I'm looking for a good solution. Thanks in advance.
The best solution is to use Heroku Multi Buildpack with the Node.js and Java buildpacks. This is described in an article using Grunt with Java and Maven but the same principles apply for Require.js.
I'm currently building a desktop java application in a very clumsy manner. The application is deployed on Windows, Mac and Linux. Here's my build process now:
On Windows:
Update local repository
Fire up Eclipse
Refresh the project
Double click the .jardesc file to generate an executable jar file
Commit the executable jar to source control
Open up the .nsi script and click the build button (I have NSSI plugin installed) to produce the .exe installer
Upload installer to ftp server to publish
On Mac:
Update local repository
Run shell script to generate .dmg file using .jar in source control
Upload to ftp server to publish
On Linux:
Update local repository
Run shell script to generate .deb file using .jar in source control
Upload to ftp server to publish
I'd also like to include some extra steps in my build in the future, such as:
Setting build date
Setting the HEAD git commit-id
Performing some code obfuscation
Any suggestions on how I can streamline and speed up this process?
If you are serious about having a good build system, then I'd recommend learning and using Maven, which provides:
Comprehensive project build lifecycle management based on a declarative project definition (pom.xml)
A huge range of plugins, which I expect will be able to handle all the specific build steps you require
Very good integration with Eclipse
Full dependency management (including automatic resolution and download of dependencies)
This is not for the faint hearted (Maven is a complex beast) but in the long run it is a great solution.
First step would be to just get everything building without Eclipse.
You might also want to consider using something like Jenkins to automate some of this. You'll still require build scripts.
A solution could look like
Update repository.
Jenkins detects update and builds the jar.
Jenkins saves the jar to some location.
Then you can have separate builds for each OS, also running in Jenkins. These could be triggered automatically on successful completion of the first build. These would each:
Pick up the jar from the previous build.
Publish the OS specific binary to an FTP site.
Ant is a good start, but you may also want to look at Apache Ivy or Maven, as these will help a bit with managing your build outputs and dependencies.
You should have a look at Ant: https://ant.apache.org/
Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications.
Also, a long list of build systems: https://en.wikipedia.org/wiki/List_of_build_automation_software