This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-28
Channels
Hey all, I want to export my project as a lib. How can I set which namespaces to be exported? In the docs I could only find exporting symbols in namespaces https://shadow-cljs.github.io/docs/UsersGuide.html#_module_exports
CLJS libs are not built and published as source only, so there are no options for shadow-cljs since it has nothing to do
best to use deps.edn or leiningen for that, assuming you mean maven dependencies. npm you just use npm
Hi again, I have successfully configured deps.edn and I could see that the package has been downloaded both in console and in my m2
folder.
I'm having difficulties to import from the package tho.
I have built it with maven with the following pom.xml:
...
<groupId>io.acme</groupId>
<artifactId>lib</artifactId>
<version>1.0.0-SNAPSHOT</version>
...
I have set a variable name VARIABLE
in the ns
lib
.
I have tried the following, and none worked:
:require
• [io.acme.lib :refer [VARIABLE]]
• [io.acme]
• [lib]
It's all failed with "the required namespace is not available".
I think that I might have forgot something in the build maybe?I guess you can list the contents of the jar via jar -tvf the-actual.jar
and find the namespaces that way?
0 Tue Oct 31 10:58:00 IST 2023 META-INF/
128 Tue Oct 31 10:57:58 IST 2023 META-INF/MANIFEST.MF
0 Tue Oct 31 10:58:00 IST 2023 META-INF/maven/
0 Tue Oct 31 10:58:00 IST 2023 META-INF/maven/io.acme/
0 Tue Oct 31 10:58:00 IST 2023 META-INF/maven/io.acme/lib/
970 Tue Oct 31 10:57:48 IST 2023 META-INF/maven/io.acme/lib/pom.xml
116 Tue Oct 31 10:58:00 IST 2023 META-INF/maven/io.acme/lib/pom.properties
I understand. Can you help me find what did I do wrong?
I built it using the following pom.xml
<project xmlns=""
xmlns:xsi=""
xsi:schemaLocation=" ">
<modelVersion>4.0.0</modelVersion>
<groupId>io.acme</groupId>
<artifactId>lib</artifactId>
<version>1.0.0-SNAPSHOT</version>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</project>
and settings xml:
<settings xmlns=""
xmlns:xsi=""
xsi:schemaLocation=" ">
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
sorry I never published a library using only maven, and have no clue what that would look like. to me it looks like there are no source paths included. can't tell you how to get that though.
:source-paths ["src/main"]
lein will take the files found in that dir and put them into the jar
yea just found about it...https://www.baeldung.com/maven-add-src-directories
By default, Maven uses the /project-path/src/main/java directory as the only source directory.
I'll probably transfer to lein
soon tho
Thanks again
When using lein
to deploy to a maven repo, do I need to duplicate the deps from deps.edn?