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

Bump to Quarkus 3.3.0 #284

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion quarkus-workshop-super-heroes/docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<jdk-version>${maven.compiler.source}</jdk-version>
<graalvm-version>22.3</graalvm-version>
<maven-version>3.8.x</maven-version>
<quarkus-version>3.0.3.Final</quarkus-version>
<quarkus-version>3.3.0</quarkus-version>
<quarkus-pact-version>1.0.1.Final</quarkus-pact-version>
</attributes>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ In addition, you can see the `quarkus-maven-plugin` responsible for the packagin
<project>
<!-- ... -->
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>{quarkus-version}</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
</properties>
<!-- ... -->
<dependencyManagement>
Expand All @@ -142,8 +142,8 @@ In addition, you can see the `quarkus-maven-plugin` responsible for the packagin
</dependency>
</dependencies>
</dependencyManagement>
<!-- ... -->
<build>
<!-- ... -->
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
Expand Down Expand Up @@ -247,19 +247,18 @@ $ ./mvnw quarkus:dev
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:{quarkus-version}:dev (default-cli) @ rest-villains ---
[INFO] Invoking org.apache.maven.plugins:maven-resources-plugin:2.6:resources @ rest-villains
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Invoking io.quarkus.platform:quarkus-maven-plugin:{quarkus-version}:generate-code @ rest-villains
[INFO] Invoking org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile @ rest-villains
[INFO] Invoking resources:3.3.1:resources (default-resources) @ rest-villains
[INFO] Copying 2 resources from src/main/resources to target/classes
[INFO] Invoking quarkus:{quarkus-version}:generate-code (default) @ rest-villains
[INFO] Invoking compiler:3.11.0:compile (default-compile) @ rest-villains
[INFO] Nothing to compile - all classes are up to date
[INFO] Invoking org.apache.maven.plugins:maven-resources-plugin:2.6:testResources @ rest-villains
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Invoking resources:3.3.1:testResources (default-testResources) @ rest-villains
[INFO] skip non existing resourceDirectory /Users/agoncal/Documents/Code/Temp/quarkus-super-heroes/super-heroes/rest-villains/src/test/resources
[INFO] Invoking io.quarkus.platform:quarkus-maven-plugin:2{quarkus-version}:generate-code-tests @ rest-villains
[INFO] Invoking org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile @ rest-villains
[INFO] Invoking quarkus:{quarkus-version}:generate-code-tests (default) @ rest-villains
[INFO] Invoking compiler:3.11.0:testCompile (default-testCompile) @ rest-villains
[INFO] Nothing to compile - all classes are up to date
Listening for transport dt_socket at address: 5005

__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ You should already have installed the infrastructure into the `infrastructure` d

[example, role="cta"]
--
Now, just execute `docker compose -f docker-compose.yaml up -d`.
Now, just execute `docker compose -f docker-compose.yaml up -d` under the `infrastructure` directory.
You should see a few logs going on and then all the containers get started.

