Maven Sonatype Release не работает: JAR будет пустым - контент не был отмечен для включения - PullRequest
0 голосов
/ 21 июня 2020

Я пытаюсь выпустить jar, но каждый выпуск не содержит классов. Я пробовал несколько конфигураций плагинов, которые вы можете найти здесь , здесь и здесь , но ничего не изменилось. Когда я пытаюсь создать одну банку, эта банка содержит все, что меня еще больше смущает.

My Pom:

<?xml version="1.0"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
 
 
    <groupId>com.ctection</groupId>
    <artifactId>cSCM</artifactId>
    <version>1.0.3-SNAPSHOT</version>
    <name>cSCM</name>
    <description>A simple parser to parse SCM files</description>
 
 
    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <url>https://github.com/ctection/cSCM</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/
            </url>
        </repository>
    </distributionManagement>
 
    <developers>
        <developer>
            <id>schmazda</id>
            <name>Mathias Neumann</name>
            <email>schmazda@ctection.com</email>
            <organization>CTection Development</organization>
            <organizationUrl>http://www.ctection.com/</organizationUrl>
            <roles>
                <role>CTO</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
            <properties>
                <picUrl>https://cdn.discordapp.com/avatars/388389960329461761/1d6ced3ac65959e410faa22afdcb8dc4.png</picUrl>
            </properties>
        </developer>
        <developer>
            <id>tuxnull</id>
            <name>Patrick Garske</name>
            <email>webmaster@setstorm.com</email>
            <organization>CTection Development</organization>
            <organizationUrl>http://www.ctection.com/</organizationUrl>
            <roles>
                <role>CEO</role>
            </roles>
            <timezone>+1</timezone>
            <properties>
                <picUrl>https://cdn.discordapp.com/avatars/316980441502449666/d157dd20303c819e7b46708f75c40fc4.webp?size=512</picUrl>
            </properties>
        </developer>
    </developers>
 
    <scm>
        <connection>scm:git:git://github.com/ctection/cSCM.git</connection>
        <developerConnection>scm:git:git@github.com:ctection/ctection.git</developerConnection>
        <url>https://github.com/ctection/cSCM</url>
        <tag>cSCM-1.0.3</tag>
    </scm>
   <build>
 
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <classesDirectory>src</classesDirectory>
                    <includes>
                        <include>**/src/*</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <show>private</show>
                    <nohelp>true</nohelp>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                        <checkModificationExcludes>
                            <checkModificationExclude>Dokumente/IdeaProjects/cSCM/pom.xml</checkModificationExclude>
                        </checkModificationExcludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.5</version>
                    </dependency>
                </dependencies>
            </plugin>
 
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Журнал:

[INFO]
[INFO] --- maven-release-plugin:2.5.3:perform (default-cli) @ cSCM ---
[INFO] Performing a LOCAL checkout from scm:git:file:///home/mathias/Dokumente/IdeaProjects/cSCM
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target && git clone --branch cSCM-v.1.0.3 file:///home/mathias/Dokumente/IdeaProjects/cSCM /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target
[INFO] Performing a LOCAL checkout from scm:git:file:///home/mathias/Dokumente/IdeaProjects
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target && git clone --branch cSCM-v.1.0.3 file:///home/mathias/Dokumente/IdeaProjects /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target
[INFO] Performing a LOCAL checkout from scm:git:file:///home/mathias/Dokumente
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target && git clone --branch cSCM-v.1.0.3 file:///home/mathias/Dokumente /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target
[INFO] Performing a LOCAL checkout from scm:git:file:///home/mathias
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target && git clone --branch cSCM-v.1.0.3 file:///home/mathias /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target
[INFO] Executing: /bin/sh -c cd /tmp && git ls-remote file:///home/mathias
[INFO] Working directory: /tmp
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout && git fetch file:///home/mathias
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout && git checkout cSCM-v.1.0.3
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout && git ls-files
[INFO] Working directory: /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout
[INFO] Invoking perform goals in directory /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM
[INFO] Executing goals 'deploy'...
[INFO] Executing: /bin/sh -c cd /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM && /usr/share/maven/bin/mvn -s /tmp/release-settings1464194820516434727.xml deploy --no-plugin-updates '-Dgpg.passphrase=PASSPHRASE' -P release-sign-artifacts -DperformRelease=true -f pom.xml
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
    WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    [WARNING] Command line option -npu is deprecated and will be removed in future Maven versions.
    [INFO] Scanning for projects...
    [INFO] Inspecting build with total of 1 modules...
    [INFO] Installing Nexus Staging features:
    [INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
    [INFO]
    [INFO] -------------------------< com.ctection:cSCM >--------------------------
    [INFO] Building cSCM 1.0.3
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cSCM ---
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/src/main/resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ cSCM ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cSCM ---
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/src/test/resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ cSCM ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ cSCM ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ cSCM ---
    [WARNING] JAR will be empty - no content was marked for inclusion!
    [INFO] Building jar: /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/target/cSCM-1.0.3.jar
    [INFO]
    [INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) > generate-sources @ cSCM >>>
    [INFO]
    [INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) < generate-sources @ cSCM <<<
    [INFO]
    [INFO]
    [INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @ cSCM ---
    [INFO] No sources in project. Archive not created.
    [INFO]
    [INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @ cSCM ---
    [INFO] No sources in project. Archive not created.
    [INFO]
    [INFO] --- maven-javadoc-plugin:3.2.0:jar (attach-javadocs) @ cSCM ---
    [INFO]
    [INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) @ cSCM ---
    [INFO]
    [INFO] --- maven-install-plugin:2.4:install (default-install) @ cSCM ---
    [INFO] Installing /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/target/cSCM-1.0.3.jar to /home/mathias/.m2/repository/com/ctection/cSCM/1.0.3/cSCM-1.0.3.jar
    [INFO] Installing /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/pom.xml to /home/mathias/.m2/repository/com/ctection/cSCM/1.0.3/cSCM-1.0.3.pom
    [INFO] Installing /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/target/cSCM-1.0.3.jar.asc to /home/mathias/.m2/repository/com/ctection/cSCM/1.0.3/cSCM-1.0.3.jar.asc
    [INFO] Installing /home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/target/cSCM-1.0.3.pom.asc to /home/mathias/.m2/repository/com/ctection/cSCM/1.0.3/cSCM-1.0.3.pom.asc
    [INFO]
    [INFO] --- nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) @ cSCM ---
    [INFO] Performing local staging (local stagingDirectory="/home/mathias/Dokumente/IdeaProjects/cSCM/target/checkout/Dokumente/IdeaProjects/cSCM/target/nexus-staging/staging")...
    [INFO]  + Using server credentials "ossrh" from Maven settings.

Как я могу это исправить?

...