Test BOM edits #9

This commit is contained in:
Peter Palaga
2020-09-28 18:23:19 +02:00
parent f13a01c97a
commit 9c1b63eb16
22 changed files with 716 additions and 51 deletions

View File

@@ -1,4 +1,20 @@
#!/usr/bin/env bash
#
# Copyright 2019 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e
#set -x

View File

@@ -88,6 +88,15 @@ public class ClientLayout extends Layout {
this.logbackConfigurationPath = logbackConfigurationPath;
}
/**
* @param newUserDir where to change the current directory to
* @return a new {@link ClientLayout} with {@code userDir} set to the given {@code newUserDir}
*/
public ClientLayout cd(Path newUserDir) {
return new ClientLayout(mvndPropertiesPath, mavenHome, newUserDir, multiModuleProjectDirectory, javaHome,
localMavenRepository, settings, logbackConfigurationPath);
}
/**
* @return absolute normalized path to local Maven repository or {@code null} if the server is supposed to use the
* default

View File

@@ -27,10 +27,10 @@ public class Layout {
private static Layout ENV_INSTANCE;
private final Path mavenHome;
private final Path userDir;
private final Path multiModuleProjectDirectory;
private final Path mvndPropertiesPath;
protected final Path mavenHome;
protected final Path userDir;
protected final Path multiModuleProjectDirectory;
protected final Path mvndPropertiesPath;
public Layout(Path mvndPropertiesPath, Path mavenHome, Path userDir, Path multiModuleProjectDirectory) {
super();

View File

@@ -26,6 +26,7 @@ import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientLayout;
import org.jboss.fuse.mvnd.client.ClientOutput;
import org.jboss.fuse.mvnd.junit.MvndNativeTest;
import org.jboss.fuse.mvnd.junit.TestUtils;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@@ -68,9 +69,7 @@ public class ModuleAndPluginNativeIT {
{
final Path mojoPath = layout.multiModuleProjectDirectory()
.resolve("plugin/src/main/java/org/jboss/fuse/mvnd/test/module/plugin/mojo/HelloMojo.java");
String mojoSource = new String(Files.readAllBytes(mojoPath), StandardCharsets.UTF_8);
mojoSource = mojoSource.replace("\"Hello\".getBytes", "\"Hi\".getBytes");
Files.write(mojoPath, mojoSource.getBytes(StandardCharsets.UTF_8));
TestUtils.replace(mojoPath, "\"Hello\".getBytes", "\"Hi\".getBytes");
final ClientOutput output = Mockito.mock(ClientOutput.class);
client.execute(output,

View File

@@ -0,0 +1,80 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.it;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Arrays;
import javax.inject.Inject;
import org.assertj.core.api.Assertions;
import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientOutput;
import org.jboss.fuse.mvnd.junit.ClientFactory;
import org.jboss.fuse.mvnd.junit.MvndNativeTest;
import org.jboss.fuse.mvnd.junit.TestLayout;
import org.jboss.fuse.mvnd.junit.TestRegistry;
import org.jboss.fuse.mvnd.junit.TestUtils;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@MvndNativeTest(projectDir = "src/test/projects/upgrades-in-bom")
public class UpgradesInBomNativeIT {
@Inject
TestLayout layout;
@Inject
TestRegistry registry;
@Inject
ClientFactory clientFactory;
@Test
void upgrade() throws IOException, InterruptedException {
/* Install the dependencies */
for (String artifactDir : Arrays.asList("project/hello-0.0.1", "project/hello-0.0.2-SNAPSHOT")) {
final Client cl = clientFactory.newClient(layout.cd(layout.getTestDir().resolve(artifactDir)));
final ClientOutput output = Mockito.mock(ClientOutput.class);
cl.execute(output, "clean", "install", "-e").assertSuccess();
registry.killAll();
}
Assertions.assertThat(registry.getAll().size()).isEqualTo(0);
/* Build the initial state of the test project */
final Path parentDir = layout.getTestDir().resolve("project/parent");
final Client cl = clientFactory.newClient(layout.cd(parentDir));
{
final ClientOutput output = Mockito.mock(ClientOutput.class);
cl.execute(output, "clean", "install", "-e").assertSuccess();
}
Assertions.assertThat(registry.getAll().size()).isEqualTo(1);
/* Upgrade the dependency */
final Path parentPomPath = parentDir.resolve("pom.xml");
TestUtils.replace(parentPomPath, "<hello.version>0.0.1</hello.version>",
"<hello.version>0.0.2-SNAPSHOT</hello.version>");
/* Adapt the caller */
final Path useHelloPath = parentDir
.resolve("module/src/main/java/org/jboss/fuse/mvnd/test/upgrades/bom/module/UseHello.java");
TestUtils.replace(useHelloPath, "new Hello().sayHello()", "new Hello().sayWisdom()");
{
final ClientOutput output = Mockito.mock(ClientOutput.class);
cl.execute(output, "clean", "install", "-e").assertSuccess();
}
Assertions.assertThat(registry.getAll().size()).isEqualTo(1);
}
}

View File

@@ -0,0 +1,80 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.it;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Arrays;
import javax.inject.Inject;
import org.assertj.core.api.Assertions;
import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientOutput;
import org.jboss.fuse.mvnd.junit.ClientFactory;
import org.jboss.fuse.mvnd.junit.MvndTest;
import org.jboss.fuse.mvnd.junit.TestLayout;
import org.jboss.fuse.mvnd.junit.TestRegistry;
import org.jboss.fuse.mvnd.junit.TestUtils;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@MvndTest(projectDir = "src/test/projects/upgrades-in-bom")
public class UpgradesInBomTest {
@Inject
TestLayout layout;
@Inject
TestRegistry registry;
@Inject
ClientFactory clientFactory;
@Test
void upgrade() throws IOException, InterruptedException {
/* Install the dependencies */
for (String artifactDir : Arrays.asList("project/hello-0.0.1", "project/hello-0.0.2-SNAPSHOT")) {
final Client cl = clientFactory.newClient(layout.cd(layout.getTestDir().resolve(artifactDir)));
final ClientOutput output = Mockito.mock(ClientOutput.class);
cl.execute(output, "clean", "install", "-e").assertSuccess();
registry.killAll();
}
Assertions.assertThat(registry.getAll().size()).isEqualTo(0);
/* Build the initial state of the test project */
final Path parentDir = layout.getTestDir().resolve("project/parent");
final Client cl = clientFactory.newClient(layout.cd(parentDir));
{
final ClientOutput output = Mockito.mock(ClientOutput.class);
cl.execute(output, "clean", "install", "-e").assertSuccess();
}
Assertions.assertThat(registry.getAll().size()).isEqualTo(1);
/* Upgrade the dependency */
final Path parentPomPath = parentDir.resolve("pom.xml");
TestUtils.replace(parentPomPath, "<hello.version>0.0.1</hello.version>",
"<hello.version>0.0.2-SNAPSHOT</hello.version>");
/* Adapt the caller */
final Path useHelloPath = parentDir
.resolve("module/src/main/java/org/jboss/fuse/mvnd/test/upgrades/bom/module/UseHello.java");
TestUtils.replace(useHelloPath, "new Hello().sayHello()", "new Hello().sayWisdom()");
{
final ClientOutput output = Mockito.mock(ClientOutput.class);
cl.execute(output, "clean", "install", "-e").assertSuccess();
}
Assertions.assertThat(registry.getAll().size()).isEqualTo(1);
}
}

View File

@@ -0,0 +1,23 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.junit;
import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientLayout;
public interface ClientFactory {
Client newClient(ClientLayout layout);
}

View File

@@ -22,18 +22,16 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Stream;
import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientLayout;
import org.jboss.fuse.mvnd.client.DefaultClient;
import org.jboss.fuse.mvnd.common.BuildProperties;
import org.jboss.fuse.mvnd.common.DaemonInfo;
import org.jboss.fuse.mvnd.common.DaemonRegistry;
import org.jboss.fuse.mvnd.common.Environment;
import org.jboss.fuse.mvnd.common.Layout;
import org.jboss.fuse.mvnd.jpm.ProcessImpl;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
@@ -92,26 +90,15 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
javax.inject.Inject inject = f.getAnnotation(javax.inject.Inject.class);
if (inject != null) {
f.setAccessible(true);
if (f.getType() == DaemonRegistry.class) {
if (DaemonRegistry.class.isAssignableFrom(f.getType())) {
f.set(testInstance, resource.registry);
} else if (Layout.class.isAssignableFrom(f.getType())) {
f.set(testInstance, resource.layout);
} else if (f.getType() == Client.class) {
if (resource.isNative) {
final Path mvndNativeExecutablePath = resource.layout.mavenHome().resolve(
System.getProperty("os.name").toLowerCase(Locale.ROOT).startsWith("windows")
? "bin/mvnd.exe"
: "bin/mvnd")
.toAbsolutePath().normalize();
if (!Files.isRegularFile(mvndNativeExecutablePath)) {
throw new IllegalStateException("mvnd executable does not exist: " + mvndNativeExecutablePath);
}
f.set(testInstance,
new NativeTestClient(resource.layout, mvndNativeExecutablePath, resource.timeoutMs));
} else {
f.set(testInstance, new DefaultClient(() -> resource.layout, BuildProperties.getInstance()));
}
} else if (f.getType() == NativeTestClient.class) {
f.set(testInstance, newClient(resource.isNative, resource.layout, resource.timeoutMs));
} else if (f.getType() == ClientFactory.class) {
final ClientFactory cf = customLayout -> newClient(resource.isNative, customLayout, resource.timeoutMs);
f.set(testInstance, cf);
}
}
}
@@ -119,6 +106,22 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
}
}
Client newClient(boolean isNative, ClientLayout layout, long timeoutMs) {
if (isNative) {
final Path mvndNativeExecutablePath = layout.mavenHome().resolve(
System.getProperty("os.name").toLowerCase(Locale.ROOT).startsWith("windows")
? "bin/mvnd.exe"
: "bin/mvnd")
.toAbsolutePath().normalize();
if (!Files.isRegularFile(mvndNativeExecutablePath)) {
throw new IllegalStateException("mvnd executable does not exist: " + mvndNativeExecutablePath);
}
return new NativeTestClient(layout, mvndNativeExecutablePath, timeoutMs);
} else {
return new DefaultClient(() -> layout, BuildProperties.getInstance());
}
}
@Override
public void afterAll(ExtensionContext context) throws Exception {
final Store store = context.getRoot().getStore(ExtensionContext.Namespace.GLOBAL);
@@ -131,7 +134,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
static class MvndResource implements ExtensionContext.Store.CloseableResource {
private final TestLayout layout;
private final DaemonRegistry registry;
private final TestRegistry registry;
private final boolean isNative;
private final long timeoutMs;
@@ -195,7 +198,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
Paths.get(System.getProperty("java.home")).toAbsolutePath().normalize(),
localMavenRepository, settingsPath,
mvndHome.resolve("conf/logging/logback.xml"));
final DaemonRegistry registry = new DaemonRegistry(layout.registry());
final TestRegistry registry = new TestRegistry(layout.registry());
return new MvndResource(layout, registry, isNative, timeoutMs);
}
@@ -234,7 +237,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
return settingsPath;
}
public MvndResource(TestLayout layout, DaemonRegistry registry, boolean isNative, long timeoutMs) {
public MvndResource(TestLayout layout, TestRegistry registry, boolean isNative, long timeoutMs) {
super();
this.layout = layout;
this.registry = registry;
@@ -244,25 +247,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
@Override
public void close() throws Exception {
List<DaemonInfo> daemons;
final int timeout = 5000;
final long deadline = System.currentTimeMillis() + timeout;
while (!(daemons = registry.getAll()).isEmpty()) {
for (DaemonInfo di : daemons) {
try {
new ProcessImpl(di.getPid()).destroy();
} catch (IOException t) {
System.out.println("Daemon " + di.getUid() + ": " + t.getMessage());
} catch (Exception t) {
System.out.println("Daemon " + di.getUid() + ": " + t);
} finally {
registry.remove(di.getUid());
}
}
if (deadline < System.currentTimeMillis() && !registry.getAll().isEmpty()) {
throw new RuntimeException("Could not stop all mvnd daemons within " + timeout + " ms");
}
}
registry.killAll();
}
}

View File

@@ -0,0 +1,53 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.junit;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import org.jboss.fuse.mvnd.common.DaemonInfo;
import org.jboss.fuse.mvnd.common.DaemonRegistry;
import org.jboss.fuse.mvnd.jpm.ProcessImpl;
public class TestRegistry extends DaemonRegistry {
public TestRegistry(Path registryFile) {
super(registryFile);
}
public void killAll() {
List<DaemonInfo> daemons;
final int timeout = 5000;
final long deadline = System.currentTimeMillis() + timeout;
while (!(daemons = getAll()).isEmpty()) {
for (DaemonInfo di : daemons) {
try {
new ProcessImpl(di.getPid()).destroy();
} catch (IOException t) {
System.out.println("Daemon " + di.getUid() + ": " + t.getMessage());
} catch (Exception t) {
System.out.println("Daemon " + di.getUid() + ": " + t);
} finally {
remove(di.getUid());
}
}
if (deadline < System.currentTimeMillis() && !getAll().isEmpty()) {
throw new RuntimeException("Could not stop all mvnd daemons within " + timeout + " ms");
}
}
}
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.junit;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class TestUtils {
public static void replace(Path path, String find, String replacement) {
try {
final String originalSrc = new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
final String newSrc = originalSrc.replace(find, replacement);
if (originalSrc.equals(newSrc)) {
throw new IllegalStateException("[" + find + "] not found in " + path);
}
Files.write(path, newSrc.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("Could not read or write " + path, e);
}
}
}

View File

@@ -30,7 +30,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>

View File

@@ -30,7 +30,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>

View File

@@ -30,7 +30,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>

View File

@@ -0,0 +1,71 @@
<!--
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-hello</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.test.upgrades.bom.hello;
public class Hello {
public String sayHello() {
return "Hello";
}
}

View File

@@ -0,0 +1,71 @@
<!--
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-hello</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.test.upgrades.bom.hello;
public class Hello {
public int sayWisdom() {
return 42;
}
}

View File

@@ -0,0 +1,41 @@
<!--
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>upgrades-in-bom-bom</artifactId>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-hello</artifactId>
<version>${hello.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@@ -0,0 +1,49 @@
<!--
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>upgrades-in-bom-module</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-bom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-hello</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.fuse.mvnd.test.upgrades.bom.module;
import org.jboss.fuse.mvnd.test.upgrades.bom.hello.Hello;
public class UseHello {
public void use() {
System.out.println(new Hello().sayHello());
}
}

View File

@@ -0,0 +1,77 @@
<!--
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.fuse.mvnd.test.upgrades-in-bom</groupId>
<artifactId>upgrades-in-bom-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<hello.version>0.0.1</hello.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
</properties>
<modules>
<module>bom</module>
<module>module</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>