pantsbuild / example-jvm Goto Github PK
View Code? Open in Web Editor NEWAn example repo to demonstrate Java and Scala support in Pants
Home Page: https://www.pantsbuild.org/2.20/docs/jvm/java-and-scala
License: Apache License 2.0
An example repo to demonstrate Java and Scala support in Pants
Home Page: https://www.pantsbuild.org/2.20/docs/jvm/java-and-scala
License: Apache License 2.0
Example from this repo:
java_sources(
dependencies=[
# Resource dependencies cannot be inferred, so we must explicitly declare that we
# depend on them.
"src/resources/org/pantsbuild/example/lib",
],
)
I tried to include dependency on resources for my "main" jar build of application:
scala_sources()
deploy_jar(
name="app",
main="MyApp",
dependencies=[
":scala",
"3rdparty/jvm/org/scala-lang:scala-library",
"src/main/resources",
],
)
but looks like external 3rd party dependencies can't access files from the resources folder.
I tried to use logback.xml for logger configuration and application.conf for typesafe config. Both libs use files from the resources folder by convention(both logback.xml and application.conf are standard names).
Looks like after packaging jar these libs can't access files from the resources folder.
Is there any way to specify resources for external libs?
I can create a minimal reproducible app if you need. Thanks.
Hello, after a quick test I can't get working jar out of this example app.
% ./pants package ::
14:04:12.59 [INFO] Wrote dist/src.jvm.org.pantsbuild.example.app/bin.jar
% java -jar dist/src.jvm.org.pantsbuild.example.app/bin.jar
Error: Main method is not static in class org.pantsbuild.example.app.ExampleApp, please define the main method as:
public static void main(String[] args)
java -cp dist/src.jvm.org.pantsbuild.example.app/bin.jar org.pantsbuild.example.app.ExampleApp
Error: Main method is not static in class org.pantsbuild.example.app.ExampleApp, please define the main method as:
public static void main(String[] args)
Am I doing something wrong? Thanks.
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.