Limitations of Team Foundation Server Builds - java

What are the limitations of TFS in heterogeneous development environments?
I have little expirience with Jenkins and like the possibility to run all those different kinds of jobs, like Ant, Maven, CMD, Powershell, ...
Is it possible to check coding conventions when building a java project with team foundation server?
I do not know how java builds with TFS work. I saw a presentation form Microsoft and the guy mentioned Maven and Ant Tasks. So I assume it can be done with a checkstyle plugin in Maven.
Is it possible to run CMD skripts?

The tool mentioned is probably the Team Foundation Server Build Extensions Power Tool December 2011.
These add the ability to trigger standard Java build scripts from Team Build.
The Java build processes just invoke maven or ant, so any task that checks code quality in these build tools should work just fine in Team Build. The team at Microsoft choose not to make a complex build template for the Java people, as they are well accustomed to their own build tools. So the build process templates to execute a Java build aver very thin by default. Everything is done through standard Java tooling. Team Build just invokes these and gathers the output.
As for executing command scripts and other executables as part of the build, there's a number of ways you can do this. The right way depends on the thing you want to accomplish.
If you want to execute something as part of the building of the binaries, you can use the msbuild exec task or an equivalent task in ant/maven.
If you want to execute something after all binaries have been built (say to trigger deployment) you can use a Build Activity in the build process template to execute a process
if you want to execute something before building the binaries on a build agent, you can use the same activity, but you should place it in a different place in the workflow.
The Visual Studio lab management build template and the Build Deploy Test build template serve as a good starting point to learn more about the possibilities of invoking processes during the build process.
As mentioned in other answers, the SVNBridge and possibly Git2tfs might provide alternative ways for the Java team members to access sources in TFS. They can then use the existing ant/maven tasks to get the sources and build the code.

You are very likely to get a lot of personal opinions on the use of TFS and whether or not it is a good fit, especially for JAVA development. That said, for the purposes of plugging in ANT/Maven/Jenkins you could install SVNBridge to give you the same functionality as you'd find with SVN.
It doesn't mean that there aren't plugins for TFS to support the tools, I've just found SVN related plugins are a lot more accessible.

Related

Java beginnings using Netbeans

I'm just about starting to learn Java. Reading about, I installed Netbeans.
Running Apache Netbeans IDE 11.2.
The Java version is 13.0.2.
I'm promptly follow the Quickstart guide on the netbeans website.
File>>New project>> Java >> Java Application.
Errhmm, I don't have this 'Java' option. All I have is
So what's the difference between Java & Java with Maven/Cradle/Ant . At this point in time, I intend to start with basics of Java programming and then move on from there. SO which option am I meant to be starting with? If I'm missing Java, how can I add it ? Going through the installation procedures didn't give me any option to choose from.
p:s - this is all running on Mac OS Catalina
You can start with any of Java with ... option. I use Java with Ant option.
Maven, Gradle, Ant are build-tool addons i.e. they provide additional support if you intend to use any of these as your build tool.
When you choose Java with Ant option, it will let you create, compile, debug and run your Java programs without requiring anything additional. After using this option, you will get an interface as shown in the screenshot given below:
Maven, Gradle and Ant are build tool which allows you to compile, unit test, package and (if you like) even deploy your Java applications (they do support other languages btw).
I suggest you to start with one of those (Maven is very popular and probably a little bit easier than the others) instead of relying on your Java IDE specific features.
Once you master a build tool you can change IDE (IntelliJ is also a very good option ;-)) and will still work as before. You also find plenty of resources and help (like Stackoverflow) if you need hit some problems.
Best of luck!

Ways to create a mapreduce web application

