View it on github pages here: https://aguibert.github.io/openliberty-cheat-sheet/
To contribute or build it locally:
$ brew install asciidoctor
$ ./build.sh
$ open docs/index.html
Concise tips and examples for using Open Liberty
Home Page: https://aguibert.github.io/openliberty-cheat-sheet/
License: Apache License 2.0
View it on github pages here: https://aguibert.github.io/openliberty-cheat-sheet/
To contribute or build it locally:
$ brew install asciidoctor
$ ./build.sh
$ open docs/index.html
Hi Andy,
as you probably have noticed on twitter, there currently seems to be no elegant way to supply shared resources to the liberty:dev
maven goal. So I thought you might want to add how to do this?
Use a library from the ${shared.resource.dir}
.
Relevant part from src/main/liberty/config/server.xml
:
<jdbcDriver id="h2" javax.sql.DataSource="org.h2.jdbcx.JdbcDataSource">
<library description="H2 Database" name="h2">
<fileset dir="${shared.resource.dir}/h2" includes="h2*.jar" />
</library>
</jdbcDriver>
<dataSource jdbcDriverRef="h2" jndiName="jdbc/oracledb" type="javax.sql.DataSource">
<connectionManager maxPoolSize="5" minPoolSize="2" />
<properties URL="jdbc:h2:mem:oracledb;MODE=oracle;LOG=1;USER=sa;password=" password="" user="sa" />
</dataSource>
liberty:dev
currently does not support copying artefacts to the ${shared.resource.dir}
itself. That's okay, the liberty-maven-plugin should probably only manage liberty.
But there is a caveat:
Suppose you execute mvn dependency:copy@goal liberty:dev
.
${project.output.directory}/liberty/wlp/usr/share/resources/h2/
as expected.liberty:dev
will delete the directory ${project.output.directory}/liberty/wlp
and unzip a fresh copy of liberty. The h2 library is gone, the server will not start.mvn dependency:copy@goal liberty:dev
(without clean!), it works fine -- but that is not a reliable nor desirable solution.So I came up with this configuration in my pom.xml
which redefines wlp.usr.dir
/WLP_USR_DIR
. I think this could possible be added to the cheat sheet.
<wlp.usr.dir>${project.build.directory}</wlp.user.dir>
<wlp.shared.resource.dir>${wlp.usr.dir}/shared/resources</wlp.shared.resource.dir>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<configuration>
<userDirectory>${wlp.usr.dir}</userDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-shared-resources</id>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${dependency.h2.version}</version>
<outputDirectory>${wlp.shared.resource.dir]/h2</outputDirectory>
<destFileName>h2-${dependency.h2.version}.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
Maybe this solution can be added to the examples? I figured out having wlp.usr.dir
(or env WLP_USR_DIR
in a subdirectory of a liberty installation is (almost) never a good idea. I have a few (open)liberty versions on my machines, and I use the same WLP_USR_DIR for all of them.
Very nice initiative @aguibert!
Some initial content that we might want to add, especially what is not obvious in the docs:
server.xml
, defaults, and override locationliberty-maven-plugin
dev modemonitor-1.0
example with Liberty-specific metricsusr:opentracingZipkin
, similar to this exampleHi,
I found out that https://developer.ibm.com/wasdev/docs/writing-functional-tests-liberty/ has some more methods of starting an integration test.
While the current cheat sheet contains microshed and arquillian, there seem to be other methods:
The document is written by Iain Duncan and was written back in 2015. It is hosted on ibm.com (License?).
If the Junit approach still might be reasonable today, maybe even create a new repo under https://github.com/OpenLiberty and host Junit4 rules/runners and Junit5 Extensions?
If this approach is not reasonable, maybe even document as well ("not recommended, because โฆ").
I would also like to see the disadvantages and advantages listed for each method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.