Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groupId rename problems for Maven multi-module projects with multiple groupIds #2872

Closed
janScheible opened this issue Jun 15, 2018 · 4 comments

Comments

@janScheible
Copy link

I found jitpack and was impressed by the simple but powerful idea. It would be ideal for me to allow easy usage of my GitHub projects. I gave it a try with my dto-enhancer. I'm following the convention that the groupId should be equal to the root package of the Java sources (which is violated by the groupId renaming concept of jitpack in general, but this is a different story ;-). And this seems to not work with jitpack.

For my forked version of maven-modular it works. The original groupIds of the repository

<!-- pom.xml -->
<project>
	<groupId>io.jitpack</groupId>
	<artifactId>example-root</artifactId>
	<version>2.0-SNAPSHOT</version>

	<packaging>pom</packaging>
</project>

<!-- module1/pom.xml -->
<project>
	<parent>
		<groupId>io.jitpack</groupId>
		<artifactId>example-root</artifactId>
		<version>2.0-SNAPSHOT</version>
	</parent>

	<!-- NOTE Same groupId as parent. -->
	<groupId>io.jitpack</groupId>
	<artifactId>module1</artifactId>
	<version>2.0-SNAPSHOT</version>
</project>

are resulting in correctly renamed module and parent groupId

<!-- module1/pom.xml retrieved from jitpack-->
<project>
	<parent>
		<!-- NOTE Correct parent groupId. -->
		<groupId>com.github.janScheible.forked-maven-modular</groupId>
		<artifactId>example-root</artifactId>
		<version>1.2</version>
	</parent>
	
	<groupId>com.github.janScheible.forked-maven-modular</groupId>
	<artifactId>module1</artifactId>
	<version>1.2</version>
</project>

for module1.

For dto-enhancer the original groupIds of the repository

<!-- pom.xml -->
<project>
    <groupId>com.scheible.dtoenhancer</groupId>
    <artifactId>dto-enhancer</artifactId>
    <version>1.0.0</version>
	
    <packaging>pom</packaging>
</project>

<!-- dto-enhancer-api/pom.xml -->
<project>
    <parent>
        <artifactId>dto-enhancer</artifactId>
        <groupId>com.scheible.dtoenhancer</groupId>
        <version>1.0.0</version>
    </parent>

    <!-- NOTE Different groupId than parent. -->
    <groupId>com.scheible.dtoenhancer.api</groupId>
    <artifactId>dto-enhancer-api</artifactId>
    <version>1.0.0</version>

    <packaging>jar</packaging>
</project>

are resulting in wrongly renamed groupIds (parent groupId not renamed at all, module groupId wrongly replaced by groupId of root pom.xml)

<!-- dto-enhancer-api/pom.xml retrieved from jitpack-->
<project>
	<parent>
		<!-- NOTE Not renamed parent groupId, should be 'com.github.janScheible.dto-enhancer' -->
		<groupId>com.scheible.dtoenhancer</groupId>
		<artifactId>dto-enhancer</artifactId>
		<version>1.0.0</version>
	</parent>

	<!-- NOTE Should be 'com.github.janScheible.dto-enhancer.api' instead of parent groupId. -->
	<groupId>com.github.janScheible.dto-enhancer</groupId>
	<artifactId>dto-enhancer-api</artifactId>
	<version>1.0.0</version>
</project>

for dto-enhancer-api.

@jitpack-io
Copy link
Member

This is the most likely cause: <!-- NOTE Different groupId than parent. -->

@janScheible
Copy link
Author

Okay, this is what I assumed. How about adding support for that scenario to jitpack? It would increase the number of Maven projects that are usable with jitpack. :-)

From my abstract point of view it is just making the groupId replace logic aware of the different parent groupId (the improved logic would perhaps even cover the current supported replace logic as well).

I guess this is then rather asking for an improvement than reporting a defect. ;-)

inodb added a commit to cBioPortal/maven-external-version that referenced this issue Dec 7, 2018
Requires hardcoding the name of the repo in ExternalVersionExtension, because
jitpack overrides groupId:

jitpack/jitpack.io#1029

Furthermore, for multi-module projects there can only be one groupId:

jitpack/jitpack.io#2872

So changed everything to be in *.version (i.e. not in *.plugin). Maven
complains that maven-*-plugin should be in groupId org.apache.maven.plugins,
but works anyway.
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 5, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants