Skip to content

Conversation

@rPraml
Copy link
Contributor

@rPraml rPraml commented Oct 19, 2023

Context

We have a multi module project, where we have a "commons-junit" maven module.
The "commons-junit" module provides some basic tests in an abstract class, that other modules can can (re)use.
Now we want to add module-infos in all our modules and we come across the problem, that allure-descriptions-javadoc puts the descriptions in the folder allureDescriptions.

As this looks like a package, we get the jpms split package situation and get the error

Package allureDescriptions in both module A and module B

This PR changes the destination from allureDescriptions to META-INF/allureDescriptions as suggested here
https://stackoverflow.com/questions/69526033/how-to-add-resources-to-two-modular-jars-in-same-named-folders

This will solve our problem, but I cannot estimate, if there are thirdParty frameworks, that rely on the folder location

Example use case

Content of the "commons-junit" module

public abstract class BasicArchitectureTest {
	/**
	 * Tests for correct test class names (uses com.tngtech.archunit).
	 */
	@Test
	@Description(useJavaDoc = true)
	public void testTestClassNames() {
		testClasses()
				.should()
				.haveSimpleNameEndingWith("Test")
				.orShould()
				.haveSimpleNameEndingWith("IT") // covers also UIT
				.check(SRC_TEST_JAVA);
	}
}

Content of other module (depends on commons-junit)

public class CoreCommonsJunitArchitectureTest extends BasicArchitectureTest {
        // execute all tests in this module provided by BasicArchitectureTest 

    	/**
	 * module specific architecture tests
	 */
	@Test
	@Description(useJavaDoc = true)
	public void testFoo() {
            ...
        }
}

Checklist

@baev baev added the type:improvement Change that improves some user experience but can't be considered as a new feature label Oct 19, 2023
Copy link
Member

@baev baev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general

@baev baev changed the title Put descriptions in META-INF folder fix(descriptions-javadoc): put descriptions in META-INF folder Oct 19, 2023
@baev baev merged commit 3add1c9 into allure-framework:master Oct 19, 2023
@baev
Copy link
Member

baev commented Oct 19, 2023

@rPraml thanks!

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

Labels

theme:core theme:descriptions-javadoc type:improvement Change that improves some user experience but can't be considered as a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants