Distributing PhantomJS binaries and Java bindings in public Maven repositories

2,672 views
Skip to first unread message

Lukáš Fryč

unread,
Nov 27, 2012, 11:13:27 AM11/27/12
to phan...@googlegroups.com
Hey guys,

if I understand that correctly, current recommended way to running PhantomJS/GhostDriver is executing platform-dependent executable:

$ phantomjs --webdriver=PORT

or using 

PhantomJSDriver


I would like to make this little bit more pleasant for Java users (particularly Maven/Gradle/Ivy/etc. users),
which could get platform-dependent PhantomJS binaries downloaded from Maven repositories,

and thus using PhantomJS WebDriver bindings would be just about declaring dependency.

The PhantomJS binaries can be distributed to Maven repository using maven-deploy-plugin:

Would anyone be interested in this project?

I can proceed with proof of concept and once done,
we could deploy binaries to public repository, e.g. [1],
from which it can be distributed to Sonatype repo [2].



Cheers,

~
Lukas Fryc
Software Engineer
JBoss by Red Hat

Ariya Hidayat

unread,
Nov 28, 2012, 1:47:27 AM11/28/12
to phan...@googlegroups.com
Is there anything we need to from our side to make this happen? If
not, then I won't stop anyone from doing it :)



--
Ariya Hidayat, http://ariya.ofilabs.com
http://twitter.com/ariyahidayat

Lukáš Fryč

unread,
Nov 28, 2012, 10:05:57 AM11/28/12
to phan...@googlegroups.com
Hey Ariya,

thanks for support.


Unless somebody know about similar initiative which is already in progress,

or have a better idea how to make this happen?

~ Lukas



--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
Visit this group at http://groups.google.com/group/phantomjs?hl=en.



Ivan De Marino

unread,
Dec 2, 2012, 7:35:03 PM12/2/12
to phan...@googlegroups.com
PhantomJS Driver bindings are already part of Selenium `trunk` and will be part of next Selenium release (2.27).

Java, .Net and Python are currently covered. And I believe there is some work going on to cover for Ruby.

No need to do anything else :)
Or, if you want it now, download latest Selenium code and build the jars with "./go release".

Ivan

Lukáš Fryč

unread,
Dec 3, 2012, 2:30:04 AM12/3/12
to phan...@googlegroups.com
Fantastic news, Ivan!

I can't wait to try Java bindings out. :-)

Piotr

unread,
Dec 23, 2012, 12:43:21 PM12/23/12
to phan...@googlegroups.com
Actually it seems that Selenium PhantomJS driver is not available via Maven but only through zip distribution. I opened a defect for this at http://code.google.com/p/selenium/issues/detail?id=4939.

Piotr

Sridhar G

unread,
Dec 28, 2012, 10:59:39 AM12/28/12
to phan...@googlegroups.com
I don't think raising a defect for this in selenium is going to help us.
Since the selenium group clearly mentioned in one of the discussion that it as to be managed by the vendors (phantomjs/ghostdriver) and selenium is not going to deploy the artifact in maven repository. (link for the disucssion https://code.google.com/p/selenium/issues/detail?id=4644#c12)

This means either Ivan or Arya should deploy the artifact in maven central repository.

Cheers,
Sridhar G.

Ivan De Marino

unread,
Dec 28, 2012, 11:02:06 AM12/28/12
to phan...@googlegroups.com
Could please raise this defect against the GhostDriver issue tracker?

If there is an issue with that, I can fix it in both selenium and:or GhostDriver

-----
Ivan De Marino
Coder, Cook, Cyclist, Gamer

Sent while standing on one leg

Piotr Jagielski

unread,
Dec 28, 2012, 11:10:17 AM12/28/12
to phan...@googlegroups.com, Ivan De Marino
I opened an issue at https://github.com/detro/ghostdriver/issues/142

Regards,
Piotr

Sridhar G

unread,
Dec 29, 2012, 6:16:05 AM12/29/12
to phan...@googlegroups.com, Ivan De Marino
Cool. Eagerly waiting for the update :)

Lukáš Fryč

unread,
Jan 9, 2013, 4:19:01 PM1/9/13
to phan...@googlegroups.com, Ivan De Marino
Hey guys,

we have brain-stormed over the idea of distribution of binaries in Maven and come up with following prototypes:


The [1] is for packaging and installing platform-specific phatomjs binary as JAR to maven repository.

Second project [2] leverages this binary distribution and wraps/enhances capabilities of PhantomJSDriver:
  • it uses either executable binary which is on PATH
  • or it fallbacks to using the binary packaged in JAR [1]
    • in this case the binary is extracted and made executable
    • it also checks if binary is already in place and if it's right version

Why all that?

We assume that people will likely want to run tests on cloud services supporting Maven,
but we can't make any assumptions about target environment other than having Java and Maven available.

We need then distribute all build dependencies through standard path.

This will made the PhantomJSDriver-based build completely reproducible and setup free.

@Ariya, Ivan, can we go ahead and release those into repository?
Do you have any ideas what to improve?

Can we go ahead and release those under the "phantomjs" artifactId/groupId?
So far we have chosen org.jboss.arquillian.phantomjs namespace, but that's the topic for discussion.


Btw. thanks to Jan Papousek for all the prototyping work!


Cheers,

~ Lukas


Dne sobota, 29. prosince 2012 12:16:05 UTC+1 Sridhar G napsal(a):

Dominik Dorn

unread,
Jun 18, 2013, 11:32:48 AM6/18/13
to phan...@googlegroups.com, Ivan De Marino
Any updates on this? 

I want to include PhantomJS with Selenium in my maven build too. 
I'd like to configure it in a way, that maven automatically downloads the correct executable,
extracts it, runs it in the background and starts my selenium tests. 

If there's a howto or some page/support for it, please update this thread - its #1 in Google Search results for
PhantomJS Selenium Maven and people will probably look here first. 

Thanks,
Dominik

Lukáš Fryč

unread,
Jun 18, 2013, 1:06:23 PM6/18/13
to phan...@googlegroups.com
Hello all,

we have successfully integrated PhantomJS with Arquillian Drone and WebDriver recently.

Project which installs binary into Maven repository

Project which resolves binary from Maven repository

Don't be confused by naming, they are both standalone projects, the license conditions doesn't allows us to name the artifacts following PhantomJS naming.

You can find binaries in JBoss Nexus so far:

We will release 1.9.1 as soon as we resolve issues with changing binary versions in phantom-driver project.

~ Lukas


You received this message because you are subscribed to a topic in the Google Groups "phantomjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phantomjs/yZj_ciH21pE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Lukáš Fryč

unread,
Jul 11, 2013, 3:16:54 AM7/11/13
to phan...@googlegroups.com
We have changed the approach how binaries are resolved - they are resolved in runtime (instead of build-time) and but they are still cached in local Maven repository.

We have also fixed the issues on MacOSX.

I have released 1.1.0.Beta1 together with 1.9.1 binaries, you can grab the release again in https://repository.jboss.org/nexus/content/groups/public/

Read the updated instructions:

~ Lukas

Stein Morten Hugubakken

unread,
Jul 24, 2013, 9:06:45 AM7/24/13
to phan...@googlegroups.com
Hi!

Can you give ab example of how I would use arquillian-phantom-binary in my mavenproject to have it download the binary?

Regards
Stein Morten

Lukáš Fryč

unread,
Jul 24, 2013, 9:23:58 AM7/24/13
to phan...@googlegroups.com

Stein Morten Hugubakken

unread,
Jul 24, 2013, 10:58:10 AM7/24/13
to phan...@googlegroups.com
Hi!

Is it possible to use the  arquillian-phantom-binary dependency standalone in my pom.xml to have maven download the phantomjs-binary to the target-directory?

What I need is to have phantomjs available for the jasmine-maven-plugin without the developers need to install anything other then to run maven.

Kind regards
Stein Morten

Lukáš Fryč

unread,
Jul 24, 2013, 5:00:12 PM7/24/13
to phan...@googlegroups.com
I can't think of any simple way how to achieve that just with Maven.

----

You can use MavenPhantomJSBinaryResolver though:


~ Lukas
Reply all
Reply to author
Forward
0 new messages