In my maven project there is the following dependency, which is successfully downloaded and works.

<dependency> <groupId>net.thucydides</groupId> <artifactId>thucydides-core</artifactId> <version>${thucydides.version}</version> </dependency> 

Now I add to the yandex html elements project, but I can’t do one thing - edit the SmartElementProxyCreator.java class in thucydides/thucydides-сore/src/main/java/net/thucydides/core/annotations/locators .

Idea always says that the file is read only , which is logical, since it is an external repository. enter image description here

How can I correctly change this class of external library and make deploy to my project?

  • Tell us more about the need to change the class - etki
  • In the classroom, in 2 methods it is necessary to comment out three lines of code each and add one new one - Evgenii Zakiev
  • Yes, it is clear that you physically need to make changes, the question is why - etki
  • This is how integration with Thucydides yandex html elements for version 0.9.203 is configured. At least this is what is stated in my assignment for performance (I am learning thucydides). The fact that there is no such thing for the new version has already been seen on the site. But the task is to use the old version and deposit it in the repository - Evgenii Zakiev

2 answers 2

To change the class - download the source code of this library, then change the class, collect and attach to the project.

  • radically) but what about the change of bytes of code in a notebook, reverse compilation and other pleasures of life?) - pavel
  • @pavel I'm afraid this is not the case) - Andrew Bystrov
  • Made import through idea - file - project structure - libraries - add - from maven, then pointed to net.thucydides: thucydides-core: 0.9.203, ticked checkbox Sources. As a result, many files were downloaded to the lib folder in the project, and among them was the necessary jar thucydides-core-0.9.203-sources.jar, which I corrected. Is the sequence correct? - Evgenii Zakiev

I will add the following concrete steps for people as green as me:
1) Download the source from the gita for the required version and unpack
2) Open in IDE as a maven project, the main one of all is called thucydides
3) Change the desired class
4) Make mvn compile
5) mvn install - so the jar file of this project will be in the local repository
6) Close this project
7) Open or create a new project.
8) in the pom file, indicate the dependency on this jar
9) make sure that the versions junit, maven plugins, selenium specified in the library are compatible. If you have errors during the compile-install stage, most likely the problem is in the versions