Solved Invalid plugin.yml

Discussion in 'Spigot Plugin Development' started by UnlimitedNinjas, Jul 9, 2021.

  1. I get the error invalid plugin.yml but the file is fine. Am i missing something obvious here?
    Other plugins work its just this one.

    - Yes the file is in the final jar i checked
    - Yes the maven variables are being filtered and replaced


    error:
    upload_2021-7-9_22-34-0.png


    plugin.yml
    upload_2021-7-9_22-35-35.png

    tree:
    upload_2021-7-9_22-36-57.png
     
    #1 UnlimitedNinjas, Jul 9, 2021
    Last edited: Jul 11, 2021
  2. Hello UnlimitedNinjas,

    Your plugin.yml looks correct; however, as the error says, the plugin cannot find the plugin.yml. Have you tried unzipping the jar and seeing if the plugin.yml is present. If that is the issue, then you should make sure your building is done properly whether you are using Maven or IntelliJ built-in builder.

    Edit: I just notice you said it was present, though just to be sure, is it in the proper location? It should not be in any package and directly in the folder when you unzip it.

    This is what is in my Maven and works.
    Code (Text):
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                    <includes>
                        <include>plugin.yml</include>
                    </includes>
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
     
  3. It is in the resources folder, filtering works

    i removed the maven variables and just wrote them in there plain text, still same issue
     
    #3 UnlimitedNinjas, Jul 9, 2021
    Last edited: Jul 9, 2021
  4. Barbadosian

    Barbadosian Previously Aaron_Mao

    Try checking whether you have any YAML linting issues, such as indentation (for example, mixing spaces with tabs)
     
  5. Have you tried adding a newline at the end of the file? I vaguely remember having issues with that.
     
  6. Checked and tried. still an issue.
    I also changed the server jar file and reset the server fully, no help.

    Pom build if useful:
    Code (Text):
        <build>
            <resources>
                <resource>
                    <directory>src/main</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>

            <plugins>
                <!-- Shade -->
                <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>tsp.amx.AMX</mainClass>
                                    </transformer>
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
     
  7. Barbadosian

    Barbadosian Previously Aaron_Mao

    Try changing your resource section to

    Code (Text):
    <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
     
  8. That actually seemes to have worked... i've never had that problem with other plugins.