I want to create a website, and part of the website I will implemented with(Hadoop mapreduce). I start using the Eclipse with maven plugin, on my operating system (Mac OS).
I start coding with apache maven for my code. "I still not implement the website".
My question does the maven run with cluster of machines or not?
any advice of how can I create a website with part run in mapreduce??
Please help
Thanks all
Apahe Maven is not "something, that runs our code". It's actually a build tool: Apache Maven is a software project management and comprehension tool. (https://maven.apache.org/). You can manage dependencies, build, deploy and do other related stuff.
If you want some interface to your cluster, I recommend to look at zeppelin (https://zeppelin.apache.org/).
It's an interpreter for a bunch of stuff and it can be easily deployed to your server (I did it by building sources from https://github.com/apache/zeppelin and running it). Zeppelin's spark interpreter can be run in yarn-client mode, which just submits your code to cluster (yarn hadoop cluster in my case) and runs it.
Seems pretty similar to your description.
The answer to your question: maven had nothing to do with "running on cluster".

How does one know what IDE was used for an open-source Java application?

I'm new to Java and Eclipse (C# developer here). I have a requirement to take an open-source Java application (OpenFire) and modify it to suit our needs.
I downloaded Eclipse Juno, I downloaded OpenFire. But something tells me that OpenFire was written using another IDE because when I try to open it in Eclipse, it complains about the element missing in the build.xml file (I used the "Open from an existing Ant BuildFile" option, which OpenFire has).
What can be the best way to approach this type of situation knowing that open-source can be written using so many tools out there? The goal is not to have to change much of the files just to get it into an IDE.
Any help or direction would help.
The IDE does not make a difference to the project unless there are IDE-specific artifacts like .classpath in the project tree. The build.xml file format is set by Ant, not by any one IDE, so it is extremely unlikely that the IDE is the source of your difficulty.
However, IDE-specific files have no place in the source repository.
Rather than chase down a red herring, look at the error in the build.xml and fix that.
Also, to diagnose if your IDE is mismanaging Ant, use ant from the command line to build your project. You should never depend on the IDE to build your project for you, and never use the IDE to build the project for someone else to use. Always use standard build tools like Ant or Maven or Gradle, and always run them from command line or script to get "official" builds.
If you can run your build that way, you are guaranteed independence of IDE irregularities.
What can be the best way to approach this type of situation knowing that open-source can be written using so many tools out there?
This problem has been already solved by IDE and platform independent build tools which are tightly integrated with most of the popular IDEs
Maven, Gradle are examples of such tools
These build tools also has standard configuration and directory structure which is understandable by popular IDEs

Java Build; with these requirements, what would be a good choice?

This is in regards to building a Java Project.
So I'm a bit confused on my options here.
My requirements (it's a small project):
Needs to compile Java project with specific/custom compiler arguments
Project has native libs that need to be included
need to compile javascript->java class via Rhino javascript compiler (https://developer.mozilla.org/en/Rhino/JavaScript_Compiler)
After the build I need to run another command: ProGuard (http://proguard.sourceforge.net/)
run javadocs
Package everything up in Jar (also including external data, ie, images, xml, ini, etc)
Build/create a .jnlp web start.
Available under both Win and Linux would be optimal.
this is a hobby project, so don't want to spend weeks learning/managing the build system. At most an 8-12 hour investment start to finish (otherwise it's just better to keep doing everything by hand).
btw, my IDE is Eclipse if it matters; a nice integrated plugin would be nice - but not required.
So far I think Ant and Maven are the main two build systems in use. It's very unclear to me though which one I should use or how they differ?
The other option would be 'make' under linux (or maybe cygwin). I've only used it once, but seemed pretty quick to get going/working. Is that a good option for Java or this project? Any downsides to make? Why don't more java developer's use it?
Other options?
In a nutshell: spend your 12 hours learning and using Ant.
Maven has a good feel out-of-the box, super-easy to get going and with the neat dependency management, but down the line tweaking the pom.xml (your project's maven build file) to fit your needs will require more fiddling with than if you used Ant.
To address some of your specific requirements:
you can use <compilerarg> elements with the <javac> task
for native libs you can add them with: <sysproperty> and key="java.library.path"
use Rhino with Ant (http://stackoverflow.com/questions/3526960/using-recent-rhino-in-ant-script)
there is a Proguard task for Ant (http://proguard.sourceforge.net/index.html#/manual/ant.html)
for javadoc Ant comes with the <javadoc> task out of the box
the <jar> Ant task is extremely easy to use to package everything up
there is a <jw:jnlpwar> task available from the [Ant Web Start Task project] at (http://ant-jnlp-war.sourceforge.net)
Ant is ubiquitous, it works for just about every major platform out there (Linux, Unix, Windows, MacOS)
with plenty of docs and examples available on the web, you'll pick-up Ant in no time, and those hours you'll spend learning it will probably "pay" themselves back within a couple of weeks of using it for your builds.
Eclipse integrates with Ant out of the box (http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-81_basics.htm)
It may not do fancy dependency management out-of-the-box like Maven (although for that you can integrate Ant with Ivy) but it certainly provides you with all the flexibility you'll ever need, and you won't find yourself "fighting" the build tool configuration file as it's fairly common with Maven.
I should probably just mention the 2 new names in Java build (and CI) tools: Hudson and Jenkins. They're fairly recent and may be interesting to look at, but I would definitely not recommend them to you and your project at this early stage.
Note: apologies for the lack of real links (only allowed 2 links atm)
Maven is the best choice here as it has integration for all of these
so go for it.
Here, quick links for you to save an extra hour to spend on learning maven ;)
Maven Compiler Options
Native Maven Plugin and Projects with JNI
Use Maven Antrun Plugin to Run rhino compile ant task
Use Proguard Maven Plugin (further details)
Maven Javadocs Plugin
Maven Assembly Plugin
Webstart Maven Plugin
Its java based so supported by most OS that support java !
It depends how quickly one can learn but AFAIK 12 hrs is sufficient to get started

Building RAD7 project from command line

We have existing projects set with compilation dependencies in a RAD7 IDE.
Is it possible to create automated build script from the existing project structure?
We have IBM portal projects and regular WEB and enterprise projects.
Maven and Ant are possible solutions but can we use these tools to build existing projects
from command line without using the IDE itself?
Also is it possible to call RAD \ eclipse core compilation from command line or API?
Thanks
You need to look into "headless mode". That's basically running the IDE to perform its work without the IDE showing up.
I don't have any direct experience but one of the teams in our lab used RAD in headless mode to automate builds for an Eclipse/System-z interface.
You can find information on headless Ant builds in chapter 23 of the Rational Application Developer V7 Programming Guide Rebook. There's more documentation in the IBM Rational Application Developer Version 7.0.0.x Information Center (which you should also be able to find in the help).
There are a number of projects already using Tycho to build Eclipse components using Maven:
There is a somewhat dated tutorial for Tycho here: http://www.sonatype.com/people/2008/11/building-eclipse-plugins-with-maven-tycho/
For more information about the Tycho development effort: http://www.sonatype.com/people/2009/03/the-future-of-maven-osgi-join-the-tycho-users-mailing-list/
Based off the answer in Build Eclipse Java Project from Command Line. You can do the following
"%RAD_INSTALL%\jdk\jre\bin\java.exe" -Dwtp.autotest.noninteractive=true -cp "%RAD_INSTALL%\startup.jar" org.eclipse.core.launcher.Main -application org.eclipse.jdt.apt.core.aptBuild -data "%WORKSPACE%"
Where you configure the variables %RAD_INSTALL% to your instance of RAD and %WORKSPACE% to the workspace which houses the projects you want to biuld.

Categories

Resources