kandi background
Explore Kits

trimou | Mustache/handlebars templating engine in Java

 by   trimou Java Version: 2.5.0.Final License: Apache-2.0

 by   trimou Java Version: 2.5.0.Final License: Apache-2.0

Download this library from

kandi X-RAY | trimou Summary

trimou is a Java library typically used in Template Engine applications. trimou has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub, Maven.
Trimou is a templating engine. It's a Mustache implementation but Helpers API inspired by Handlebars.js is also supported. The goal is to provide a simple to use and easy to extend templating engine for any Java SE or Java EE application. There are some ready-to-use extensions which provide integration with CDI, Servlets, PrettyTime, HtmlCompressor, google-gson, JSON Processing Object Model API (JSR 353), Spring MVC, Dropwizard and EL 3.0.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • trimou has a low active ecosystem.
  • It has 70 star(s) with 19 fork(s). There are 5 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 6 open issues and 98 have been closed. On average issues are closed in 23 days. There are 3 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of trimou is 2.5.0.Final
trimou Support
Best in #Java
Average in #Java
trimou Support
Best in #Java
Average in #Java

quality kandi Quality

  • trimou has 0 bugs and 0 code smells.
trimou Quality
Best in #Java
Average in #Java
trimou Quality
Best in #Java
Average in #Java

securitySecurity

  • trimou has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • trimou code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
trimou Security
Best in #Java
Average in #Java
trimou Security
Best in #Java
Average in #Java

license License

  • trimou is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
trimou License
Best in #Java
Average in #Java
trimou License
Best in #Java
Average in #Java

buildReuse

  • trimou releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • It has 26429 lines of code, 2322 functions and 482 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
trimou Reuse
Best in #Java
Average in #Java
trimou Reuse
Best in #Java
Average in #Java
Top functions reviewed by kandi - BETA