ifdef::use-linux[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Make sure you have the `GRAALVM_HOME` environment variable defined and pointing
Then create a native executable using: `./mvnw package -Pnative`.
In addition to the regular files, the build also produces `target/rest-villains-1.0.0-SNAPSHOT-runner` (notice that there is no `.jar` file extension).
You can run it using `./target/rest-villains-1.0.0-SNAPSHOT-runner` and curl the endpoint with `curl http://localhost:8084/api/villains`.
Remember that this is using the `prod` profile, meaning that the infrastructure needs to be up and running (`docker compose -f docker-compose.yaml up -d`).
--

[WARNING]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ directory, use `./mvnw quarkus:dev` to start the web application.
Be sure you have the hero, villain and fights microservices running (dev mode is enough).
--

If you don't have Node installed, Quinoa will install it during the start process.
If you don't have Node installed, Quinoa will install it during the start process (under the `.quinoa` directory).

----
2023-05-18 14:21:38,896 INFO [com.git.eir.mav.plu.fro.lib.NodeInstaller] (build-40) Installing node version v16.16.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ Replace the `META-INF/resources/index.html` file with the following content:
</head>
<body>
<div class="container">
<div class="row">
<div class="col"><h1 class="page-title">Super Stats</h1></div>
</div>
<div class="row">
<div class="col"><h1 class="page-title">Super Stats</h1></div>
</div>
</div>
<div class="container container-cards-pf">
<div class="row row-cards-pf">
Expand Down Expand Up @@ -266,12 +266,13 @@ Replace the `META-INF/resources/index.html` file with the following content:
<script>
$(document).ready(function() {
var host = window.location.host;
var protocol = (window.location.protocol == "https:") ? "wss" : "ws";

var top = new WebSocket("ws://" + host + "/stats/winners");
var top = new WebSocket(protocol + "://" + host + "/stats/winners");
top.onmessage = function (event) {
updateTop(event.data);
};
var team = new WebSocket("ws://" + host + "/stats/team");
var team = new WebSocket(protocol + "://" + host + "/stats/team");
team.onmessage = function(event) {
console.log(event.data);
updateRatio(event.data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ nb-configuration.xml

# Local environment
.env

# Plugin directory
/.quarkus/cli/plugins/
Original file line number Diff line number Diff line change
Expand Up @@ -17,110 +17,60 @@
* under the License.
*/

import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
import java.io.IOException;
import java.io.InputStream;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public class MavenWrapperDownloader
public final class MavenWrapperDownloader
{
private static final String WRAPPER_VERSION = "3.1.1";
private static final String WRAPPER_VERSION = "3.2.0";

/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/" + WRAPPER_VERSION
+ "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use instead of the
* default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main( String args[] )
public static void main( String[] args )
{
System.out.println( "- Downloader started" );
File baseDirectory = new File( args[0] );
System.out.println( "- Using base directory: " + baseDirectory.getAbsolutePath() );
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File( baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH );
String url = DEFAULT_DOWNLOAD_URL;
if ( mavenWrapperPropertyFile.exists() )
if ( args.length != 2 )
{
FileInputStream mavenWrapperPropertyFileInputStream = null;
try
{
mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile );
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load( mavenWrapperPropertyFileInputStream );
url = mavenWrapperProperties.getProperty( PROPERTY_NAME_WRAPPER_URL, url );
}
catch ( IOException e )
{
System.out.println( "- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'" );
}
finally
{
try
{
if ( mavenWrapperPropertyFileInputStream != null )
{
mavenWrapperPropertyFileInputStream.close();
}
}
catch ( IOException e )
{
// Ignore ...
}
}
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
System.exit( 1 );
}
System.out.println( "- Downloading from: " + url );

File outputFile = new File( baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH );
if ( !outputFile.getParentFile().exists() )
{
if ( !outputFile.getParentFile().mkdirs() )
{
System.out.println( "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath()
+ "'" );
}
}
System.out.println( "- Downloading to: " + outputFile.getAbsolutePath() );
try
{
downloadFileFromURL( url, outputFile );
System.out.println( "Done" );
System.exit( 0 );
log( " - Downloader started" );
final URL wrapperUrl = new URL( args[0] );
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
downloadFileFromURL( wrapperUrl, wrapperJarPath );
log( "Done" );
}
catch ( Throwable e )
catch ( IOException e )
{
System.out.println( "- Error downloading" );
e.printStackTrace();
System.err.println( "- Error downloading: " + e.getMessage() );
if ( VERBOSE )
{
e.printStackTrace();
}
System.exit( 1 );
}
}

private static void downloadFileFromURL( String urlString, File destination )
throws Exception
private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
throws IOException
{
log( " - Downloading to: " + wrapperJarPath );
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
{
String username = System.getenv( "MVNW_USERNAME" );
char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
final String username = System.getenv( "MVNW_USERNAME" );
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
Authenticator.setDefault( new Authenticator()
{
@Override
Expand All @@ -130,13 +80,19 @@ protected PasswordAuthentication getPasswordAuthentication()
}
} );
}
URL website = new URL( urlString );
ReadableByteChannel rbc;
rbc = Channels.newChannel( website.openStream() );
FileOutputStream fos = new FileOutputStream( destination );
fos.getChannel().transferFrom( rbc, 0, Long.MAX_VALUE );
fos.close();
rbc.close();
try ( InputStream inStream = wrapperUrl.openStream() )
{
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
}
log( " - Downloader complete" );
}

private static void log( String msg )
{
if ( VERBOSE )
{
System.out.println( msg );
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
Loading
Loading