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

Working on streamlining the Maven build #510

Merged
merged 2 commits into from
Dec 14, 2018
Merged

Working on streamlining the Maven build #510

merged 2 commits into from
Dec 14, 2018

Conversation

chrisdutz
Copy link
Contributor

  • 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>
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Collaborator

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"

If you see the below picture, then the work is done.
image

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

@MyXOF MyXOF Dec 12, 2018

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.

image

Copy link
Contributor Author

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.

Copy link
Collaborator

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

@jixuan1989
Copy link
Member

Great!

My mates, I suggest that we take half of time to learn how Chris uses Maven carefully by reviewing these codes.

@jixuan1989
Copy link
Member

This PR is for fixing issue #500 and #501

<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>
Copy link
Member

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?

Copy link
Collaborator

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

Copy link
Contributor Author

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 ...

Copy link
Collaborator

@MyXOF MyXOF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jixuan1989 jixuan1989 merged commit 2ddfa91 into thulab:master Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants