FitNesse: Could not invoke constructor for SeleniumDriverSetup[0] - maven

So, I've successfully completed the installation of IntelliJ using hsac-fitnesse-fixtures installation guide.
Next I've set up a project, added the IntelliJ Idea Fitnesse plugin, added a Maven configuration.
FitNesse runs correctly, ending with Starting FitNesse on port: 9090
Next I try to run a test on a test environment, but that fails.
The 1st failure is:
Could not invoke constructor for SeleniumDriverSetup[0]
The 2nd failure is:
The instance scriptTableActor.startDriverFor. does not exist
This is an HSAC environment.

I'm sorry I did not see you question earlier.
It appears I did not update the installation guide when making a change to how the wiki should be started from the IDE. I only updated the project's README.
Anyway the problems lies it the command used in the maven configuration the guide instructed you to make. The Maven command has to be compile dependency:copy-dependencies exec:exec and the guide missed the 'dependency:copy-dependencies' part. Using compile dependency:copy-dependencies exec:exec should fix your problem.

Related

Run dynamic web project with maven in debug mode

I built a dynamic web project with tomcat7 server on maven. To test the project I run mvn tomcat7:run every time anything is changed. This seems to time consuming.
Is there any way to run this in debug mode so I don't have to run project every time I change something in files? mvn --debug doesn't seem to work.
You can use JRebel.
See the answer to this question from stackoverflow for configuring maven with JRebel.
use mvnDebug for debugging/breakpoints.
Otherwise if any class change yup you have to restart (in order to recompile)

Maven. Creating a project offline fails so how do I begin?

First off I'm not on a separate system in order to post this question and have no way of connecting the other system to the internet. This machine I'm on is locked down so I am not able to install or do anything other than email and view the web for research.
Used Reference: http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
Environment: Maven 2.2.1
Yes the Maven build functions fine for the existing project.
Situation:
I'm new to Maven and this project I'm on, the other developers are GONE. There is a .bat file that was used to run the project builds and that's all I know of Maven.
I am attempting to learn Maven on the other machine that has it installed I am using the Apache site mentioned above. The instructions tells me to create a project using the command
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false but, I get the
'BUILD FAILURE'
Error reading archetype catalog http://repo1.maven.org/maven2... (and other errors)
The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype=quickstart:1.0
So, question is what am I to do in order to create a dummy project so I can see WTF is going on with Maven when I'm in an environment that is not able to reach the 'maven.org' site?
If there are threads on learning Maven offline that someone can point me to that too would be of use. I'm not seeing anything though that helps me get started on this.
Thank you for looking and your time.
The problem seems that maven is looking for the architype on the central repository.
You can create your own pom.xml with an editor:
http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

Maven plugin execution change Maven properties or skip build lifecycle steps

When I build my application with maven, I run mvn clean install. As a part of the install lifecycle, I run appengine:devserver_start from Google's GAE Maven plugin. This appears to be already bound to a step in the lifecycle and therefore it reruns some build steps from the beginning, even though me running mvn install did those. For example, the resources step is rerun. I had my own Java script run to download the latest resources for my build. But because of appengine:devserver_stop, I need to uselessly run this cript again because the resources step is re-executed.
I can think of two ways I can avoid this, but I'm not sure how to configure both ways. The first would be to somehow skip re-running build steps that I've already run. The other way would be to change the Maven POM properties just for the plugin execution. I have a Maven property set, either to true or false, that I can use to set the skip setting for the Java script I use during resources (because I run this script using the exec-maven-plugin). Think of this as a Maven property that can be set with the -D flag. Can I have this property changed just for the plugin?
If you are having trouble thinking about my scenario, consider what happens when you run mvn compile install. All build lifecycle steps until compile will run, then all compile steps until install will run, including compile.
A common/easy way to solve this kind of problems is to use maven profile. Just create a new profile that includes the plugin with preferred phases.
You should probably don't fight with it and just run clean appengine:devserver_start instead of clean install. Read my answer here for a more detailed explanation:
https://stackoverflow.com/a/17638442/2464295

How do you debug Maven plugin tests executed with the maven-invoker-plugin?

I would like to attach to some tests for a Maven plugin being executed with the maven-invoker-plugin. How does one do this? I can't seem to find any resources and it doesn't seem to be by simply doing:
MAVEN_OPTS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9001" mvn clean install
I mean -- I can connect this way, but when the maven-invoker-plugin starts, it just sits there. Forever...
Any help would be appreciated.
You must be aware that maven-invoker-plugin invokes a separate instance of Maven for running integration tests like a manual call of mvn with the appropriate configuration options. That's the reason why maven sticks...
You can put the appropriate options into invoker.mavenOpts or into a invoker.properties file.
An other option would be to change the mavenExecuteable and use mvnDebug instead of mvn.
Apparently, (after further inspectiong of the build.log) with the above mentioned way, it freezes simply because Maven is waiting for you to connect with a remote debugger a second time -- this time for the forked process.

Unable to test Jenkins plugin

I am actually trying to develop a Jenkins plugin using maven but I am unable to test it.
I created my project with the command mvn -cpu hpi:create. I called the project jenkins-plugin-tutorial. I packaged it with mvn package or mvn install and run the Jenkins server with mvn hpi:run.
By default, there is a HelloWorlBuilder for testing purpose that should appear at the Jenkins configuration page (Jenkins Menu -> Manage Jenkins -> Configure System) or under the Build section, but it does not display.
I followed these two tutorials (here and here) step by step many times by making sure that I do not make a mistake but it still dont work.
Maybe I have made something wrong. Can somebody gives me some hint how to correct my errors.
In pom.xml, try changing parent to this:
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.454</version>
</parent>
I just did quick test with that hpi:create, and it worked for me, I got both global and job config things as expected, but I had to do that change to pom.xml, before I got it to compile.
That is, I did:
mvn hpi:create
entered groupId foo.hyde.jenkins.plugins, artifactId hello-world when prompted.
cd hello-world
mvn install failed
Edit pom.xml to change the parent
mvn install succeeded
mvn hpi:run -Djetty.port=8092 succeeded (Using that port because other Jenkins is already in default port, otherwise -D... not needed.)
Go to http://localhost:8092, check global config, create job and add the build step
And it worked for me.
I'm using Maven 2, version 2.2.1.
I finally find the answer to my questions. The problem is that I was using an old version of maven, the 2.2.1 version. So I change to the last version, 3.0.4, everything is fine now.

Resources