File tree Expand file tree Collapse file tree
src/main/java/com/almostreliable/almostgradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,9 +260,17 @@ private void applyBasics() {
260260 if (getMavenPublish ().get ()) {
261261 project .getPlugins ().apply ("maven-publish" );
262262 var maven = project .getExtensions ().getByType (PublishingExtension .class );
263+
263264 var pub = maven .getPublications ().create (MAVEN , MavenPublication .class );
264- pub .setArtifactId (getModId ());
265265 pub .from (project .getComponents ().getByName ("java" ));
266+ pub .setArtifactId (getModId ());
267+
268+ var apiJar = project .getTasks ().named ("apiJar" , Jar .class );
269+ var apiSources = project .getTasks ().named ("apiSources" , Jar .class );
270+ maven .getPublications ().withType (MavenPublication .class ).configureEach (p -> {
271+ p .artifact (apiJar );
272+ p .artifact (apiSources );
273+ });
266274 }
267275 }
268276
You can’t perform that action at this time.
0 commit comments