github / maven-plugins

Official GitHub Maven Plugins
MIT License
587 stars 197 forks source link

Server 'github' not found in settings Issue #151

Open koasyy opened 2 years ago

koasyy commented 2 years ago

Hey, i want to deploy my Maven Project but I always get the error: Server 'github' not found in settings. My Settings.xml:

<settings>
    <servers>
        <server>
            <id>github</id>
            <username></username>
            <password></password>
        </server>
    </servers>
</settings>

My pom.XML:

    <modelVersion>4.0.0</modelVersion>
    <groupId>koastapi</groupId>
    <artifactId>koastapi-maven</artifactId>
    <version>0.1</version>
    <distributionManagement>
        <repository>
            <id>internal.repo</id>
            <name>Temporary Staging Repository</name>
            <url>file://${project.build.directory}/mvn-repo</url>
        </repository>
    </distributionManagement>
    <build>
        <plugins>
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
                <altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
            </configuration>
        </plugin>
            <plugin>
                <groupId>com.github.github</groupId>
                <artifactId>site-maven-plugin</artifactId>
                <version>0.11</version>
                <configuration>
                    <message>Maven artifacts for ${project.version}</message>  <!-- git commit message -->
                    <noJekyll>true</noJekyll>                                  <!-- disable webpage processing -->
                    <outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
                    <branch>refs/heads/mvn-repo</branch>                       <!-- remote branch name -->
                    <includes><include>**/*</include></includes>

                    <repositoryName>my repo/repositoryName>      <!-- github repo name -->
                    <repositoryOwner>my name</repositoryOwner>    <!-- github username  -->
                </configuration>
                <executions>
                    <!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
                    <execution>
                        <goals>
                            <goal>site</goal>
                        </goals>
                        <phase>deploy</phase>
                    </execution>
                </executions>
            </plugin>
    </plugins>

</build>

    <properties>
        <github.global.server>github</github.global.server>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>net.md-5</groupId>
            <artifactId>bungeecord-api</artifactId>
            <version>1.16-R0.4</version>
        </dependency>

        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>bungeecord-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>

        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

</project>
HyperCodec commented 2 years ago

Go to users\yourname.m2 and create setting.xml (if one is not already there). then paste the server stuff there

.m2 is in users on Windows. Don't know for Linux and stuff