jrxxjr commented on PR #1525: URL: https://github.com/apache/tomee/pull/1525#issuecomment-2380842041
Markus, i saw the problem, and i am fixing it. Best Regards, Evaldo Junior Em sáb., 28 de set. de 2024 às 10:01, Markus Jung ***@***.***> escreveu: > ***@***.**** requested changes on this pull request. > > Awesome PR, we can always need more examples that guide users! I've > annotated a few minor things I'd like to see changed, then we can merge > this IMO > ------------------------------ > > In examples/import-database-flyway-maven/README.adoc > <https://github.com/apache/tomee/pull/1525#discussion_r1779478525>: > > > +1 - Run the build of the entire project, in the project root directory, tomee: > + > +[source,bash] > +---- > +-Pquick -Dsurefire.useFile=false -DdisableXmlReport=true -DuniqueVersion=false -ff -Dassemble -DskipTests -DfailIfNoTests=false clean install > > afaik examples are standalone, so we should not be telling users to build > tomee first > ------------------------------ > > In examples/import-database-flyway-maven/pom.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779478814>: > > > +<!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more > + ~ contributor license agreements. See the NOTICE file distributed with ~ > + this work for additional information regarding copyright ownership. ~ The > + ASF licenses this file to You 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. --> > > license header format is incorrect > ------------------------------ > > In examples/import-database-flyway-maven/pom.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779478995>: > > > + 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="http://maven.apache.org/POM/4.0.0" > + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> > + <modelVersion>4.0.0</modelVersion> > + <groupId>org.superbiz</groupId> > + <artifactId>import-database-flyway-maven</artifactId> > + <version>10.0.0-M3-SNAPSHOT</version> > + <packaging>war</packaging> > + <name>TomEE :: Examples :: Import Database By Flyway By Maven Plugin</name> > + <properties> > + <version.jakartaee-api>10.0-M2</version.jakartaee-api> > + <version.microprofile>5.0</version.microprofile> > > tomee 10 is microprofile 6.0. Also generally speaking, don't think this > example requires microprofile APIs and I would like to keep these as simple > as possible > ------------------------------ > > In examples/import-database-flyway-maven/pom.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779479236>: > > > + <artifactId>openejb-core</artifactId> > + <version>10.0.0-M3-SNAPSHOT</version> > + <exclusions> > + <exclusion> > + <groupId>org.apache.commons</groupId> > + <artifactId>commons-lang3</artifactId> > + </exclusion> > + </exclusions> > + </dependency> > + <dependency> > + <groupId>org.apache.tomee</groupId> > + <artifactId>jakartaee-api</artifactId> > + <version>${version.jakartaee-api}</version> > + <scope>provided</scope> > + </dependency> > + <dependency> > > I think all dependencies below this line are not needed for this example > ------------------------------ > > In examples/import-database-flyway/pom.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779479704>: > > > +<!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more > + ~ contributor license agreements. See the NOTICE file distributed with ~ > + this work for additional information regarding copyright ownership. ~ The > + ASF licenses this file to You 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. --> > > license header > ------------------------------ > > In > examples/import-database-flyway/src/main/java/org/apache/openejb/assembler/classic/migrate/database/ImportByFlyway.java > <https://github.com/apache/tomee/pull/1525#discussion_r1779479971>: > > > + public void doValidate() { > + String selectAllByMail = "SELECT id, description FROM table_test"; > + > + try (PreparedStatement statement = dataSource.getConnection().prepareStatement(selectAllByMail)) { > + > + ResultSet resultSet = statement.executeQuery(); > + while (resultSet.next()) { > + LOGGER.info("id:" + resultSet.getInt("id") + " description:" + resultSet.getString("description")); > + > + } > + } catch (Exception ex) { > + LOGGER.error("can't create a statement, import scripts will be ignored", ex); > + } > + > + } > > this is very specific to the schema used in this example, maybe move this > to the test to make it easier for users to just use (= copy) this class? > ------------------------------ > > In examples/import-database-liquibase-maven/changelog.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779480236>: > > > @@ -0,0 +1,9 @@ > +<databaseChangeLog > > missing license header > ------------------------------ > > In examples/import-database-liquibase-maven/pom.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779480289>: > > > @@ -0,0 +1,191 @@ > +<?xml version="1.0" encoding="UTF-8"?> > +<!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more > > license header format looks off again > ------------------------------ > > In examples/import-database-liquibase/.gitignore > <https://github.com/apache/tomee/pull/1525#discussion_r1779480581>: > > > @@ -0,0 +1 @@ > +/bin/ > > accidentally committed? > ------------------------------ > > In examples/import-database-liquibase-maven/README.adoc > <https://github.com/apache/tomee/pull/1525#discussion_r1779480824>: > > > @@ -0,0 +1,577 @@ > += Import Database By Liquibase By Maven Plugin > +:index-group: Import > +:jbake-type: page > +:jbake-status: not published/unrevised > + > +This is an example of how to use the Liquibase tool to import a database via the Maven Plugin. > + > +[discrete] > +==== Import Database By Liquibase By Maven Plugin > + > +To use Liquibase, when building the application, we will use the Maven Plugin to import the database, we will use an in-memory database. > + > +The SQL instructions defined in the script will be used `V1_0__importSqlScriptTest.sql`: > > SQL scripts are different in this example - they should match with what we > put in the README > ------------------------------ > > In > examples/import-database-liquibase/src/main/java/org/apache/openejb/assembler/classic/migrate/database/ImportByLiquibase.java > <https://github.com/apache/tomee/pull/1525#discussion_r1779480942>: > > > + public void doValidate() { > + String selectAllByMail = "SELECT id, description FROM public.table_test"; > + > + try (PreparedStatement statement = dataSource.getConnection().prepareStatement(selectAllByMail)) { > + ResultSet resultSet = statement.executeQuery(); > + while (resultSet.next()) { > + LOGGER.info("id:" + resultSet.getInt("id") + " description:" + resultSet.getString("description")); > + > + } > + } catch (Exception ex) { > + LOGGER.error("can't create a statement, import scripts will be ignored", ex); > + } > + > + } > > again, this looks more like test code to me > ------------------------------ > > In > examples/import-database-liquibase/src/test/java/org/apache/openejb/assembler/classic/migrate/database/liquibase/changelog.xml > <https://github.com/apache/tomee/pull/1525#discussion_r1779481024>: > > > @@ -0,0 +1,9 @@ > +<?xml version="1.0" encoding="UTF-8" standalone="no"?> > > missing license header > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/tomee/pull/1525#pullrequestreview-2334998319>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ACCV7AHPKFRI7QKMMCU5WMDZY2SB5AVCNFSM6AAAAABPAGFNDKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMZUHE4TQMZRHE> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomee.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org