0

I have few java packages as part of Selenium, Java, Cucumber, Maven automation framework which all projects use. If I create .jar file of it and place it in a separate project/folder in TFS Git repository, then all project can use it as a dependency in pom.xml.

If I want to change some code and commit/push to main branch using eGit plugin in Eclipse, then will all other projects be able to "Fetch from upstream" and get latest changes.

OR

Do I need to host the .jar file on JFrog artifactory (corporate). Then make changes, compile the .jar file and then when projects do "Update Maven", then they will get updated copy of the jar classes.

How can I achieve this without uploading .jar in artifactory?

2 Answers 2

0

How can I achieve this without uploading .jar in artifactory?

You can configure the Maven repositories to target a Git repository, rather than a Artifactory.

<repositories>
    <!-- Other repositories -->
    <repository>
        <id>your-library-repo</id>
        <url>YOUR_LIBRARY_URL.git</url>
    </repository>
</repositories>

Then import the library

<dependencies>
    <!-- Other dependencies -->
    <dependency>
        <groupId>com.example</groupId>
        <artifactId>your-library</artifactId>
        <version>1.0.0</version> <!-- Replace with the version of your library -->
    </dependency>
</dependencies>

When you run mvn clean install, the library will be downloaded and compiled.

0
    @Joao <repositories>
        <!-- Other repositories -->
        <repository>
            <id>UtilityFramework</id>
            <url>http://com.corp.2/tfs/DefaultCollection/CompA/_git/Automation?path=%2FUtilityFramework
.git</url>
        </repository>
    </repositories>

    <dependencies>
        <!-- Other dependencies -->
        <dependency>
            <groupId>com.corp</groupId>
            <artifactId>UtilityFramework</artifactId>
            <version>1.0.0</version> <!-- Replace with the version of your library --
        </dependency>  - This is not working - I can import classes from my framework to my other projects.. what wrong am i doing? @Joao help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.