Bresiu
Bresiu

Reputation: 2153

Using git wagon plugin to store jars at github/gitlab

I'm using git-wagon wagon-git plugin to store jars at github repository (this is just for test, my company have own gitlab repository). I've created project "wagon_test", and deployed it (https://github.com/Bresiu/wagon_test/tree/releases/com/bresiu). Than I've created second project: "wagon_test_dependience" and deployed it too to the same repository, under same "release" branch. I added to "wagon_test" dependency:

<dependency> <groupId>com.bresiu</groupId> <artifactId>wagon_test_dependience</artifactId> <version>1.0</version> </dependency>

And deleted wagon_test_dependience artifact from maven local repository.

Now Maven can't download wagon_test_dependience.jar from github.

My pom.xml from wagon_test:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.bresiu</groupId>
<artifactId>wagon_test</artifactId>
<version>1.0</version>
<name>wagon_test</name>
<properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<packaging>jar</packaging>

<dependencies>
    <dependency>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-provider-api</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>com.bresiu</groupId>
        <artifactId>wagon_test_dependience</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>

<build>
    <finalName>wagon_test</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <inherited>true</inherited>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <finalName>${project.version}</finalName>
                <archive>
                    <manifest>
                        <mainClass>Main</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>Main</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <!-- this is used for inheritance merges -->
                    <phase>package</phase>
                    <!-- bind to the packaging phase -->
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <extensions>
        <extension>
            <groupId>ar.com.synergian</groupId>
            <artifactId>wagon-git</artifactId>
            <version>0.2.3</version>
        </extension>
    </extensions>
</build>
<pluginRepositories>
    <pluginRepository>
        <id>synergian-repo</id>
        <url>https://raw.github.com/synergian/wagon-git/releases</url>
    </pluginRepository>
</pluginRepositories>

<distributionManagement>
    <repository>
        <id>wagon_test</id>
        <name>wagon_test</name>
        <url>git:releases://[email protected]:Bresiu/wagon_test.git</url>
    </repository>
</distributionManagement>
<repositories>
    <repository>
        <id>wagon_test</id>
        <name>wagon_test</name>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <!--
           distributionManagement url was
           <url>git:your-branch://[email protected]:yourgithubusername/your-github-repo.git</url>
        -->
        <url>https://raw.github.com/Bresiu/wagon_test/releases</url>
    </repository>
</repositories>

How can I enable storing my private dependieces in Github/Gitlab? I know that storing binaries in Github has its pros and cons, but we have own gitlab repository only for jars and ruby gems, and we would like to keep all binaries in one place.

Upvotes: 1

Views: 1046

Answers (0)

Related Questions