My consul-template version:
# ./consul-template -v
consul-template v0.18.0-rc2 (652183d)
I try to use the template below to test node:
{{with node}}{{.Node.Node}} ({{.Node.Address}}){{range .Services}}
{{.Service}} {{.Port}} ({{.Tags | join ","}}){{end}}
{{end}}
I run the shell:
./consul-template -log-level debug -once -consul-addr consul-agent:9500 -template "/home/data/consul/templates/test1.tmpl:/home/data/consul/results/test1"
But after that, test1 has no result. The output debug info looks like below and the shell waiting forever:
2017/01/19 03:17:29.283638 [INFO] consul-template v0.18.0-rc2 (652183d)
2017/01/19 03:17:29.283660 [INFO] (runner) creating new runner (dry: false, once: true)
2017/01/19 03:17:29.284061 [DEBUG] (runner) final config: {"Consul":{"Address":"consul-agent:9500","Auth":{"Enabled":false,"Username":"","Password":""},"Retry":{"Attempts":5,"Backoff":250000000,"Enabled":true},"SSL":{"CaCert":"","CaPath":"","Cert":"","Enabled":false,"Key":"","ServerName":"","Verify":true},"Token":""},"Dedup":{"Enabled":false,"MaxStale":2000000000,"Prefix":"consul-template/dedup/","TTL":15000000000},"Exec":{"Command":"","Enabled":false,"Env":{"Blacklist":null,"Custom":null,"Pristine":false,"Whitelist":null},"KillSignal":2,"KillTimeout":30000000000,"ReloadSignal":null,"Splay":0,"Timeout":0},"KillSignal":2,"LogLevel":"debug","MaxStale":2000000000,"PidFile":"","ReloadSignal":1,"Syslog":{"Enabled":false,"Facility":"LOCAL0"},"Templates":[{"Backup":false,"Command":"","CommandTimeout":30000000000,"Contents":"","Destination":"/home/data/consul/results/test1","Exec":{"Command":"","Enabled":false,"Env":{"Blacklist":[],"Custom":[],"Pristine":false,"Whitelist":[]},"KillSignal":2,"KillTimeout":30000000000,"ReloadSignal":null,"Splay":0,"Timeout":30000000000},"Perms":420,"Source":"/home/data/consul/templates/test1.tmpl","Wait":{"Enabled":false,"Min":0,"Max":0},"LeftDelim":"","RightDelim":""}],"Vault":{"Address":"","Enabled":false,"RenewToken":true,"Retry":{"Attempts":5,"Backoff":250000000,"Enabled":true},"SSL":{"CaCert":"","CaPath":"","Cert":"","Enabled":true,"Key":"","ServerName":"","Verify":true},"UnwrapToken":false},"Wait":{"Enabled":false,"Min":0,"Max":0}}
2017/01/19 03:17:29.284113 [INFO] (runner) creating watcher
2017/01/19 03:17:29.284311 [INFO] (runner) starting
2017/01/19 03:17:29.284334 [DEBUG] (runner) running initial templates
2017/01/19 03:17:29.284347 [INFO] (runner) initiating run
2017/01/19 03:17:29.284394 [DEBUG] (runner) checking template b0b0ddfdf27b9ee0b190f139850272f6
2017/01/19 03:17:29.284811 [DEBUG] (runner) was not watching 1 dependencies
2017/01/19 03:17:29.284847 [DEBUG] (watcher) adding catalog.node
2017/01/19 03:17:29.284869 [DEBUG] (runner) diffing and updating dependencies
2017/01/19 03:17:29.284886 [DEBUG] (runner) watching 1 dependencies
2017/01/19 03:17:29.288772 [INFO] (runner) initiating run
2017/01/19 03:17:29.288796 [DEBUG] (runner) checking template b0b0ddfdf27b9ee0b190f139850272f6
2017/01/19 03:17:29.289160 [DEBUG] (runner) missing data for 1 dependencies
2017/01/19 03:17:29.289183 [DEBUG] (runner) diffing and updating dependencies
2017/01/19 03:17:29.289197 [DEBUG] (runner) catalog.node(8c163f72e7ac) is still needed
2017/01/19 03:17:29.289210 [DEBUG] (runner) watching 1 dependencies
But if I change the template like this:
{{with node "8c163f72e7ac"}}{{.Node.Node}} ({{.Node.Address}}){{range .Services}}
{{.Service}} {{.Port}} ({{.Tags | join ","}}){{end}}
{{end}}
It works fine! Why I must give the node name? In consul-template doc https://github.com/hashicorp/consul-template#node, it said
When called without any arguments then the node for the current agent
is returned.
Any help?
It has been fixed by https://github.com/hashicorp/consul-template/pull/856, after I report an issue for this. Thanks!
Related
I have created a simple spring-boot application with Java 11. Generated build.gradle file is as follow:
plugins {
id 'java'
id 'org.springframework.boot' version '2.1.3.RELEASE'
}
apply plugin: 'io.spring.dependency-management'
group = 'scratches'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Upon executing gradlew build --debug the following error occurs:
09:25:19.482 [LIFECYCLE] [org.gradle.internal.logging.progress.ProgressLoggerFactory] > Configure project :
09:25:19.482 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Configure project :' started
09:25:19.482 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: acquired lock on :
09:25:19.482 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Notify beforeEvaluate listeners of :' started
09:25:19.483 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Notify beforeEvaluate listeners of :'
09:25:19.483 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Notify beforeEvaluate listeners of :' completed
09:25:19.485 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply plugin org.gradle.build-init to root project 'java-11'' started
09:25:19.486 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :init' started
09:25:19.486 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :init'
09:25:19.486 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :init' completed
09:25:19.486 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Apply plugin org.gradle.build-init to root project 'java-11''
09:25:19.487 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply plugin org.gradle.build-init to root project 'java-11'' completed
09:25:19.489 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply plugin org.gradle.wrapper to root project 'java-11'' started
09:25:19.495 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :wrapper' started
09:25:19.496 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :wrapper'
09:25:19.497 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :wrapper' completed
09:25:19.497 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Apply plugin org.gradle.wrapper to root project 'java-11''
09:25:19.497 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply plugin org.gradle.wrapper to root project 'java-11'' completed
09:25:19.499 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply plugin org.gradle.help-tasks to root project 'java-11'' started
09:25:19.500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :help' started
09:25:19.501 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :help'
09:25:19.501 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :help' completed
09:25:19.501 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :projects' started
09:25:19.501 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :projects'
09:25:19.501 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :projects' completed
09:25:19.501 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :tasks' started
09:25:19.502 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :tasks'
09:25:19.502 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :tasks' completed
09:25:19.502 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :properties' started
09:25:19.502 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :properties'
09:25:19.502 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :properties' completed
09:25:19.502 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :dependencyInsight' started
09:25:19.503 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :dependencyInsight'
09:25:19.504 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :dependencyInsight' completed
09:25:19.504 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :dependencies' started
09:25:19.504 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :dependencies'
09:25:19.504 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :dependencies' completed
09:25:19.504 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :buildEnvironment' started
09:25:19.505 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :buildEnvironment'
09:25:19.505 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :buildEnvironment' completed
09:25:19.505 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :components' started
09:25:19.505 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :components'
09:25:19.505 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :components' completed
09:25:19.505 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :model' started
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :model'
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :model' completed
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :dependentComponents' started
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Register task :dependentComponents'
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Register task :dependentComponents' completed
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Apply plugin org.gradle.help-tasks to root project 'java-11''
09:25:19.506 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply plugin org.gradle.help-tasks to root project 'java-11'' completed
09:25:19.507 [INFO] [org.gradle.configuration.project.BuildScriptProcessor] Evaluating root project 'java-11' using build file 'C:\Users\mohdrashidi.mohdzin\Downloads\java-11\build.gradle'.
09:25:19.507 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply script build.gradle to root project 'java-11'' started
09:25:19.514 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for workingDirs, path C:\Users\mohdrashidi.mohdzin\Downloads\java-11\.gradle\5.2.1\vcsMetadata-1\workingDirs.bin, access org.gradle.cache.internal.DefaultCacheAccess#5630d4e
09:25:19.518 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for md-supplier, path C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-supplier\md-supplier.bin, access org.gradle.cache.internal.DefaultCacheAccess#2e1d1d95
09:25:19.518 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Acquiring file lock for cache directory md-supplier (C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-supplier)
09:25:19.521 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on cache directory md-supplier (C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-supplier).
09:25:19.522 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on cache directory md-supplier (C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-supplier).
09:25:19.540 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for md-rule, path C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-rule\md-rule.bin, access org.gradle.cache.internal.DefaultCacheAccess#3cf2f8b9
09:25:19.540 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Acquiring file lock for cache directory md-rule (C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-rule)
09:25:19.543 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on cache directory md-rule (C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-rule).
09:25:19.544 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on cache directory md-rule (C:\Users\mohdrashidi.mohdzin\Workspace\gradle\.gradle\caches\5.2.1\md-rule).
09:25:19.545 [DEBUG] [org.gradle.internal.locking.LockFileReaderWriter] Lockfiles root: C:\Users\mohdrashidi.mohdzin\Downloads\java-11\gradle\dependency-locks
09:25:19.546 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve dependencies of detachedConfiguration1' started
09:25:19.549 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver] Resolving configuration 'detachedConfiguration1'
09:25:19.550 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Creating new in-memory cache for repo 'Gradle Central Plugin Repository' [da9e8315a8be71135c1df434dd1d5d54].
09:25:19.551 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Visiting configuration unspecified:unspecified:unspecified(detachedConfiguration1).
09:25:19.552 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.3.RELEASE using repositories [Gradle Central Plugin Repository]
09:25:19.553 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom
09:25:19.553 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom
09:25:19.556 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Download https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom' started
09:25:19.556 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource: https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom
09:25:19.556 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom
09:25:19.557 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
09:25:19.558 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
09:25:19.558 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://plugins.gradle.org:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 20]
09:25:19.558 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 2][route: {s}->https://plugins.gradle.org:443][total kept alive: 0; route allocated: 1 of 20; total allocated: 1 of 20]
09:25:19.559 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://plugins.gradle.org:443
09:25:19.560 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to plugins.gradle.org/104.18.191.9:443
09:25:19.560 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to plugins.gradle.org/104.18.191.9:443 with timeout 30000
09:25:19.600 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1.3, TLSv1.2, TLSv1.1, TLSv1]
09:25:19.601 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA]
09:25:19.601 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
09:25:19.689 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-2: Shutdown connection
09:25:19.689 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded
09:25:19.689 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 2][route: {s}->https://plugins.gradle.org:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 20]
09:25:19.690 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Download https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom'
09:25:19.690 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Download https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.3.RELEASE/org.springframework.boot.gradle.plugin-2.1.3.RELEASE.pom' completed
09:25:19.697 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder] Flushing resolved configuration data in Binary store in C:\Users\mohdrashidi.mohdzin\AppData\Local\Temp\gradle4127330315613912958.bin. Wrote root 2.
09:25:19.702 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve dependencies of detachedConfiguration1'
09:25:19.703 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve dependencies of detachedConfiguration1' completed
09:25:19.703 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Apply script build.gradle to root project 'java-11''
09:25:19.704 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Apply script build.gradle to root project 'java-11'' completed
09:25:19.704 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 0.197 secs
09:25:19.704 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Notify afterEvaluate listeners of :' started
09:25:19.705 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Notify afterEvaluate listeners of :'
09:25:19.705 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Notify afterEvaluate listeners of :' completed
09:25:19.705 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on :
09:25:19.705 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Configure project :'
09:25:19.705 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Configure project :' completed
09:25:19.705 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Configure build'
09:25:19.706 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Configure build' completed
09:25:19.707 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)
09:25:19.707 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on root.1
09:25:19.708 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:25:19.708 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
09:25:19.708 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:25:19.708 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
09:25:19.708 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file 'C:\Users\mohdrashidi.mohdzin\Downloads\java-11\build.gradle' line: 8
09:25:19.708 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Plugin [id: 'org.springframework.boot', version: '2.1.3.RELEASE'] was not found in any of the following sources:
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.3.RELEASE')
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Searched in the following repositories:
09:25:19.709 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Gradle Central Plugin Repository
09:25:19.710 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:25:19.710 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
09:25:19.710 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
09:25:19.710 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:25:19.711 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
09:25:19.711 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
09:25:19.712 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2s
You need to add:
buildscript {
repositories {
mavenCentral()
}
}
to the top of build.gradle
So, I cannot understand what's going on.
I have a project of this structure:
Aggregator Pom
|
+- Parent Pom
|
+- SubModule 1 (whose parent is "Parent Pom")
|
+- SubModule 2 (whose parent is "SubModule 1")
All are of pom packaging.
I've been fighting the release plugin for days now. I run a release, and it successfully deploys to maven central. However, the versions of Parent Pom, SubModule 1 and SubModule 2 are of the next snapshot version.
It is being executed by TeamCity, but basically it runs something like:
mvn -P sign-artifacts -B release:clean release:prepare --batch-mode -Dtag=0.1.0 -DreleaseVersion=0.1.0 -DdevelopmentVersion=0.2.0-SNAPSHOT -Dscm.tag=0.1.0 -Dproject.rel.{aggregator pom groupId}:{aggregator pom artifactId}=0.1.0 -Dproject.dev.{aggregator pom groupId}:{aggregator pom artifactId}=0.2.0-SNAPSHOT
And then:
mvn -P sign-artifacts -B release:perform -P sign-artifacts
(the "sign-artifacts" profile is responsible for the GPG signing)
In maven central, I see that Parent Pom, SubModule 1 and SubModule 2 are there, their metadata says their version is 0.1.0, but when I download the pom of each, I see the version is 0.2.0-SNAPSHOT.
Any ideas what's wrong, and how to fix?
Thanks in advance,
Ohad
EDIT:
some outputs:
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target && git clone --branch 0.25.0 git#github.com:wix/wix-oss-parents.git /home/builduser/agent03/work/4ae459b9554b762f/target/checkout
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target
...
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout && git fetch git#github.com:wix/wix-oss-parents.git
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target/checkout
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout && git checkout 0.25.0
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target/checkout
...
[INFO] Invoking perform goals in directory /home/builduser/agent03/work/4ae459b9554b762f/target/checkout
[INFO] Executing goals 'deploy'...
[DEBUG] Using ${maven.home} of: '/home/builduser/agent03/tools/maven3_1'.
[DEBUG] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout && /home/builduser/agent03/tools/maven3_1/bin/mvn -B -X -D maven.repo.local=/home/builduser/.m2/repository -s /home/builduser/agent03/temp/buildTmp/release-settings8995574762584519955.xml -D performRelease=true -P artifactory deploy
[INFO] Inspecting build with total of 4 modules...
[INFO] Installing Nexus Staging features:
...
[DEBUG] Goal: org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO] <altStagingDirectory>${altStagingDirectory}</altStagingDirectory>
[INFO] <artifact default-value="${project.artifact}"/>
[INFO] <attachedArtifacts default-value="${project.attachedArtifacts}"/>
[INFO] <autoDropAfterRelease default-value="true">${autoDropAfterRelease}</autoDropAfterRelease>
[INFO] <autoReleaseAfterClose default-value="false">false</autoReleaseAfterClose>
[INFO] <detectBuildFailures default-value="true">${detectBuildFailures}</detectBuildFailures>
[INFO] <keepStagingRepositoryOnCloseRuleFailure>${keepStagingRepositoryOnCloseRuleFailure}</keepStagingRepositoryOnCloseRuleFailure>
[INFO] <keepStagingRepositoryOnFailure>${keepStagingRepositoryOnFailure}</keepStagingRepositoryOnFailure>
[INFO] <mavenSession default-value="${session}"/>
[INFO] <mojoExecution default-value="${mojoExecution}"/>
[INFO] <nexusUrl>https://oss.sonatype.org/</nexusUrl>
[INFO] <offline default-value="${settings.offline}"/>
[INFO] <packaging default-value="${project.packaging}"/>
[INFO] <pluginArtifactId default-value="${plugin.artifactId}"/>
[INFO] <pluginGroupId default-value="${plugin.groupId}"/>
[INFO] <pluginVersion default-value="${plugin.version}"/>
[INFO] <pomFile default-value="${project.file}"/>
[INFO] <serverId>ossrh</serverId>
[INFO] <skipLocalStaging>${skipLocalStaging}</skipLocalStaging>
[INFO] <skipNexusStagingDeployMojo>${skipNexusStagingDeployMojo}</skipNexusStagingDeployMojo>
[INFO] <skipRemoteStaging>${skipRemoteStaging}</skipRemoteStaging>
[INFO] <skipStaging>${skipStaging}</skipStaging>
[INFO] <skipStagingRepositoryClose>${skipStagingRepositoryClose}</skipStagingRepositoryClose>
[INFO] <sslAllowAll default-value="false">${maven.wagon.http.ssl.allowall}</sslAllowAll>
[INFO] <sslInsecure default-value="false">${maven.wagon.http.ssl.insecure}</sslInsecure>
[INFO] <stagingDescription>${stagingDescription}</stagingDescription>
[INFO] <stagingProfileId>${stagingProfileId}</stagingProfileId>
[INFO] <stagingProgressPauseDurationSeconds default-value="3">${stagingProgressPauseDurationSeconds}</stagingProgressPauseDurationSeconds>
[INFO] <stagingProgressTimeoutMinutes default-value="5">${stagingProgressTimeoutMinutes}</stagingProgressTimeoutMinutes>
[INFO] <stagingRepositoryId>${stagingRepositoryId}</stagingRepositoryId>
[INFO] <updateReleaseInfo>${updateReleaseInfo}</updateReleaseInfo>
[INFO] </configuration>
...
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent && git log -n1 --date-order HEAD
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent
[DEBUG] GitLatestRevisionCommandConsumer consumeLine : commit 4875b5de9d40f8a00be37e25d3548755b1f044f4
...
[DEBUG] GitLatestRevisionCommandConsumer consumeLine : [maven-release-plugin] prepare release 0.25.0
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent && git pull git#github.com:wix/wix-oss-parents.git HEAD
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent && git diff --raw 4875b5de9d40f8a00be37e25d3548755b1f044f4
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent
...
[INFO] Executing: /bin/sh -c cd /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent && git log -n1 --date-order HEAD
[INFO] Working directory: /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent
[DEBUG] GitLatestRevisionCommandConsumer consumeLine : commit b5c5fa4e2a0c16d9247ae9261a67aeb4b1f09dda
...
[DEBUG] GitLatestRevisionCommandConsumer consumeLine : [maven-release-plugin] prepare for next development iteration
[INFO] Storing revision in 'scm.revision' project property.
[INFO] Project at revision b5c5fa4e2a0c16d9247ae9261a67aeb4b1f09dda
...
[INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) # wix-oss-parents-parent ---
...
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-gpg-plugin:1.6:sign' with basic configurator -->
[DEBUG] (f) ascDirectory = /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/target/gpg
[DEBUG] (f) defaultKeyring = true
[DEBUG] (f) interactive = false
[DEBUG] (f) keyname = ***
[DEBUG] (f) passphraseServerId = ***
[DEBUG] (f) project = MavenProject: com.wix:wix-oss-parents-parent:0.25.0 # /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/pom.xml
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter#f08fdce
[DEBUG] (f) skip = false
[DEBUG] (f) useAgent = true
[DEBUG] -- end configuration --
[DEBUG] Generating signature for /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/target/wix-oss-parents-parent-0.25.0.pom
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # wix-oss-parents-parent ---
...
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.4:install' with basic configurator -->
[DEBUG] (f) artifact = com.wix:wix-oss-parents-parent:pom:0.25.0
[DEBUG] (f) attachedArtifacts = [com.wix:wix-oss-parents-parent:pom.asc:0.25.0]
[DEBUG] (f) createChecksum = false
[DEBUG] (f) localRepository = id: local
[INFO] url: file:///home/builduser/.m2/repository/
[INFO] layout: none
[DEBUG] (f) packaging = pom
[DEBUG] (f) pomFile = /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/pom.xml
[DEBUG] (s) skip = false
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
...
[INFO] Installing /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/pom.xml to /home/builduser/.m2/repository/com/wix/wix-oss-parents-parent/0.25.0/wix-oss-parents-parent-0.25.0.pom
...
[DEBUG] Installing com.wix:wix-oss-parents-parent/maven-metadata.xml to /home/builduser/.m2/repository/com/wix/wix-oss-parents-parent/maven-metadata-local.xml
[INFO] Installing /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/target/wix-oss-parents-parent-0.25.0.pom.asc to /home/builduser/.m2/repository/com/wix/wix-oss-parents-parent/0.25.0/wix-oss-parents-parent-0.25.0.pom.asc
...
[DEBUG] Installing com.wix:wix-oss-parents-parent/maven-metadata.xml to /home/builduser/.m2/repository/com/wix/wix-oss-parents-parent/maven-metadata-local.xml
...
[INFO] --- nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) # wix-oss-parents-parent ---
...
Configuring mojo 'org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy' with basic configurator -->
[DEBUG] (f) artifact = com.wix:wix-oss-parents-parent:pom:0.25.0
[DEBUG] (f) attachedArtifacts = [com.wix:wix-oss-parents-parent:pom.asc:0.25.0]
[DEBUG] (f) autoDropAfterRelease = true
[DEBUG] (f) autoReleaseAfterClose = true
[DEBUG] (f) detectBuildFailures = true
[DEBUG] (f) mavenSession = org.apache.maven.execution.MavenSession#4ebadd3d
[DEBUG] (f) mojoExecution = org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy {execution: injected-nexus-deploy}
[DEBUG] (f) nexusUrl = https://oss.sonatype.org/
[DEBUG] (f) offline = false
[DEBUG] (f) packaging = pom
[DEBUG] (f) pluginArtifactId = nexus-staging-maven-plugin
[DEBUG] (f) pluginGroupId = org.sonatype.plugins
[DEBUG] (f) pluginVersion = 1.6.7
[DEBUG] (f) pomFile = /home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/pom.xml
[DEBUG] (f) serverId = ossrh
[DEBUG] (f) sslAllowAll = false
[DEBUG] (f) sslInsecure = false
[DEBUG] (f) stagingProgressPauseDurationSeconds = 3
[DEBUG] (f) stagingProgressTimeoutMinutes = 5
[DEBUG] -- end configuration --
...
[INFO] Performing local staging (local stagingDirectory="/home/builduser/agent03/work/4ae459b9554b762f/target/checkout/wix-oss-parents-parent/target/nexus-staging/staging")...
...
Regarding .m2, this is a build agent; it gets a fresh .m2...
Any ideas?
Mmhhh... Something is not so clear to me in your explanation..
First i don't think in this case the project structure is a problem...
The usual behaviour is:
I got a project 1.0-SNAPSHOT..
I release it with the maven release plugin..
This is tagged as 1.0 and committed into the tags folder
Then the trunk\branch version is incresed as 1.1-SNAPSHOT..
So it seems that you are downloading the trunk version and you are checking for the tagged version into the remote repository...
Can this be right?
If not, it is some kind of strange version related to the plugin execution, can you please check the SVN tag, and tell me which version as the pom there, and the comment of the commit with which the tag has been created?
The output of the two commands can also be an help to understand whats going on...
Lat thing, maybe not related, but are you downloading the artifacts into .m2 local repo, can you clean it and try again? It would not be the first time .m2 do something strange :)
After running mvn clean install, when I try to run mvn -pl setup exec:exec I get the following error:
[INFO] Scanning for projects... [INFO] [INFO]
------------------------------------------------------------------------ [INFO] Building sikulixsetup 1.1.1 [INFO]
------------------------------------------------------------------------ [INFO] [INFO] --- exec-maven-plugin:1.3.1:exec (default-cli) #
sikulixsetup --- [debug] RunTimeINIT: global init: entering as:
SETUP [debug] RunTimeINIT: ScreenDevice 0 has (0,0) --- will be
primary Screen(0) [debug] RunTimeINIT: Monitor 0: (0, 0) 1600 x
900 [debug] RunTimeINIT: runs as sikulixsetup-1.1.1-forsetup.jar
in:
C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master\Setup\target
[debug] RunTimeINIT: folder target detected - supposing Maven
project: C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master
***** show environment for SETUP (build 201605140512) user.home: C:\Users\bhowmik user.dir (work dir):
C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master\Setup
user.name: bhowmik java.io.tmpdir: C:\Users\bhowmik\AppData\Local\Temp
running 64Bit on Windows (6.1) in Maven project from some jar java
8-64 version 1.8.0_91-b14 vm 25.91-b14 class 52.0 arch amd64 app data
folder: C:\Users\bhowmik\AppData\Roaming\Sikulix libs folder: null
executing jar:
C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master\Setup\target\sikulixsetup-1.1.1-forsetup.jar
* classpath dump sikulix 0: /C:/Users/bhowmik/Downloads/TEST_NIGHTLY/SikuliX-2014-master/Setup/target/sikulixsetup-1.1.1-forsetup.jar
* classpath dump end
***** show environment end [debug] RunTimeSETUP: global init: leaving [debug] RunTimeSETUP: initAPI: entering [debug]
RunTimeSETUP: resourceList: enter [debug] RunTimeSETUP:
resourceLocation: (class org.sikuli.setup.RunSetup) /Lib/sikuli
[debug] RunTimeSETUP: resourceList: having jar:
jar:file:/C:/Users/bhowmik/Downloads/TEST_NIGHTLY/SikuliX-2014-master/Setup/target/sikulixsetup-1.1.1-forsetup.jar!/Lib/sikuli
[debug] RunTimeSETUP: files exported: 7 from: Lib/sikuli to:
C:\Users\bhowmik\AppData\Roaming\Sikulix\Lib\sikuli [debug]
RunTimeSETUP: initAPI: leaving [debug] RunTimeSETUP: exists libs
folder at:
C:\Users\bhowmik\AppData\Roaming\Sikulix\SikulixLibs_201605140512
[debug] RunTimeSETUP: libs folder empty or has wrong content
[debug] RunTimeSETUP: now exporting libs
* classpath dump 0: /C:/Users/bhowmik/Downloads/TEST_NIGHTLY/SikuliX-2014-master/Setup/target/sikulixsetup-1.1.1-forsetup.jar
* classpath dump end [error] RunTimeSETUP: *** terminating: libs to export not found on above classpath:
/sikulixlibs/windows/libs64 [debug] RunTimeSETUP: final cleanup
[debug] FileManager: deleteFileOrFolder:
C:\Users\bhowmik\AppData\Local\Temp\Sikulix_387398274 [INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 3.279 s [INFO] Finished at:
2016-05-14T11:10:34+05:30 [INFO] Final Memory: 13M/153M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec (default-cli) on
project sikulixsetup: Command execution failed. Process exited with an
error: 1 (Exit value: 1) -> [Help 1 ]
So we have a build with 90+ sub-projects where it's often the case that the directory doesn't perfectly match the project name. In some cases we have empty project-less parent directories and in others the name just doesn't match the directory structure. For example, the sub-directory for project abc-toaster might be named just toaster. The error is:
The base directory of the module ':commons:thingamajig' does not exist:/dev/abc/:commons:thingamajig
...except there is no build.gradle in commons/thingamajig
How can I get Sonar around this? I've tried:
Putting an empty dummy build.gradle in commons/thingamajig - No dice. Same error.
Setting someModule.sonar.projectBaseDir as mentioned here: Sonar properties files
Running a full debug trace to see what pops up. Result: Nothing obvious.
Where am I hosing this up?
Example Update:
allprojects {
sonarqube {
file("$buildDir/classes").mkdirs();
properties {
property "sonar.exclusions", ["**/generated-src/**"]
property "sonar.projectName", "ABC"
property "sonar.projectKey", "$project.group:$project.name"
property "sonar.jacoco.reportPath", "${project.buildDir}/jacoco/test.exec"
property "sonar.projectBaseDir", "${project.rootDir}"
}
}
}
The above gives:
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.batch.scan.ProjectLock
...
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.api.batch.bootstrap.ProjectReactor
...
Caused by: java.lang.IllegalStateException: The base directory of the module ':commons:thingamajig' does not exist: /dev/abc/:commons:thingamajig
Another update:
So I've figured out how to exclude projects that don't actually have any Java in them but get picked up by the Java plugin anyway. This has helped but I'm not out of the woods yet. I've also added this in an attempt to get the real value of the project's directory:
subprojects {
sonarqube {
println "*************"
println "$project.name"
properties.each {
println "$it.key, $it.value"
}
println "Project Dir: $projectDir"
println "Project Dir: $project.projectDir"
println "*************"
}
}
More on this in a bit.... OK... here is some debug level stuff:
15:49:31.419 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':sonarqube'.
15:49:31.512 [INFO] [org.sonarqube.gradle.SonarQubeTask] User cache: /home/user/.sonar/cache
15:49:31.512 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Extract sonar-scanner-api-batch in temp...
15:49:31.512 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Get bootstrap index...
15:49:31.512 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Download: http://localhost:9000/batch_bootstrap/index
15:49:31.518 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Get bootstrap completed
15:49:31.519 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Create isolated classloader...
15:49:31.520 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Start temp cleaning...
15:49:31.521 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Temp cleaning done
15:49:31.521 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Execution getVersion
15:49:31.522 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Execution start
15:49:31.607 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Publish global mode
15:49:31.639 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] cache: /home/user/.sonar/ws_cache/http%3A%2F%2Flocalhost%3A9000/global
15:49:31.653 [INFO] [org.sonarqube.gradle.SonarQubeTask] Load global repositories
15:49:31.730 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] GET 200 http://localhost:9000/batch/global | time=75ms
15:49:31.761 [INFO] [org.sonarqube.gradle.SonarQubeTask] Load global repositories (done) | time=109ms
15:49:31.778 [INFO] [org.sonarqube.gradle.SonarQubeTask] User cache: /home/user/.sonar/cache
15:49:32.035 [INFO] [org.sonarqube.gradle.SonarQubeTask] Load plugins index
15:49:32.036 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] GET 200 http://localhost:9000/deploy/plugins/index.txt | time=1ms
15:49:32.037 [INFO] [org.sonarqube.gradle.SonarQubeTask] Load plugins index (done) | time=2ms
15:49:32.037 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Load plugins
15:49:32.041 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Load plugins (done) | time=4ms
15:49:32.048 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] API compatibility mode is enabled on plugin C# [csharp] (built with API lower than 5.2)
15:49:32.048 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] API compatibility mode is enabled on plugin Java [java] (built with API lower than 5.2)
15:49:32.048 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] API compatibility mode is enabled on plugin SVN [scmsvn] (built with API lower than 5.2)
15:49:32.048 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] API compatibility mode is enabled on plugin Git [scmgit] (built with API lower than 5.2)
15:49:32.048 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] API compatibility mode is enabled on plugin JavaScript [javascript] (built with API lower than 5.2)
15:49:32.092 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Plugins:
15:49:32.092 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] * C# 4.4 (csharp)
15:49:32.092 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] * Java 3.10 (java)
15:49:32.092 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] * SVN 1.2 (scmsvn)
15:49:32.092 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] * Git 1.0 (scmgit)
15:49:32.092 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] * JavaScript 2.10 (javascript)
15:49:32.099 [INFO] [org.sonarqube.gradle.SonarQubeTask] Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
15:49:32.099 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Work directory: /development/eas/build/sonar
15:49:32.099 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Execution getVersion
15:49:32.099 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Execution execute
15:49:32.237 [INFO] [org.sonarqube.gradle.SonarQubeTask] Process project properties
15:49:32.244 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':sonarqube'
15:49:32.244 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :sonarqube FAILED
15:49:32.244 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :sonarqube (Thread[Daemon worker Thread 22,5,main]) completed. Took 5.151 secs.
15:49:32.244 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 22,5,main]] finished, busy: 24.352 secs, idle: 0.053 secs
15:49:32.245 [ERROR] [org.gradle.BuildExceptionReporter]
15:49:32.245 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:49:32.245 [ERROR] [org.gradle.BuildExceptionReporter]
15:49:32.245 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
15:49:32.245 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarqube'.
Could be a missing or incorrect property if I'm reading this correctly. Is there a better way for me to dump these so I can check em?
OK, figured that out too:
gradle sonarqube -DsonarRunner.dumpToFile=out.properties
Nothing obvious in there though. I see where the project is failing but the value set for the base directory seems correct.
OK here is something really weird. If I run the above, I get:
BUILD SUCCESSFUL
...especially since it was not successful as far as I can tell.
OK I just found these and I've updated the debug level stuff:
property "sonar.verbose", "true"
property "sonar.log.level", "TRACE"
I still don't see anything pertinent there though.
sonarqube {
properties {
property "sonar.exclusions", "src/AbstractData.java,src/preprocessor/*.java,src/Service.java"
}
}
It's Worked for me, Try
I'm trying to use JGitflow to create a release for my project. Unfortunately, when I run mvn jgitflow:release-finish, I get the following error:
Unable to find resource 'org.jorlib:jorlib-core:jar:1.0' in repository central (http://repo1.maven.org/maven2)
[WARNING] The dependency: org.jorlib:jorlib-core:jar:1.0 can't be resolved but has been found in the reactor.
I'm not sure how to resolve this. First I ran: mvn jgitflow:release-start which reported "Build Successfull". The result looks correct:
jkinable#daedalus:~/workspace/javaIDEA/jORLib/jorlib$ git branch -avv
development 07e4c1f [origin/development: ahead 3] updating poms for 1.1-SNAPSHOT development
master f3240f9 [origin/master] Updated pom.xml
*release/1.0 f3240f9 Updated pom.xml
Next I ran mvn jgitflow:release-finish which fails. It seems that it tries to download jorlib-core-1.0.jar but that is the file it is supposed to compile. Digging deeper into this, I ran mvn jgitflow:release-finish -e -X > ~/mygitflow.log
Here is part of the result:
[INFO] Building JORLib - Parent
[INFO] task-segment: [jgitflow:release-finish] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[DEBUG] org.jorlib:jorlib:pom:1.0-SNAPSHOT (selected for null)
[DEBUG] org.jorlib:jorlib-core:jar:1.0-SNAPSHOT (selected for null)
[DEBUG] junit:junit:jar:4.12:test (selected for test)
[DEBUG] Retrieving parent-POM: org.hamcrest:hamcrest-parent:pom:1.3 for project: null:hamcrest-core:jar:null from the repository.
[DEBUG] org.hamcrest:hamcrest-core:jar:1.3:test (selected for test)
[DEBUG] Retrieving parent-POM: org.jgrapht:jgrapht:pom:0.9.0 for project: null:jgrapht-core:jar:null from the repository.
[DEBUG] Adding managed dependencies for unknown:jgrapht-core
[DEBUG] org.jgrapht:jgrapht-core:jar:0.9.0
[DEBUG] org.jgrapht:jgrapht-ext:jar:0.9.0
[DEBUG] org.jgrapht:jgrapht-demo:jar:0.9.0
[DEBUG] xmlunit:xmlunit:jar:1.3:test
[DEBUG] junit:junit:jar:4.10:test
[DEBUG] org.jgrapht:jgrapht-core:jar:0.9.0:compile (selected for compile)
[DEBUG] Retrieving parent-POM: com.google.guava:guava-parent:pom:14.0.1 for project: null:guava:bundle:null from the repository.
[DEBUG] com.google.guava:guava:jar:14.0.1:compile (selected for compile)
[DEBUG] Retrieving parent-POM: ch.qos.logback:logback-parent:pom:0.9.28 for project: null:logback-classic:jar:null from the repository.
[DEBUG] Adding managed dependencies for unknown:logback-classic
[DEBUG] ch.qos.logback:logback-core:jar:0.9.28
[DEBUG] ch.qos.logback:logback-core:test-jar:tests:0.9.28
[DEBUG] ch.qos.logback:logback-classic:jar:0.9.28
[DEBUG] ch.qos.logback:logback-access:jar:0.9.28
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1
[DEBUG] janino:janino:jar:2.5.10
[DEBUG] org.codehaus.groovy:groovy-all:jar:1.7.2
[DEBUG] javax.mail:mail:jar:1.4
[DEBUG] dom4j:dom4j:jar:1.6.1
[DEBUG] hsqldb:hsqldb:jar:1.8.0.7
[DEBUG] com.h2database:h2:jar:1.2.132
[DEBUG] postgresql:postgresql:jar:8.4-701.jdbc4
[DEBUG] mysql:mysql-connector-java:jar:5.1.9
[DEBUG] org.apache.tomcat:catalina:jar:6.0.20
[DEBUG] org.mortbay.jetty:jetty:jar:6.1.1
[DEBUG] org.eclipse.jetty:jetty-server:jar:7.0.1.v20091125
[DEBUG] org.mortbay.jetty:servlet-api-2.5:jar:6.1.1
[DEBUG] org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.0
[DEBUG] javax.servlet:servlet-api:jar:2.5
[DEBUG] org.scala-lang:scala-library:jar:2.7.7
[DEBUG] ch.qos.logback:logback-classic:jar:0.9.28:compile (selected for compile)
[DEBUG] Adding managed dependencies for unknown:logback-core
[DEBUG] ch.qos.logback:logback-core:jar:0.9.28
[DEBUG] ch.qos.logback:logback-core:test-jar:tests:0.9.28
[DEBUG] ch.qos.logback:logback-classic:jar:0.9.28
[DEBUG] ch.qos.logback:logback-access:jar:0.9.28
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1
[DEBUG] janino:janino:jar:2.5.10
[DEBUG] org.codehaus.groovy:groovy-all:jar:1.7.2
[DEBUG] javax.mail:mail:jar:1.4
[DEBUG] dom4j:dom4j:jar:1.6.1
[DEBUG] hsqldb:hsqldb:jar:1.8.0.7
[DEBUG] com.h2database:h2:jar:1.2.132
[DEBUG] postgresql:postgresql:jar:8.4-701.jdbc4
[DEBUG] mysql:mysql-connector-java:jar:5.1.9
[DEBUG] org.apache.tomcat:catalina:jar:6.0.20
[DEBUG] org.mortbay.jetty:jetty:jar:6.1.1
[DEBUG] org.eclipse.jetty:jetty-server:jar:7.0.1.v20091125
[DEBUG] org.mortbay.jetty:servlet-api-2.5:jar:6.1.1
[DEBUG] org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.0
[DEBUG] javax.servlet:servlet-api:jar:2.5
[DEBUG] org.scala-lang:scala-library:jar:2.7.7
[DEBUG] ch.qos.logback:logback-core:jar:0.9.28:compile (selected for compile)
[DEBUG] Retrieving parent-POM: org.slf4j:slf4j-parent:pom:1.6.1 for project: org.slf4j:slf4j-api:jar:null from the repository.
[DEBUG] Adding managed dependencies for org.slf4j:slf4j-api
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1
[DEBUG] org.slf4j:slf4j-jdk14:jar:1.6.1
[DEBUG] log4j:log4j:jar:1.2.16
[DEBUG] ch.qos.cal10n:cal10n-api:jar:0.7.4
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1:compile (selected for compile)
[DEBUG] ch.qos.logback:logback-core:jar:0.9.28:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1:compile (selected for compile)
[DEBUG] WARNING: A dependency of the current project (or of one the plugins used in its build) was found in the reactor,
but had not been built at the time it was requested. It will be resolved from the repository instead.
Current Project: JORLib - Demo
Requested Dependency: org.jorlib:jorlib-core:jar:1.0-SNAPSHOT
NOTE: You may need to run this build to the 'compile' lifecycle phase, or farther, in order to build the dependency artifact.
The module jorlib-demo depends on jorlib-core, so it must first compile jorlib-core before it compiles jorlib-demo. For some reason this doesn't happen. As a result, it searches for jorlib-core in some external depository and fails eventually because it couldn't find it.
My parent pom: parent pom
The pom in jorlib-core: pom jorlib-core
The pom in jorlib-demo: pom jorlib-demo
It turns out that this problem is caused by my Maven version. My system runs Java 1.8.0_45 and Apache Maven 2.2.1 (rdebian-8). At the time of writing, the latter Maven version is shipped by default with the latest Ubuntu LTS (14.04.2) release. I have now upgraded to Apache Maven 3.2.1. After upgrading to Maven 3, I did run into the following error message while executing jgitflow:release-finish:
Error: JAVA_HOME is not defined correctly.
We cannot execute /usr/lib/jvm/java-8-oracle/bin/java/bin/java
This effectively prohibited the code from being compiled. Notice the weird bin/java/bin/java part. I double checked my $JAVA_HOME which correctly pointed to /usr/lib/jvm/java-8-oracle/. A solution to this issue can be found here: Having JAVA_HOME inconsistency issue with maven
I simply created a file called .mavenrc in my home folder which contained: export JAVA_HOME=/usr/lib/jvm/java-8-oracle
Now the Jgitflow plugin is working well.