#Help with using GitHub API in Java

1 messages · Page 1 of 1 (latest)

glad comet
#

Created thread

fiery python
#

Guthub API

#

what is that lol

glad comet
#

Wdym

fiery python
#

never seen github api

#

for any language

#

is that it

upbeat vine
#

Anyways the actual problem is shading

fiery python
#

umm

#

add maven shade plugin to pom.xml?

glad comet
#

Already did that

#

Atleast i think so

fiery python
#
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>your.main.class.if.any.MainClass</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
#

smth like this

#

idk i just got here

#

haven't seen your pom

#

i had this thing configured in my old plugin

glad comet
#

Gotta send it later when im Back Home

fiery python
#

when i shaded VK API

#

but do you need github api

#

rly

#

just why

glad comet
#

I wanna get a jar from a release

#

And Put in the Plugins folder

fiery python
#

oh

#

i see

glad comet
#

Kinda Like Plugin updater

fiery python
#

for your own?

glad comet
#

Yes

#

Just for my own

fiery python
#

well i'd prefer just telling that version is outdated

#
  • link to spigotmc page
upbeat vine
fiery python
#

that's not my code

upbeat vine
#

That's for creating an executable jar

glad comet
fiery python
#

i'm just too lazy to find my own, it's probably deleted anyway

glad comet
#

Just for my server

fiery python
#

well then good luck getting back home

#

and looking through your pom

glad comet
#

Yea

glad comet
upbeat vine
glad comet
#

package org.bukkit does not exist

upbeat vine
#

Does it say that in the IDE or when you package the jar with maven

glad comet
#

when i do mvn package so when i package the jar

fiery python
#

wait what

#

org.bukkit doesn't exist?

glad comet
#

yea lol

fiery python
#

are you making app or plugin lol

glad comet
#

plugin

fiery python
#

and when you run it console says org.bukkit does not exist

glad comet
#

right

glad comet
#

@upbeat vine Maybe you know?

#

oh my bad

#

forgot the d in provided

            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
#

ok i builded it with maven shade plugin, like i used mvn clean package

#

like my plugin

fiery python
#

is it working now?

glad comet
#

yea, but the code with the api isnt working, like do you know someone who used the api before?

upbeat vine
#

Same error as before?

glad comet
#

no

#

also do i have to use the normal jar or the one with shaded at the end or the one with original

fiery python
#
        at de.ole101.newsc.Main.onEnable(Main.java:22) ~[?:?]```
#

repo looks kinda sussy

#

Repository name must be in format owner/repo

glad comet
#

i got the repo link there

#
            GitHub github = new GitHubBuilder().withOAuthToken("[OAuthToken]").build();
            GHRepository repo = github.getRepository("RepoLink");
            GHRelease release = repo.getReleaseByTagName("release");
            Bukkit.getConsoleSender().sendMessage("§a" + repo.getOwnerName());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }```
fiery python
#

maybe wrong link format

#

should be something like HeroOle/MyPlugin i guess

glad comet
upbeat vine