Skip to content

Commit

Permalink
Reproducer for 19152, dev mode maven profile problem
Browse files Browse the repository at this point in the history
  • Loading branch information
famod committed Aug 1, 2021
1 parent c9af463 commit 3e2864c
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 3 deletions.
24 changes: 22 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
<artifactId>modmono-quarkus-core</artifactId>
<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -34,6 +39,21 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>mock-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
<configuration>
<classifier>mocks</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package com.github.famod.modmono_quarkus.core;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import com.github.famod.modmono_quarkus.support.SupportInterface;

@ApplicationScoped
public class HelloBean {

@Inject
SupportInterface support;

public String hello() {
return "hellooo";
return "hello: " + support.getSupport();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.github.famod.modmono_quarkus.support;

public interface SupportInterface {

String getSupport();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.famod.modmono_quarkus.core.testlib;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;

import org.mockito.Mockito;

import com.github.famod.modmono_quarkus.support.SupportInterface;

import io.quarkus.arc.AlternativePriority;

public class SupportMockProducer {

static {
System.err.println(":::: " + SupportMockProducer.class.getProtectionDomain().getCodeSource().getLocation());
}

@Produces
@RequestScoped
@AlternativePriority(-1)
SupportInterface produceMock() {
return Mockito.mock(SupportInterface.class);
}
}
Empty file.
6 changes: 6 additions & 0 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<artifactId>modmono-quarkus-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.famod.modmono-quarkus</groupId>
<artifactId>modmono-quarkus-support</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
Expand All @@ -34,6 +39,7 @@
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<goals>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>mocks</id>
</profile>
</profiles>
<modules>
<module>core</module>
<module>support</module>
<module>dist</module>
</modules>
</project>
66 changes: 66 additions & 0 deletions support/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.famod.modmono-quarkus</groupId>
<artifactId>modmono-quarkus-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>modmono-quarkus-support</artifactId>
<dependencies>
<dependency>
<groupId>com.github.famod.modmono-quarkus</groupId>
<artifactId>modmono-quarkus-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.famod.modmono-quarkus</groupId>
<artifactId>modmono-quarkus-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<executions>
<execution>
<id>make-index</id>
<phase>compile</phase>
<goals>
<goal>jandex</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>mocks</id>
<dependencies>
<dependency>
<groupId>com.github.famod.modmono-quarkus</groupId>
<artifactId>modmono-quarkus-core</artifactId>
<version>${project.version}</version>
<classifier>mocks</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.famod.modmono_quarkus.support.connector;

import javax.enterprise.context.ApplicationScoped;

import com.github.famod.modmono_quarkus.support.SupportInterface;

@ApplicationScoped
public class SupportBean implements SupportInterface {

@Override
public String getSupport() {
return "real support";
}

}

0 comments on commit 3e2864c

Please sign in to comment.