My goal is to run unit tests in fitnesse.responders.run.slimResponder for testing my DataFlex SlimRunner implementation. So I downloaded the Fitnesse source code, and made it a new Java project in Eclipse. I was able to compile it by selecting Run As Ant Build (2) on the build.xml file. But in order to resolve include errors in the Problems view in Eclipse, I ended up manually adding dozens of external JARs by hand. I found that Maven/Ivy had apparently downloaded the jars as part of the Ant build. But somehow these were not added to the Java Build Path.
It seems reasonable to me to assume that there should be an easier way to set up the Java Build Path than to add the JAR files manually, since build.xml apparently contains all this information already. What am I missing?
The Fitnesse Readme.md mentions using Apache Ivy for dependency management. Download IvyDE from Eclipse Marketplace, and set it up (use the ivy.xml that is part of the Fitnesse source code).
Related
enter image description hereAdding jar files from the latest version of selenium 3.141.59 show missing after adding them inside the build path of my project.
Windows 10, Eclipse, selenium 3.141.59
the client- combined files shouldn't be missing. previously it worked out.
If you are using the Selenium Java Client in addition to adding client-combined-3.141.59.jar with the build path of your project you also have to add the following jars from the libs sub-directory:
byte-buddy-1.8.15.jar
commons-exec-1.3.jar
guava-25.0-jre.jar
okhttp-3.11.0.jar
okio-1.14.0.jar
Snapshot of libs sub-directory:
Refreshing/Updating as #Rakib mentioned in comments might work.
However, I would suggest having some Build Tools such as Ant, Maven or Gradle in place for Dependency Management. This would automatically resolve and import the required jar files.
The current format of handling jar files would be confined to local and if you try to export the project into a different operating system that would throw an error defining missing jar files.
I have added all the jar files but still showing error for particular client combined jar files. show as corrupted. However I managed to download it from the following link: https://www.seleniumhq.org/download/
enter image description here
Use maven. It is very easy to maintain java projects with it. In case you are missing something, you can easily add dependency, or in case everything is on your project, but not on your local machine, you will just need to refresh your dependencies and maven will do the rest. here is the link: http://maven.apache.org/
I had a GWT app, and I wanted to automate its build and deploy system, since I do it manually. But I did not find a way how to build the app from command line, so it can than be automated. I had to click the Google button, then compile GWT project and then click Compile.
I found out that it is possible to create a GWT maven project and that it should then be possible to compile my project from commandline with mvn gwt:compile.
So I created a new project using this plugin. Copied my sources from the old project to this new one.
Now the structure is like this:
/src
---/main
------/java -> here are all my sources including my Project.gwt.xml file.
------/webapp
---/test
pom.xml
Now I have 2 problems.
1. I thought that I add dependencies to the pom.xml, and then when I build the app, it will create the jars and I can use those libraries in my GWT app. I guess 'mvn clean install' should do this, but so far I'm getting compile errors.
2. I did not get mvn clean install to work, so I added all the jars manually again... And then yes! I was able to build the app using the plugin GWT button! So I was thinking that now I can use 'mvn gwt:compile', but it fails with:
Unable to find: "com/company/project/Project.gwt.xml" on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
EDIT:
So I fixed my <moduleName> element in pom.xml, so now it finds the Project.gwt.xml. I'm trying to run:
mvn clean install gwt:compile
But I am getting compile errors. I think, it tries to build my project without the actual dependecies because it tells few classes don't exist, but those classes are part of an external library. (specifically this one). But I have it in the dependencies, so I don't know what more to do.
<dependency>
<groupId>com.github.tdesjardins</groupId>
<artifactId>gwt-ol3</artifactId>
<version>3.0.0</version>
</dependency>
Also in eclipse I had to manually add the jars to my project, so that was why it worked there and not in the command line. So I would also like to ask how to tell eclipse to get those jars and include them to the project, because otherwise eclipse is missing those dependencies and displays many errors.
First I had a problem with <moduleName> in my pom.xml was missing com.company.project prefix before the actual module name.
Then I had errors in my Java files, which was caused by RELEASE version of GWT-OpenLayers 3 library missing some of the features that I previously used by building the JAR from the GitHub repository.
Possible to execute Java Maven Project in MS TFS?
I have linked the project inside MS TFS using the POM file but it dosnt seem to open any browser(s) instances.
My POM file has a surefire pluging used to execute the TestNG xml but that dosnt seem to work,
The tests run too quickly and the results are inconsitent, is this even possible?
Thanks for your help
Use your build server to make life easier. The easiest way to create a build definition for a Maven build is to use Eclipse with the TFS plugin. You connect to your project, create a new build definition, choose Maven, and it will construct a TFSBuild.proj file (yes, the really old Upgrade Template). At the very bottom of that tfsbuild.proj file, you'll need to edit to look something like this:
Note the "Goals" entry - this can be modified to your specific goal.
In the build definition, the Configuration Folder Path will have the value of the location of your TFSBuild.Proj file - just the folder. By default, it will be created in $/YourProject/TeamBuildTypes/YourBuildName. In Source Settings, the location of the POM file is mapped to $(SourceDir).
If you are using the TFS2015 or later with vNext build system, you can refer to this link for detailed steps: Build your Java app with Maven.
I am new to writing build files and currently I am writing the ant for my project. The issue I am facing is to include the jar to in ant build file.
As per the standard 'ant build' the jars need to be kept in lib folder. But the issue is the jar is very huge, more than 100 GB of size and hence cannot be kept in GitHub.
I have put that in another repository and want to include that in my build file.
Could anyone please let me know how to include the jars in my 'pathelement location' from the url.
Apache ivy is a 3rd party dependency manager, a powerful feature built into more modern Java build tools like Maven and Gradle.
The following answer gives a detailed example, using ivy to manage classpaths and help in the creation of an executable jar.
Class not found with Ant, Ivy and JUnit - error in build.xml?
You mentioned the use of another repository. Presumably this is a Maven repository manager like Nexus or Artifactory. Ivy is capable of downloading from these. (which would be another question :-))
I've been asked to apply Maven to a project. After browsing a dozen sites it appears that it's quite vast and I'm not familiar as I'd like with similar tools like Ant. Why is it used/preferred and what does it offer over a standard Eclipse project? Also, how could it be added to an existing project?
Why is it used/preferred and what does
it offer over a standard Eclipse
project?
It is a build tool which can build your project without the need for an IDE like Eclipse. It can create a jar or war or other artifacts from the source, performing a bunch of steps like compilation, running unit tests, etc.
Where maven scores over ant is in managing third-party dependencies and in convention over configuration (which mean less lines of build script if you follow convention).
Also, how could it be added to an
existing project?
You start by creating a new maven project, following the step here.
Place it in the root folder of your project
If your source and resource files do not follow maven folder convention, update maven properties suitably referring to this documentation.
Run mvn package
It will fail if it needs any third party dependencies, which you can add as specified in the doc
With some trial and error, you should have your project running with maven, possibly, much quicker than if you were to set up the same with ant.
Others are already provided sufficient resources to read more about maven.
I suggest to start reading here:
http://www.sonatype.com/books/mvnref-book/reference/public-book.html
Maven is a great tool when you know how to use it. Maven (at core) is a dependency manager.
You include in your pom.xml (similar in function to the build.xml from Ant) all the librairies your project depends on (example : apache commons) along with their version and Maven get them directly from a repository (by default, the central maven repository)
Then you do not have to manually install any jar to make your project work. All is downloaded and cached on your local machine. You can even create an enterprise repository where you put all the jars needed by your company
Maven uses the concept of artifacts which are pre-built library projects with their own dependencies
To mavenize a project, you'll have to write a pom.xml describing your project (examples are numerous), get rid of your libs directory (or whatever classpath you described under Eclipse) and add all your dependencies to your pom.xml
You could also check Mavenizer for a first-start
But Maven is a lot more what i've just said. Read the docs, read poms from librairies and you'll get used to it quickly ;-)
If you use the M2Eclipse plugin from Sonatype, it's just a matter of right clicking the project in the package explorer and choosing Enable Dependency Management in the Maven menu. You are also advised to adjust the directories that contain the sources to the Maven standard directory layout but if you absolutely can't, you can configure that later.
Apart from that: Well, look for tutorials and documentation (for example there is the free book Better builds with Maven. Maven is very complex (yes, I don't think it is simple) and very powerful.