You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Tim Boudreau <ni...@gmail.com> on 2020/05/18 18:59:18 UTC
Gratuitous selenium dependencies added to Maven projects
Every now and then, maybe once every few months over the last few years,
I'll be working on a Maven project - maybe something completely unrelated
to web development (at the moment it just happened to a NetBeans module
project) - when I will notice the build behaving weirdly or downloading
things that could not possibly be dependencies of it. And I will find that
some pom.xml file within the project has had this added to it:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<scope>test</scope>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<scope>test</scope>
<version>1.5</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
It seems pretty clear that NetBeans is doing this - but what? And why?
Accidental keyboard shortcut? Something else?
Thanks,
Tim
--
http://timboudreau.com
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Geertjan Wielenga <ge...@apache.org>.
PS: The above two responses are based on your scenario, i.e., your code,
your module, and the Criteria class in your instructions -- on Mac OSX with
12.0 Beta 5 and JDK 14.
On Mon, May 25, 2020 at 1:59 PM Geertjan Wielenga <ge...@apache.org>
wrote:
> When I choose JUnit (i.e., not JUnit 4) in Beta 5, only these deps are
> added:
>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-api</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-params</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-engine</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
>
> Gj
>
> On Mon, May 25, 2020 at 1:57 PM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
>>
>>
>> On Mon, May 25, 2020 at 12:20 AM Tim Boudreau <ni...@gmail.com>
>> wrote:
>>
>>> Just reproduced it again on a NetBeans module project, on a different
>>> machine than I usually use for coding - different userdir, version of
>>> NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
>>>
>>> 1. Clone this repo:
>>> git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
>>>
>>> 2. Check out the commit I was working against:
>>> cd ANTLR4-Plugins-for-NetBeans
>>> git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
>>>
>>> 3. Build it once
>>> mvn -Dmaven.test.skip.exec=true clean install
>>>
>>> 4. Open the subproject antlr-utils in the IDE, let it load and expand
>>> its
>>> one package
>>>
>>> 5. Right click the class Criteria.java and choose *Tools | Create/Update
>>> Tests*
>>>
>>> 6. Accept the defaults, change nothing in the dialog (which contains no
>>> mention of Selenium), just click *OK* (note this means you are selecting
>>> JUnit as the test framework, even though the parent project depends on
>>> JUnit 4 and that's what should be used - perhaps this is the trigger?).
>>>
>>
>>
>> Note that from 12.0 Beta 4 onwards, JUnit 4 is back in that dialog:
>>
>> https://github.com/apache/netbeans/pull/2038
>>
>> Maybe try that (I see in there right now in 12.0 Beta 5, the following:
>> JUnit, TestNG, JUnit4, and Selenium) and see if it helps.
>>
>> Gj
>>
>>
>>
>>>
>>> then see if this pile of dependencies gets added to the pom.xml (and the
>>> build will fail because of dependency convergence - Selenium is sloppy
>>> about dependency management) - note both JUnit 4 and JUnit are added,
>>> *and *the
>>> parent pom specifies a different version of JUnit 4 which the version
>>> spec
>>> overrides:
>>>
>>> <dependency>
>>> <groupId>org.junit.jupiter</groupId>
>>> <artifactId>junit-jupiter-api</artifactId>
>>> <version>5.6.0</version>
>>> <scope>test</scope>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.junit.jupiter</groupId>
>>> <artifactId>junit-jupiter-params</artifactId>
>>> <version>5.6.0</version>
>>> <scope>test</scope>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.junit.jupiter</groupId>
>>> <artifactId>junit-jupiter-engine</artifactId>
>>> <version>5.6.0</version>
>>> <scope>test</scope>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.seleniumhq.selenium</groupId>
>>> <artifactId>selenium-java</artifactId>
>>> <scope>test</scope>
>>> <version>2.44.0</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>com.opera</groupId>
>>> <artifactId>operadriver</artifactId>
>>> <scope>test</scope>
>>> <version>1.5</version>
>>> <exclusions>
>>> <exclusion>
>>> <groupId>org.seleniumhq.selenium</groupId>
>>> <artifactId>selenium-remote-driver</artifactId>
>>> </exclusion>
>>> </exclusions>
>>> </dependency>
>>> <dependency>
>>> <groupId>junit</groupId>
>>> <artifactId>junit</artifactId>
>>> <scope>test</scope>
>>> <version>4.11</version>
>>> </dependency>
>>>
>>
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Geertjan Wielenga <ge...@apache.org>.
When I choose JUnit (i.e., not JUnit 4) in Beta 5, only these deps are
added:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
Gj
On Mon, May 25, 2020 at 1:57 PM Geertjan Wielenga <ge...@apache.org>
wrote:
>
>
> On Mon, May 25, 2020 at 12:20 AM Tim Boudreau <ni...@gmail.com> wrote:
>
>> Just reproduced it again on a NetBeans module project, on a different
>> machine than I usually use for coding - different userdir, version of
>> NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
>>
>> 1. Clone this repo:
>> git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
>>
>> 2. Check out the commit I was working against:
>> cd ANTLR4-Plugins-for-NetBeans
>> git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
>>
>> 3. Build it once
>> mvn -Dmaven.test.skip.exec=true clean install
>>
>> 4. Open the subproject antlr-utils in the IDE, let it load and expand its
>> one package
>>
>> 5. Right click the class Criteria.java and choose *Tools | Create/Update
>> Tests*
>>
>> 6. Accept the defaults, change nothing in the dialog (which contains no
>> mention of Selenium), just click *OK* (note this means you are selecting
>> JUnit as the test framework, even though the parent project depends on
>> JUnit 4 and that's what should be used - perhaps this is the trigger?).
>>
>
>
> Note that from 12.0 Beta 4 onwards, JUnit 4 is back in that dialog:
>
> https://github.com/apache/netbeans/pull/2038
>
> Maybe try that (I see in there right now in 12.0 Beta 5, the following:
> JUnit, TestNG, JUnit4, and Selenium) and see if it helps.
>
> Gj
>
>
>
>>
>> then see if this pile of dependencies gets added to the pom.xml (and the
>> build will fail because of dependency convergence - Selenium is sloppy
>> about dependency management) - note both JUnit 4 and JUnit are added,
>> *and *the
>> parent pom specifies a different version of JUnit 4 which the version spec
>> overrides:
>>
>> <dependency>
>> <groupId>org.junit.jupiter</groupId>
>> <artifactId>junit-jupiter-api</artifactId>
>> <version>5.6.0</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>org.junit.jupiter</groupId>
>> <artifactId>junit-jupiter-params</artifactId>
>> <version>5.6.0</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>org.junit.jupiter</groupId>
>> <artifactId>junit-jupiter-engine</artifactId>
>> <version>5.6.0</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>org.seleniumhq.selenium</groupId>
>> <artifactId>selenium-java</artifactId>
>> <scope>test</scope>
>> <version>2.44.0</version>
>> </dependency>
>> <dependency>
>> <groupId>com.opera</groupId>
>> <artifactId>operadriver</artifactId>
>> <scope>test</scope>
>> <version>1.5</version>
>> <exclusions>
>> <exclusion>
>> <groupId>org.seleniumhq.selenium</groupId>
>> <artifactId>selenium-remote-driver</artifactId>
>> </exclusion>
>> </exclusions>
>> </dependency>
>> <dependency>
>> <groupId>junit</groupId>
>> <artifactId>junit</artifactId>
>> <scope>test</scope>
>> <version>4.11</version>
>> </dependency>
>>
>
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Neil C Smith <ne...@apache.org>.
On Mon, 25 May 2020 at 13:05, Geertjan Wielenga <ge...@apache.org> wrote:
> Indeed, master should be substantially the same.
If it's not identical we're doing something wrong! :-)
Best wishes,
Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Geertjan Wielenga <ge...@apache.org>.
Indeed, master should be substantially the same.
Gj
On Mon, May 25, 2020 at 2:04 PM Tim Boudreau <ni...@gmail.com> wrote:
> >
> >
> > Note that from 12.0 Beta 4 onwards, JUnit 4 is back in that dialog:
> >
>
> I'm running a build of git master from a couple of days ago, and it is
> there in mine too.
>
>
> > Maybe try that (I see in there right now in 12.0 Beta 5, the following:
> > JUnit, TestNG, JUnit4, and Selenium) and see if it helps.
> >
>
> Any reason 12.0 beta 5 would substantially differ from master? Not to
> mention I've been seeing this bug occasionally for at least two years.
>
> -Tim
>
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Tim Boudreau <ni...@gmail.com>.
>
>
> Note that from 12.0 Beta 4 onwards, JUnit 4 is back in that dialog:
>
I'm running a build of git master from a couple of days ago, and it is
there in mine too.
> Maybe try that (I see in there right now in 12.0 Beta 5, the following:
> JUnit, TestNG, JUnit4, and Selenium) and see if it helps.
>
Any reason 12.0 beta 5 would substantially differ from master? Not to
mention I've been seeing this bug occasionally for at least two years.
-Tim
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Geertjan Wielenga <ge...@apache.org>.
On Mon, May 25, 2020 at 12:20 AM Tim Boudreau <ni...@gmail.com> wrote:
> Just reproduced it again on a NetBeans module project, on a different
> machine than I usually use for coding - different userdir, version of
> NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
>
> 1. Clone this repo:
> git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
>
> 2. Check out the commit I was working against:
> cd ANTLR4-Plugins-for-NetBeans
> git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
>
> 3. Build it once
> mvn -Dmaven.test.skip.exec=true clean install
>
> 4. Open the subproject antlr-utils in the IDE, let it load and expand its
> one package
>
> 5. Right click the class Criteria.java and choose *Tools | Create/Update
> Tests*
>
> 6. Accept the defaults, change nothing in the dialog (which contains no
> mention of Selenium), just click *OK* (note this means you are selecting
> JUnit as the test framework, even though the parent project depends on
> JUnit 4 and that's what should be used - perhaps this is the trigger?).
>
Note that from 12.0 Beta 4 onwards, JUnit 4 is back in that dialog:
https://github.com/apache/netbeans/pull/2038
Maybe try that (I see in there right now in 12.0 Beta 5, the following:
JUnit, TestNG, JUnit4, and Selenium) and see if it helps.
Gj
>
> then see if this pile of dependencies gets added to the pom.xml (and the
> build will fail because of dependency convergence - Selenium is sloppy
> about dependency management) - note both JUnit 4 and JUnit are added, *and
> *the
> parent pom specifies a different version of JUnit 4 which the version spec
> overrides:
>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-api</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-params</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-engine</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-java</artifactId>
> <scope>test</scope>
> <version>2.44.0</version>
> </dependency>
> <dependency>
> <groupId>com.opera</groupId>
> <artifactId>operadriver</artifactId>
> <scope>test</scope>
> <version>1.5</version>
> <exclusions>
> <exclusion>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-remote-driver</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <scope>test</scope>
> <version>4.11</version>
> </dependency>
>
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Tim Boudreau <ni...@gmail.com>.
Maybe you are using a different public key set up in your ~/.ssh/id_rsa
than the one you registered with GitHub with? You recently changed jobs -
I'd imagine if you were using a work laptop, that you have a new key and
Github might not know about it.
At any rate, the public https URL for cloning will work fine - the repo is
entirely public. Use
https://github.com/timboudreau/ANTLR4-Plugins-for-NetBeans.git instead -
but I suspect something is up with your ssh config vs. what Github thinks
it ought to be.
-Tim
On Mon, May 25, 2020 at 7:25 AM Geertjan Wielenga <ge...@apache.org>
wrote:
> Cloning into 'ANTLR4-Plugins-for-NetBeans'...
>
> git@github.com: Permission denied (publickey).
>
> fatal: Could not read from remote repository.
>
>
> Please make sure you have the correct access rights
>
> and the repository exists.
>
> Gj
>
> On Mon, May 25, 2020 at 11:09 AM Eric Barboni <sk...@apache.org> wrote:
>
> > Hi
> > Cannot reproduce on Apache NetBeans 12 b5, windows 10. Only the junit are
> > added not the selenium.
> >
> > Best Regards
> > Eric
> >
> > -----Message d'origine-----
> > De : Tim Boudreau <ni...@gmail.com>
> > Envoyé : lundi 25 mai 2020 00:20
> > À : dev@netbeans.apache.org
> > Objet : Re: Gratuitous selenium dependencies added to Maven projects
> >
> > Just reproduced it again on a NetBeans module project, on a different
> > machine than I usually use for coding - different userdir, version of
> > NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
> >
> > 1. Clone this repo:
> > git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
> >
> > 2. Check out the commit I was working against:
> > cd ANTLR4-Plugins-for-NetBeans
> > git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
> >
> > 3. Build it once
> > mvn -Dmaven.test.skip.exec=true clean install
> >
> > 4. Open the subproject antlr-utils in the IDE, let it load and expand
> its
> > one package
> >
> > 5. Right click the class Criteria.java and choose *Tools | Create/Update
> > Tests*
> >
> > 6. Accept the defaults, change nothing in the dialog (which contains no
> > mention of Selenium), just click *OK* (note this means you are selecting
> > JUnit as the test framework, even though the parent project depends on
> > JUnit 4 and that's what should be used - perhaps this is the trigger?).
> >
> > then see if this pile of dependencies gets added to the pom.xml (and the
> > build will fail because of dependency convergence - Selenium is sloppy
> > about dependency management) - note both JUnit 4 and JUnit are added,
> *and
> > *the parent pom specifies a different version of JUnit 4 which the
> version
> > spec
> > overrides:
> >
> > <dependency>
> > <groupId>org.junit.jupiter</groupId>
> > <artifactId>junit-jupiter-api</artifactId>
> > <version>5.6.0</version>
> > <scope>test</scope>
> > </dependency>
> > <dependency>
> > <groupId>org.junit.jupiter</groupId>
> > <artifactId>junit-jupiter-params</artifactId>
> > <version>5.6.0</version>
> > <scope>test</scope>
> > </dependency>
> > <dependency>
> > <groupId>org.junit.jupiter</groupId>
> > <artifactId>junit-jupiter-engine</artifactId>
> > <version>5.6.0</version>
> > <scope>test</scope>
> > </dependency>
> > <dependency>
> > <groupId>org.seleniumhq.selenium</groupId>
> > <artifactId>selenium-java</artifactId>
> > <scope>test</scope>
> > <version>2.44.0</version>
> > </dependency>
> > <dependency>
> > <groupId>com.opera</groupId>
> > <artifactId>operadriver</artifactId>
> > <scope>test</scope>
> > <version>1.5</version>
> > <exclusions>
> > <exclusion>
> > <groupId>org.seleniumhq.selenium</groupId>
> > <artifactId>selenium-remote-driver</artifactId>
> > </exclusion>
> > </exclusions>
> > </dependency>
> > <dependency>
> > <groupId>junit</groupId>
> > <artifactId>junit</artifactId>
> > <scope>test</scope>
> > <version>4.11</version>
> > </dependency>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
>
--
http://timboudreau.com
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Geertjan Wielenga <ge...@apache.org>.
Cloning into 'ANTLR4-Plugins-for-NetBeans'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Gj
On Mon, May 25, 2020 at 11:09 AM Eric Barboni <sk...@apache.org> wrote:
> Hi
> Cannot reproduce on Apache NetBeans 12 b5, windows 10. Only the junit are
> added not the selenium.
>
> Best Regards
> Eric
>
> -----Message d'origine-----
> De : Tim Boudreau <ni...@gmail.com>
> Envoyé : lundi 25 mai 2020 00:20
> À : dev@netbeans.apache.org
> Objet : Re: Gratuitous selenium dependencies added to Maven projects
>
> Just reproduced it again on a NetBeans module project, on a different
> machine than I usually use for coding - different userdir, version of
> NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
>
> 1. Clone this repo:
> git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
>
> 2. Check out the commit I was working against:
> cd ANTLR4-Plugins-for-NetBeans
> git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
>
> 3. Build it once
> mvn -Dmaven.test.skip.exec=true clean install
>
> 4. Open the subproject antlr-utils in the IDE, let it load and expand its
> one package
>
> 5. Right click the class Criteria.java and choose *Tools | Create/Update
> Tests*
>
> 6. Accept the defaults, change nothing in the dialog (which contains no
> mention of Selenium), just click *OK* (note this means you are selecting
> JUnit as the test framework, even though the parent project depends on
> JUnit 4 and that's what should be used - perhaps this is the trigger?).
>
> then see if this pile of dependencies gets added to the pom.xml (and the
> build will fail because of dependency convergence - Selenium is sloppy
> about dependency management) - note both JUnit 4 and JUnit are added, *and
> *the parent pom specifies a different version of JUnit 4 which the version
> spec
> overrides:
>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-api</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-params</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.junit.jupiter</groupId>
> <artifactId>junit-jupiter-engine</artifactId>
> <version>5.6.0</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-java</artifactId>
> <scope>test</scope>
> <version>2.44.0</version>
> </dependency>
> <dependency>
> <groupId>com.opera</groupId>
> <artifactId>operadriver</artifactId>
> <scope>test</scope>
> <version>1.5</version>
> <exclusions>
> <exclusion>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-remote-driver</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <scope>test</scope>
> <version>4.11</version>
> </dependency>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
RE: Gratuitous selenium dependencies added to Maven projects
Posted by Eric Barboni <sk...@apache.org>.
Hi
Cannot reproduce on Apache NetBeans 12 b5, windows 10. Only the junit are added not the selenium.
Best Regards
Eric
-----Message d'origine-----
De : Tim Boudreau <ni...@gmail.com>
Envoyé : lundi 25 mai 2020 00:20
À : dev@netbeans.apache.org
Objet : Re: Gratuitous selenium dependencies added to Maven projects
Just reproduced it again on a NetBeans module project, on a different machine than I usually use for coding - different userdir, version of NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
1. Clone this repo:
git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
2. Check out the commit I was working against:
cd ANTLR4-Plugins-for-NetBeans
git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
3. Build it once
mvn -Dmaven.test.skip.exec=true clean install
4. Open the subproject antlr-utils in the IDE, let it load and expand its one package
5. Right click the class Criteria.java and choose *Tools | Create/Update
Tests*
6. Accept the defaults, change nothing in the dialog (which contains no mention of Selenium), just click *OK* (note this means you are selecting JUnit as the test framework, even though the parent project depends on JUnit 4 and that's what should be used - perhaps this is the trigger?).
then see if this pile of dependencies gets added to the pom.xml (and the build will fail because of dependency convergence - Selenium is sloppy about dependency management) - note both JUnit 4 and JUnit are added, *and *the parent pom specifies a different version of JUnit 4 which the version spec
overrides:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<scope>test</scope>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<scope>test</scope>
<version>1.5</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.11</version>
</dependency>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Tim Boudreau <ni...@gmail.com>.
Just reproduced it again on a NetBeans module project, on a different
machine than I usually use for coding - different userdir, version of
NetBeans, etc. I'm curious if anyone else can. Steps to reproduce:
1. Clone this repo:
git clone git@github.com:timboudreau/ANTLR4-Plugins-for-NetBeans.git
2. Check out the commit I was working against:
cd ANTLR4-Plugins-for-NetBeans
git checkout 6c0fd2dbd76ab09182cafc937a961d4ff5abe391
3. Build it once
mvn -Dmaven.test.skip.exec=true clean install
4. Open the subproject antlr-utils in the IDE, let it load and expand its
one package
5. Right click the class Criteria.java and choose *Tools | Create/Update
Tests*
6. Accept the defaults, change nothing in the dialog (which contains no
mention of Selenium), just click *OK* (note this means you are selecting
JUnit as the test framework, even though the parent project depends on
JUnit 4 and that's what should be used - perhaps this is the trigger?).
then see if this pile of dependencies gets added to the pom.xml (and the
build will fail because of dependency convergence - Selenium is sloppy
about dependency management) - note both JUnit 4 and JUnit are added, *and *the
parent pom specifies a different version of JUnit 4 which the version spec
overrides:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<scope>test</scope>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<scope>test</scope>
<version>1.5</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.11</version>
</dependency>
RE: Gratuitous selenium dependencies added to Maven projects
Posted by Eric Barboni <sk...@apache.org>.
Hi Tom,
For me the only way to add this dependencies is to create a selenium test using tools>Create/update tests and selecting selenium. Otherwise the pom seems clear. User is aware I hope that to use selenium it will need selenium dependencies.
Best Regards
Eric
-----Message d'origine-----
De : Tim Boudreau <ni...@gmail.com>
Envoyé : lundi 18 mai 2020 21:41
À : dev@netbeans.apache.org
Objet : Re: Gratuitous selenium dependencies added to Maven projects
Not using Selenium to test a NetBeans module, no :-)
I have written one library a long time ago which is part of this library collection - https://github.com/timboudreau/mastfrog-parent and it has happened in projects that used some other library with the same parent POM. But it's hard to believe that would be a path by which something could assume that. It can happen to projects completely unrelated to Selenium or even web development.
A few times it has been especially painful, since either it drags in a dependency on an older version of JUnit, or creates a dependency version conflict the enforcer plugin complains about, and then I find that three libraries deep, something got that damned selenium dependency added to it, so it's hauling in a version of, say, log4j that conflicts with another project. Very annoying, and in particular, IDEs should not ever do this sort of thing without checking with the user.
-Tim
On Mon, May 18, 2020 at 3:10 PM John Mc <mc...@gmail.com> wrote:
> Hi Tim,
>
> I cant help you with answering how its happening, as I've never used
> Selenium in NetBeans, but I think your right that its NetBeans adding it:
>
> https://github.com/apache/netbeans/blob/accdbada0a9c5105bd3f06e4350242
> 30c1618316/java/selenium2.maven/src/org/netbeans/modules/selenium2/mav
> en/Selenium2MavenSupportImpl.java
>
> Do you have any Selenium Tests, or Unit Test, and NetBeans somehow
> assumed you wanted Selenium included?
>
> Regards
>
> John
>
> On Mon, 18 May 2020 at 19:59, Tim Boudreau <ni...@gmail.com> wrote:
>
> > Every now and then, maybe once every few months over the last few
> > years, I'll be working on a Maven project - maybe something
> > completely unrelated to web development (at the moment it just
> > happened to a NetBeans module
> > project) - when I will notice the build behaving weirdly or
> > downloading things that could not possibly be dependencies of it.
> > And I will find
> that
> > some pom.xml file within the project has had this added to it:
> >
> > <dependency>
> > <groupId>org.seleniumhq.selenium</groupId>
> > <artifactId>selenium-java</artifactId>
> > <scope>test</scope>
> > <version>2.44.0</version>
> > </dependency>
> > <dependency>
> > <groupId>com.opera</groupId>
> > <artifactId>operadriver</artifactId>
> > <scope>test</scope>
> > <version>1.5</version>
> > <exclusions>
> > <exclusion>
> > <groupId>org.seleniumhq.selenium</groupId>
> > <artifactId>selenium-remote-driver</artifactId>
> > </exclusion>
> > </exclusions>
> > </dependency>
> >
> > It seems pretty clear that NetBeans is doing this - but what? And why?
> > Accidental keyboard shortcut? Something else?
> >
> > Thanks,
> >
> > Tim
> >
> > --
> > http://timboudreau.com
> >
>
--
http://timboudreau.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Tim Boudreau <ni...@gmail.com>.
Not using Selenium to test a NetBeans module, no :-)
I have written one library a long time ago which is part of this library
collection - https://github.com/timboudreau/mastfrog-parent and it has
happened in projects that used some other library with the same parent
POM. But it's hard to believe that would be a path by which something
could assume that. It can happen to projects completely unrelated to
Selenium or even web development.
A few times it has been especially painful, since either it drags in a
dependency on an older version of JUnit, or creates a dependency version
conflict the enforcer plugin complains about, and then I find that three
libraries deep, something got that damned selenium dependency added to it,
so it's hauling in a version of, say, log4j that conflicts with another
project. Very annoying, and in particular, IDEs should not ever do this
sort of thing without checking with the user.
-Tim
On Mon, May 18, 2020 at 3:10 PM John Mc <mc...@gmail.com> wrote:
> Hi Tim,
>
> I cant help you with answering how its happening, as I've never used
> Selenium in NetBeans, but I think your right that its NetBeans adding it:
>
> https://github.com/apache/netbeans/blob/accdbada0a9c5105bd3f06e435024230c1618316/java/selenium2.maven/src/org/netbeans/modules/selenium2/maven/Selenium2MavenSupportImpl.java
>
> Do you have any Selenium Tests, or Unit Test, and NetBeans somehow assumed
> you wanted Selenium included?
>
> Regards
>
> John
>
> On Mon, 18 May 2020 at 19:59, Tim Boudreau <ni...@gmail.com> wrote:
>
> > Every now and then, maybe once every few months over the last few years,
> > I'll be working on a Maven project - maybe something completely unrelated
> > to web development (at the moment it just happened to a NetBeans module
> > project) - when I will notice the build behaving weirdly or downloading
> > things that could not possibly be dependencies of it. And I will find
> that
> > some pom.xml file within the project has had this added to it:
> >
> > <dependency>
> > <groupId>org.seleniumhq.selenium</groupId>
> > <artifactId>selenium-java</artifactId>
> > <scope>test</scope>
> > <version>2.44.0</version>
> > </dependency>
> > <dependency>
> > <groupId>com.opera</groupId>
> > <artifactId>operadriver</artifactId>
> > <scope>test</scope>
> > <version>1.5</version>
> > <exclusions>
> > <exclusion>
> > <groupId>org.seleniumhq.selenium</groupId>
> > <artifactId>selenium-remote-driver</artifactId>
> > </exclusion>
> > </exclusions>
> > </dependency>
> >
> > It seems pretty clear that NetBeans is doing this - but what? And why?
> > Accidental keyboard shortcut? Something else?
> >
> > Thanks,
> >
> > Tim
> >
> > --
> > http://timboudreau.com
> >
>
--
http://timboudreau.com
Re: Gratuitous selenium dependencies added to Maven projects
Posted by John Mc <mc...@gmail.com>.
Hi Tim,
I cant help you with answering how its happening, as I've never used
Selenium in NetBeans, but I think your right that its NetBeans adding it:
https://github.com/apache/netbeans/blob/accdbada0a9c5105bd3f06e435024230c1618316/java/selenium2.maven/src/org/netbeans/modules/selenium2/maven/Selenium2MavenSupportImpl.java
Do you have any Selenium Tests, or Unit Test, and NetBeans somehow assumed
you wanted Selenium included?
Regards
John
On Mon, 18 May 2020 at 19:59, Tim Boudreau <ni...@gmail.com> wrote:
> Every now and then, maybe once every few months over the last few years,
> I'll be working on a Maven project - maybe something completely unrelated
> to web development (at the moment it just happened to a NetBeans module
> project) - when I will notice the build behaving weirdly or downloading
> things that could not possibly be dependencies of it. And I will find that
> some pom.xml file within the project has had this added to it:
>
> <dependency>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-java</artifactId>
> <scope>test</scope>
> <version>2.44.0</version>
> </dependency>
> <dependency>
> <groupId>com.opera</groupId>
> <artifactId>operadriver</artifactId>
> <scope>test</scope>
> <version>1.5</version>
> <exclusions>
> <exclusion>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-remote-driver</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
>
> It seems pretty clear that NetBeans is doing this - but what? And why?
> Accidental keyboard shortcut? Something else?
>
> Thanks,
>
> Tim
>
> --
> http://timboudreau.com
>
Re: Gratuitous selenium dependencies added to Maven projects
Posted by Jesse Glick <ty...@gmail.com>.
On Mon, May 18, 2020 at 2:59 PM Tim Boudreau <ni...@gmail.com> wrote:
> It seems pretty clear that NetBeans is doing this - but what? And why?
I think this is from
https://github.com/apache/netbeans/blob/37fba0ac75e0eb28fd072a33578bfc05e8ba13d2/ide/selenium2/src/org/netbeans/modules/selenium2/SeleniumTestCreatorProvider.java
and it has been on my list to kill for about a decade or so.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists