plugin is not listed

This issue has been created since 2020-10-19.

I was trying to make a caddy plugin from the tutorial mentioned in the docs [https://caddyserver.com/docs/extending-caddy].
Weirdly xcaddy list-modules does not detect my plugin
This is the plugin

package caddyjwt

import "github.com/caddyserver/caddy/v2"

func init() {
	caddy.RegisterModule(Gizmo{})
}

// Gizmo is an example; put your own type here.
type Gizmo struct {
}

// CaddyModule returns the Caddy module information.
func (Gizmo) CaddyModule() caddy.ModuleInfo {
	return caddy.ModuleInfo{
		ID:  "zoo.gizmo",
		New: func() caddy.Module { return new(Gizmo) },
	}
}

The log on stdout

2020/10/19 21:27:18 [INFO] Temporary folder: /tmp/buildenv_2020-10-19-2127.273871167
2020/10/19 21:27:18 [INFO] Writing main module: /tmp/buildenv_2020-10-19-2127.273871167/main.go
2020/10/19 21:27:18 [INFO] Initializing Go module
2020/10/19 21:27:18 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy 
go: creating new go.mod: module caddy
2020/10/19 21:27:18 [INFO] Replace caddyjwt => /home/rohan/go/src/caddyjwt
2020/10/19 21:27:18 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod edit -replace caddyjwt=/home/rohan/go/src/caddyjwt 
2020/10/19 21:27:18 [INFO] Pinning versions
2020/10/19 21:27:18 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2 
go: github.com/caddyserver/caddy/v2 upgrade => v2.2.1
2020/10/19 21:27:19 [INFO] Build environment ready
2020/10/19 21:27:19 [INFO] Building Caddy
2020/10/19 21:27:19 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/rohan/go/src/caddyjwt/caddy -ldflags -w -s -trimpath 
go: found caddyjwt in caddyjwt v0.0.0-00010101000000-000000000000
2020/10/19 21:27:22 [INFO] Build complete: caddy
2020/10/19 21:27:22 [INFO] Cleaning up temporary folder: /tmp/buildenv_2020-10-19-2127.273871167
2020/10/19 21:27:22 [INFO] Running [caddy list-modules]

admin.api.load
admin.api.metrics
caddy.adapters.caddyfile
caddy.listeners.tls
caddy.logging.encoders.console
caddy.logging.encoders.filter
caddy.logging.encoders.filter.delete
caddy.logging.encoders.filter.ip_mask
caddy.logging.encoders.json
caddy.logging.encoders.logfmt
caddy.logging.encoders.single_field
caddy.logging.writers.discard
caddy.logging.writers.file
caddy.logging.writers.net
caddy.logging.writers.stderr
caddy.logging.writers.stdout
caddy.storage.file_system
http
http.authentication.hashes.bcrypt
http.authentication.hashes.scrypt
http.authentication.providers.http_basic
http.encoders.gzip
http.encoders.zstd
http.handlers.acme_server
http.handlers.authentication
http.handlers.encode
http.handlers.error
http.handlers.file_server
http.handlers.headers
http.handlers.map
http.handlers.metrics
http.handlers.push
http.handlers.request_body
http.handlers.reverse_proxy
http.handlers.rewrite
http.handlers.static_response
http.handlers.subroute
http.handlers.templates
http.handlers.vars
http.matchers.expression
http.matchers.file
http.matchers.header
http.matchers.header_regexp
http.matchers.host
http.matchers.method
http.matchers.not
http.matchers.path
http.matchers.path_regexp
http.matchers.protocol
http.matchers.query
http.matchers.remote_ip
http.matchers.vars
http.matchers.vars_regexp
http.reverse_proxy.selection_policies.first
http.reverse_proxy.selection_policies.header
http.reverse_proxy.selection_policies.ip_hash
http.reverse_proxy.selection_policies.least_conn
http.reverse_proxy.selection_policies.random
http.reverse_proxy.selection_policies.random_choose
http.reverse_proxy.selection_policies.round_robin
http.reverse_proxy.selection_policies.uri_hash
http.reverse_proxy.transport.fastcgi
http.reverse_proxy.transport.http
pki
tls
tls.certificates.automate
tls.certificates.load_files
tls.certificates.load_folders
tls.certificates.load_pem
tls.handshake_match.sni
tls.issuance.acme
tls.issuance.internal
tls.issuance.zerossl
tls.stek.distributed
tls.stek.standard

rrnair-98 wrote this answer on 2020-10-21

Since xcaddy just imports our module and calls build, I just copy pasted the main file from caddy/v2 and did it manually.

More Details About Repo
Owner Name caddyserver
Repo Name xcaddy
Full Name caddyserver/xcaddy
Language Go
Created Date 2020-03-21
Updated Date 2022-09-22
Star Count 381
Watcher Count 14
Fork Count 72
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Throwable is empty in FallbackFactory. 2 2022-01-11 2022-09-02
首次打开视频时黑屏有声音,刷新后恢复正常。 2 2021-05-16 2022-07-27
按住ctrl点击弹幕后,显示个人信息加载失败. 1 2021-04-29 2022-07-27
开启"弹幕信息显示框"后,输入弹幕时无法使用ctrl键 2 2021-04-10 2022-07-27
Enhancement: unit.run 0 2021-06-04 2022-08-01
Scam Thread Submission 3 2022-07-24 2022-09-06
UART Transmit DMA. no UART_IRQ_Handler call after transmit complete (it works in debug mode) 2 2021-11-28 2022-08-27
Persistent indexdb storage 6 2020-12-21 2022-09-11
pip install error on macosx:'random' file not found 5 2020-07-22 2022-07-14
error in persisCache function when g:semanticPersistCacheLocation isn't present 0 2021-01-09 2022-09-22
Crashing esquisse due to Error in badgeType: length(col_name) == length(col_type) is not TRUE 2 2021-08-26 2022-09-20
Big TPUs dont work and TPUs don't work with Tensorboard 0 2022-03-08 2022-09-21
SafeFactory only deploys version 1.3.0 0 2022-02-02 2022-08-28
ForceResolution is needed? 4 2020-11-19 2022-09-25
About creating or finding Guitar pre-trained wights for Google Magenta AI music project (DDSP Module) 1 2021-11-05 2022-09-20
Weird stuff getting stored in Storage 6 2021-07-16 2022-09-27
Implementation on V100 2 2022-08-02 2022-09-18
Is it possible to add YAML.FILE as a Value token? 2 2021-05-21 2022-09-18
Evolve toward more modular custom resources and use of CloudFormation private registry 0 2021-10-08 2022-09-19
Add test coverage to 2FA workflow 0 2021-09-07 2022-07-25
SimpleImputer should support String type 14 2021-07-05 2022-09-22
手机端建议添加批量删除功能 0 2021-12-25 2022-01-13
Service 'php' failed to build 1 2021-05-05 2022-09-06
[@mantine/core] Different Tab pages being treated as the same 0 2022-01-22 2022-09-08
For Attack mode - Technology Pod 13 2022-02-10 2022-09-17
Error : Cannot read properties of undefined (reading 'treeBranch') 2 2022-04-18 2022-09-28
Problem with @ConfigMapping 9 2022-05-06 2022-09-10
Quarkus testing with @ParameterizedTest using Optional broken with Java 17 + 18 (xstream) 4 2022-05-06 2022-09-12
rec: add an extra unit test for #11245 0 2022-01-31 2022-08-28
dnsdist: `inConfigCheck()`'s result is reversed 0 2022-01-31 2022-09-01
Bump github.com/multiformats/go-multiaddr from 0.1.2 to 0.2.0 0 2019-12-11 2022-09-09
Mangling properties with decorators 3 2021-09-23 2022-09-23
Flag --requests has been deprecated, has no effect and will be removed in the future. 0 2021-10-07 2022-09-21
Exercism Badge for Staff 0 2022-05-03 2022-09-20
Mentor profile cards can go beyond top of the page 0 2022-05-04 2022-09-19
copy to clipboard in setup 3 2022-05-03 2022-09-24
AddOktaMvc does not use a non-default Authentication Server when AuthenticationServerId is provided 2 2021-06-14 2022-09-29
.NET Core 3.0 RC 1 0 2019-09-16 2022-01-05
v5 release notes draft 5 2021-05-17 2022-09-15
首页banner高度是怎么计算的 1 2020-03-17 2022-01-21
[java] CloseResource: false positive violation with closeNotInFinally=true property 4 2021-10-25 2022-09-23
Jupyter Python3 kernel incomplete and out of date in snap for Ubuntu-21.10 3 2022-04-03 2022-08-21
Use "title" field in skill manifest 0 2021-06-16 2022-09-04
Allow for view to change based off of preference 0 2021-08-17 2022-08-18
pin name missing from pin_meta 2 2021-10-21 2022-09-19
Use inference to fill in missing type parameters 0 2022-07-15 2022-09-22
PowerToys Awake opened multiple processes/threads on exit 1 2022-01-29 2022-02-06
Properly implement delayed EOL wrap in `Terminal::_WriteBuffer` 2 2022-02-08 2022-09-15
Why we didn't consider about use SSA IR to opt the dex ? 1 2021-11-01 2022-09-27
Equality in inheritance hierarchies does not clearly demonstrate EqualityContract 1 2021-09-28 2022-09-15