kandi has reviewed trimou and discovered the below as its top functions. This is intended to give you an instant insight into trimou implemented functionality, and help decide if they suit your requirements.

  • Splits a helper name into an iterator of strings .
    • Initializes the engine properties .
      • Ends a section .
        • Main entry point .
          • Parse the template from the given reader .
            • Searches for a method with the given name .
              • Returns true if the fragment is expired .
                • Collects the result of the async app .
                  • Removes all segments from the given root segment .
                    • Renders the given view .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      trimou Key Features

                      Mustache/handlebars templating engine in Java.

                      Get Started

                      copy iconCopydownload iconDownload
                      <dependency>
                        <groupId>org.trimou</groupId>
                        <artifactId>trimou-core</artifactId>
                        <version>${version.trimou}</version>
                      </dependency>
                      

                      Gradle - compileTestGroovy can't resolve main Application class

                      copy iconCopydownload iconDownload
                      jar {
                          enabled = true
                      }
                      
                      dependencies {
                          compile project(':api').sourceSets.main.output
                          // others
                      }
                      
                      jar {
                          enabled = true
                      }
                      
                      dependencies {
                          compile project(':api').sourceSets.main.output
                          // others
                      }
                      

                      Community Discussions

                      Trending Discussions on trimou
                      • Gradle - compileTestGroovy can't resolve main Application class
                      Trending Discussions on trimou

                      QUESTION

                      Gradle - compileTestGroovy can't resolve main Application class

                      Asked 2019-Jan-07 at 15:25

                      I have a strange issue. Our project has been up and running for 6 years now and some package upgrades were long overdue. App backend is written in Java 8, tests in Java and Groovy and frontend in AngularJS 1.5

                      App consists of 7 modules and whole project structure and build process is setup through gradle build files.

                      In the process of updating libraries versions biggest one was mongodb upgrade from 4.0 and spring upgrade to 5.1.3 and spring_boot version from 1.2.6 to 2.1.1.

                      I know, quite a few major upgrades and thanks to the all the tests we had I managed to change all our code to comply with the changes in new versions of the libraries. All tests are passing. Build of almost all the modules is working like a charm. Except for a module that consists of Groovy test classes. All the tests, when I run them from IntelliJ are passing, there are no compile or build errors.

                      But when I try running gradle build the task testCompileGroovy fails because the import in one of the abstract test specification classes can't be resolved. And it's the import of the main Application class that's needed for classes parameter of @SpringBootTest annotation.

                      Here is the libraries.gradle file with all libraries that we depend on defined...

                      ext {
                      spring_version = "5.1.3.RELEASE"
                      spring_boot_version = "2.1.1.RELEASE"
                      spring_data_mongodb = "2.1.3.RELEASE"
                      groovy_version = "2.4.5"
                      
                      ext.lib = [
                      
                              spring_core                 : "org.springframework:spring-core:$spring_version",
                              spring_context              : "org.springframework:spring-context:$spring_version",
                              spring_context_support      : "org.springframework:spring-context-support:$spring_version",
                              spring_test                 : "org.springframework:spring-test:$spring_version",
                              spring_data_mongodb         : "org.springframework.data:spring-data-mongodb:$spring_data_mongodb",
                              spring_shell                : "org.springframework.shell:spring-shell:1.1.0.RELEASE",
                              spring_webmvc               : "org.springframework:spring-webmvc:$spring_version",
                      
                              spring_web                  : "org.springframework:spring-web$spring_version",
                      
                              spring_boot_test            : "org.springframework.boot:spring-boot-test:2.1.1.RELEASE",
                      
                              spring_boot_starter         : "org.springframework.boot:spring-boot-starter:$spring_boot_version",
                              spring_boot_starter_web     : "org.springframework.boot:spring-boot-starter-web:$spring_boot_version",
                              spring_boot_starter_tomcat  : "org.springframework.boot:spring-boot-starter-tomcat:$spring_boot_version",
                              spring_boot_starter_security: "org.springframework.boot:spring-boot-starter-security:$spring_boot_version",
                              spring_boot_starter_test    : "org.springframework.boot:spring-boot-starter-test:$spring_boot_version",
                              spring_boot_gradle_plugin   : "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version",
                              spring_boot_autoconfigure   : "org.springframework.boot:spring-boot-autoconfigure:$spring_boot_version",
                              spring_boot_logging         : "org.springframework.boot:spring-boot-logging:$spring_boot_version",
                      
                              swager                      : "io.springfox:springfox-swagger2:2.6.1",
                              swager_ui                   : "io.springfox:springfox-swagger-ui:2.6.1",
                      
                              groovy_all                  : "org.codehaus.groovy:groovy-all:$groovy_version",
                              groovy_sql                  : dependencies.create("org.codehaus.groovy:groovy-sql:$groovy_version") {
                                  exclude group: "org.codehaus.groovy"
                              },
                      
                              http_builder                : "org.codehaus.groovy.modules.http-builder:http-builder:0.7.1",
                              httpmime                    : "org.apache.httpcomponents:httpmime:4.3.6",
                              gmongo                      : dependencies.create("com.gmongo:gmongo:1.5") {
                                  exclude group: "org.codehaus.groovy"
                              },
                              postgresql                  : "org.postgresql:postgresql:9.4-1201-jdbc41",
                              bonecp                      : "com.jolbox:bonecp:0.8.0.RELEASE",
                              joda_time                   : "joda-time:joda-time:2.8.2",
                              guava                       : "com.google.guava:guava:18.0",
                              gson                        : "com.google.code.gson:gson:2.8.5",
                              stripe                      : "com.stripe:stripe-java:1.37.0",
                              jackson_annotations         : "com.fasterxml.jackson.core:jackson-annotations:2.4.4",
                              logentries                  : "com.logentries:logentries-appender:1.1.30",
                              hibernate_validator         : "org.hibernate:hibernate-validator:5.4.2.Final",
                              logback_classic             : "ch.qos.logback:logback-classic:1.1.3",
                              commons_lang                : "org.apache.commons:commons-lang3:3.1",
                              commons_io                  : "commons-io:commons-io:2.4",
                              commons_validator           : "commons-validator:commons-validator:1.4.0",
                              httpclient                  : "org.apache.httpcomponents:httpclient:4.5.1",
                              jasypt                      : "org.jasypt:jasypt:1.9.2",
                              jsoup                       : "org.jsoup:jsoup:1.8.3",
                              trimou_core                 : "org.trimou:trimou-core:1.8.2.Final",
                              jackson_core                : "com.fasterxml.jackson.core:jackson-core:2.9.8",
                              jackson_databind            : "com.fasterxml.jackson.core:jackson-databind:2.9.8",
                              jackson_annotations         : "com.fasterxml.jackson.core:jackson-annotations:2.9.8",
                              jackson_datatype_joda       : "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.8",
                              google_api_services_gmail   : dependencies.create("com.google.apis:google-api-services-gmail:v1-rev23-1.19.1") {
                                  exclude group: "com.google.guava"
                              },
                              google_http_client_jackson  : dependencies.create("com.google.http-client:google-http-client-jackson:1.19.0") {
                                  exclude group: "com.fasterxml.jackson.core"
                              },
                              javax_mail                  : "com.sun.mail:javax.mail:1.5.4",
                              dnsjava                     : "dnsjava:dnsjava:2.1.7",
                              email_reply_parser          : "./lib/EmailReplyParser-1.1.jar",
                              salesforce                  : ["com.force.api:force-wsc:31.0.0", "com.force.api:force-partner-api:29.0.0", "com.force.api:force-metadata-api:29.0.0"],
                              authy                       : 'com.authy:authy-java:1.1.0',
                              libphonenumber              : 'com.googlecode.libphonenumber:libphonenumber:7.2.4',
                              hellosign                   : 'com.hellosign:hellosign-java-sdk:4.0.5',
                              awaitility                  : 'com.jayway.awaitility:awaitility:1.7.0',
                      
                      
                              junit                       : "junit:junit:4.12",
                              hamcrest_all                : "org.hamcrest:hamcrest-all:1.3",
                              hamcrest_core               : "org.hamcrest:hamcrest-core:1.3",
                              mockito_core                : "org.mockito:mockito-core:1.10.19",
                              httpmime                    : "org.apache.httpcomponents:httpmime:4.3.6",
                              rest_assured                : dependencies.create("com.jayway.restassured:rest-assured:2.4.1") {
                                  exclude group: "org.codehaus.groovy"
                              },
                              spock_core                  : "org.spockframework:spock-core:1.2-groovy-2.4",
                              spock_spring                : "org.spockframework:spock-spring:1.2-groovy-2.4",
                      
                              apache_pdf                  : "org.apache.pdfbox:pdfbox:2.0.4",
                              google_cloud                : "com.google.cloud:google-cloud-storage:1.35.0"
                      ]}
                      

                      And this is build.gradle file for the tests-api module that is failing.

                      apply plugin: 'groovy'
                      apply plugin: 'java'
                      
                      apply plugin: 'org.springframework.boot'
                      
                      repositories {
                          mavenCentral()
                          maven {
                              url "http://repo.springsource.org/libs-release"
                          }
                      }
                      
                      dependencies {
                          compile project(':api')
                          compile project(':cli')
                      
                          compile lib.groovy_all
                          compile lib.http_builder
                          compile lib.httpmime
                          compile lib.gmongo
                          compile lib.hamcrest_core
                      
                          testCompile lib.groovy_all
                          testCompile lib.junit
                          testCompile lib.spock_core
                          testCompile lib.spock_spring
                          testCompile lib.spring_boot_starter_test
                      }
                      

                      build.gradle for api module looks like this:

                          apply plugin: 'java'
                      apply plugin: 'war'
                      apply plugin: 'org.springframework.boot'
                      
                      
                      buildscript {
                          repositories {
                              maven {
                                  url "http://repo.springsource.org/libs-release"
                              }
                              mavenLocal()
                          }
                          dependencies {
                              classpath lib.spring_boot_gradle_plugin
                          }
                      }
                      
                      repositories {
                          mavenCentral()
                          maven {
                              url "http://repo.springsource.org/libs-release"
                          }
                      }
                      
                      war {
                          baseName = 'buyerdeck-api'
                          version = '2.0'
                      }
                      
                      dependencies {
                          compile project(':backend')
                          compile project(':analytics')
                      
                          compile lib.spring_webmvc
                          compile lib.spring_boot_starter
                          compile lib.spring_boot_starter_web
                          compile lib.spring_boot_starter_tomcat
                          compile lib.spring_boot_starter_security
                          compile lib.jackson_core
                          compile lib.jackson_annotations
                          compile lib.jackson_datatype_joda
                      
                          compile lib.swager
                          compile lib.swager_ui
                          testCompile lib.junit
                          testCompile lib.hamcrest_all
                          testCompile lib.mockito_core
                      }
                      
                      springBoot {
                          mainClassName = "com.buyerdeck.Application"
                      }
                      

                      Aaaaand build.gradle of the backend module:

                      apply plugin: 'java'
                      
                      sourceCompatibility = 1.8
                      targetCompatibility = 1.8
                      
                      repositories {
                          mavenCentral()
                          maven {
                              url "http://repo.springsource.org/libs-release"
                          }
                      }
                      
                      configurations {
                          all*.exclude module: "groovy"
                      }
                      
                      dependencies {
                          compile project(':email')
                      
                          compile lib.spring_core
                          compile lib.spring_context
                          compile lib.spring_context_support
                          compile lib.spring_data_mongodb
                      
                          compile lib.joda_time
                          compile lib.guava
                          compile lib.gson
                          compile lib.stripe
                          compile lib.jackson_core
                          compile lib.jackson_databind
                          compile lib.jackson_annotations
                          compile lib.logentries
                          compile lib.hibernate_validator
                          compile lib.logback_classic
                          compile lib.commons_lang
                          compile lib.commons_io
                          compile lib.commons_validator
                          compile lib.httpclient
                          compile lib.salesforce
                          compile lib.jasypt
                          compile lib.jsoup
                          compile lib.trimou_core
                          compile lib.hellosign
                          compile lib.awaitility
                          compile lib.authy
                          compile lib.libphonenumber
                          compile lib.httpmime
                          compile lib.apache_pdf
                          compile lib.google_cloud
                      
                          testCompile lib.spring_test
                          testCompile lib.spring_boot_test
                          testCompile lib.spring_boot_starter
                          testCompile lib.junit
                          testCompile lib.hamcrest_all
                          testCompile lib.mockito_core
                          testCompile lib.httpmime
                          testCompile lib.rest_assured
                      }
                      
                      task wrapper(type: Wrapper) {
                          gradleVersion = '1.11'
                      }
                      
                      sourceSets {
                          test {
                              java {
                                  srcDir 'src/test/java'
                                  srcDir 'src/test-integration/java'
                              }
                          }
                      }
                      

                      Finally, the class that's throwing the compilation error is ApiSpecification.groovy from tests-api module:

                          package tests.api
                      
                      import com.companyxyz.Application
                      import com.companyxyz.backend.core.tenant.Tenant
                      import com.companyxyz.backend.infrastructure.mongo.MongoSetup
                      import org.bson.types.ObjectId
                      import org.junit.runner.RunWith
                      import org.springframework.beans.factory.annotation.Autowired
                      import org.springframework.beans.factory.annotation.Value
                      import org.springframework.boot.autoconfigure.EnableAutoConfiguration
                      import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer
                      import org.springframework.boot.test.context.SpringBootTest
                      import org.springframework.boot.web.server.LocalServerPort
                      import org.springframework.context.annotation.ComponentScan
                      import org.springframework.context.annotation.Configuration
                      import org.springframework.context.annotation.PropertySource
                      import org.springframework.data.mongodb.core.MongoTemplate
                      import org.springframework.data.mongodb.core.query.Criteria
                      import org.springframework.data.mongodb.core.query.Query
                      import org.springframework.test.context.ContextConfiguration
                      import org.springframework.test.context.junit4.SpringRunner
                      import org.springframework.test.context.web.WebAppConfiguration
                      import spock.lang.Specification
                      
                      @PropertySource("classpath:companyxyz.properties")
                      @SpringBootTest(classes = Application, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = ["server.port:0", "mongo.database:companyxyz-test-api", "email.templates.root.path:../email-templates", "email.enabled:false", "timegate.enabled:true"])
                      abstract class ApiSpecification extends Specification {
                      
                          @LocalServerPort
                          private int serverPort
                      
                          @Value('${mongo.database}')
                          private String dbName
                      
                          @Autowired
                          MongoTemplate mongoTemplate;
                      
                          @Autowired
                          MongoSetup mongoSetup;
                      
                          private static boolean dbCleaned;
                      
                          def setup() {
                              ApiSettings.apiUrl = "http://localhost:$serverPort/api/"
                              ApiSettings.dbName = dbName
                      
                              println "apiurl $ApiSettings.apiUrl"
                              if (!dbCleaned) {
                                  println "Dropping Mongo DB $dbName"
                                  mongoTemplate.getDb().drop();
                                  mongoSetup.ensureIndexes()
                                  dbCleaned = true;
                              }
                              DbExecutor.createMockThingies()
                          }
                      
                          def removeUser(email) {
                              mongoTemplate.remove(Query.query(Criteria.where("email").is(email)), com.companyxyz.backend.core.user.User.class)
                          }
                      
                      
                      }
                      

                      Error is at the line 3:

                      import com.companyxyz.Application

                      Can't resolve the import. testGroovyCompile task simply fails because of unresolved dependency. Running tests directly from classes that extend that class works without any issues.

                      Nothing in the build.gradle file for the module hasn't been changed except that one dependency, needed for spring tests was added, but everything else is the same as before. The module is dependent on other modules but their build files haven't changed much except for needed test dependencies.

                      I've spent hours and hours trying to tackle this but I just can't understand why it is not working. I tried with different gradle versions, without success. Does anyone have any idea what might be the cause to these problems?

                      Sorry for the long post, let me know if I can provide more info.

                      Luka

                      ANSWER

                      Answered 2019-Jan-07 at 15:25

                      The problem is that your api module is a Spring Boot project: by default it will not produce a standard jar but only an executable/fat jar (or war if you have war plugin applied). Even if you add a 'project' dependency compile project(':api') in the tests-api module, Gradle won't be able to provide classes from api module to the classpath of tests-api, because there is no standard jar built from api module (see more details about project dependency type here):

                      A [Project] “lib” dependency is a special form of an execution dependency. It causes the other project to be built first and adds the jar with the classes of the other project to the classpath. It also adds the dependencies of the other project to the classpath.

                      So I see two options in order to solve your issue:

                      1) (PREFERRED) Configure SpringBoot plugin in api module to produce a standard jar

                      build.gradle from api module:

                      jar {
                          enabled = true
                      }
                      

                      See : https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/gradle-plugin/reference/html/#packaging-executable-and-normal

                      2) Create dependency from tests-api to api modules SourceSet:

                      build.gradle from tests-api module:

                      dependencies {
                          compile project(':api').sourceSets.main.output
                          // others
                      }
                      

                      (solution 2 should work, but not tested. Could cause error with api project dependencies not available in tests-api module)

                      Source https://stackoverflow.com/questions/54074903

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install trimou

                      All the artifacts are available in the Maven Central Repository:. Use the MustacheEngineBuilder to build a MustacheEngine - a central point for template management.

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Java Libraries
                      Try Top Libraries by trimou
                      Compare Java Libraries with Highest Support
                      Compare Java Libraries with Highest Quality
                      Compare Java Libraries with Highest Security
                      Compare Java Libraries with Permissive License
                      Compare Java Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.