-
Notifications
You must be signed in to change notification settings - Fork 0
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
Working on streamlining the Maven build #510
Conversation
chrisdutz
commented
Dec 12, 2018
- Added support for MavenWrapper
- Refactored the build to always generate thrift sources without the need to install an executable
- Fixed most issues found in the build
- Aligned the build with how Apache expects incubating projects to be built
- Added some recommended additional tooling
- Streamlined the maven build to be more align with the way Apache needs projects to be built
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>1.5.4.RELEASE</version> | ||
<relativePath /> <!-- lookup parent from repository --> | ||
</parent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependency is a little bit special. If you remove springframework dependency here, then the war file can't be executed correctly. Becuase this springframework add some dependencies and plugins from parent pom file.
If you use Eclipse, you can check the effective pom.
So I suggest that grafana project should be considered as a single private project and only provide executable war file to users. not open-source.
@jixuan1989
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case we would have to add what's missing ... I'm working on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no conflict that making Grafana-connector as an open source project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a little bit challenging, springframework has may dependencies and plugins which are difficult to decide whether to add them to our project or not.
After you finish adding dependencies and plugins , run “mvn clean package” and get war file
First you need to copy application.properties in "conf" directory to target directory , then run "java -jar iotdb-grafana-0.8.0-SNAPSHOT.war"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the main problem is the dependency versions and that can easily be solved by importing that information ... as I mentioned ... I'm still working on this particular part of the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ... so with my latest commit, the spring boot application seems to be runnable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use your grafana/pom.xml and run in Win10, then i got :
$ java -jar iotdb-grafana-0.8.0-SNAPSHOT.war
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.AbstractMethodError: ch.qos.logback.classic.pattern.EnsureExceptionHandling.process(Lch/qos/logback/core/Context;Lch/qos/logback/core/pattern/Converter;)V
at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:89)
at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28)
at ch.qos.logback.classic.BasicConfigurator.configure(BasicConfigurator.java:50)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:164)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:179)
at cn.edu.tsinghua.web.TsfileWebDemoApplication.main(TsfileWebDemoApplication.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Add the following dependency in <dependencyManagement> can fix this problem and run successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't I add exactly that dependency? Did you rebuild the entire project? Because I bumped the version in the root pom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried again with root pom, it works. Everything is all right now
Great! My mates, I suggest that we take half of time to learn how Chris uses Maven carefully by reviewing these codes. |
<slf4j.version>1.7.12</slf4j.version> | ||
<logback.version>1.1.3</logback.version> | ||
<json.version>20140107</json.version> | ||
<joda.version>2.9.9</joda.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the mail list:
You are relying on Java 8 so the Jodatime library is included in general there is no need to use the external library and the included classes could be used)
I check the source code in IoTDB, it seems that only spring-boot use joda. @MyXOF can you double check it again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see, jdbc, cli and iotdb also use joda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do a full-text search on "import org.joda.time" you'll find a lot more ...
… the grafana module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1