Closed jesajx closed 3 years ago
I don't think that travis-ci build error is my fault (HTTP 504 when downloading maven-mal-plugin).
If the goal is to simply generate a .jar regardless of what it contains we can just remove the <skipIfEmpty>true</skipIfEmpty>
line from pom.xml and that will generate a jar that has no actual content.
That does sound like a cleaner solution!
I'm fine with any solution as long as we get automatic imports of coreLang into other projects to start working...
@maxwalls What do you think about this?
I think that a better solution is to make sure that icsLang
doesn't need coreLang-0.1.0.jar
. I could achieve this by changing
<dependency>
<groupId>org.mal-lang</groupId>
<artifactId>corelang</artifactId>
<version>0.1.0</version>
</dependency>
into
<dependency>
<groupId>org.mal-lang</groupId>
<artifactId>corelang</artifactId>
<version>0.1.0</version>
<classifier>source</classifier>
</dependency>
in pom.xml
in icsLang
.
That seems very reasonable @maxwalls !
I tried that but it does not seem to work:
rm -rf ~/.m2/repository/org/mal-lang/corelang
mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< org.mal-lang:icslang >------------------------
[INFO] Building icsLang 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from maven.foreseeti.com-release: s3://maven.foreseeti.com/release/org/mal-lang/corelang/0.1.0/corelang-0.1.0.pom
[INFO] File permissions: Private
[INFO] Logged in - maven.foreseeti.com
[INFO] Downloading: s3://maven.foreseeti.com/release/org/mal-lang/corelang/0.1.0/corelang-0.1.0.pom
[INFO] Logged off - maven.foreseeti.com
[INFO] Transfers: 1 Time: 99ms Amount: 0 bytes Throughput: 0.000 bytes/s
Downloading from central: https://repo.maven.apache.org/maven2/org/mal-lang/corelang/0.1.0/corelang-0.1.0.pom
[WARNING] The POM for org.mal-lang:corelang:jar:source:0.1.0 is missing, no dependency information available
Downloading from maven.foreseeti.com-release: s3://maven.foreseeti.com/release/org/mal-lang/corelang/0.1.0/corelang-0.1.0-source.jar
[INFO] File permissions: Private
[INFO] Logged in - maven.foreseeti.com
[INFO] Downloading: s3://maven.foreseeti.com/release/org/mal-lang/corelang/0.1.0/corelang-0.1.0-source.jar
[INFO] Logged off - maven.foreseeti.com
[INFO] Transfers: 1 Time: 63ms Amount: 0 bytes Throughput: 0.000 bytes/s
Downloading from central: https://repo.maven.apache.org/maven2/org/mal-lang/corelang/0.1.0/corelang-0.1.0-source.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.700 s
[INFO] Finished at: 2021-02-17T13:10:24+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project icslang: Could not resolve dependencies for project org.mal-lang:icslang:jar:0.0.1: Could not find artifact org.mal-lang:corelang:jar:source:0.1.0 in maven.foreseeti.com-release (s3://maven.foreseeti.com/release) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
You need to install corelang into your local maven repo before running mvn clean test
in icsLang
:
$ rm -rf ~/.m2/repository/org/mal-lang/{corelang,icslang}
$ cd coreLang/
$ mvn clean install
$ cd ../icsLang/
$ mvn clean test
ok, that does work.
It would be nice to not have to do that though, but I guess that is different issue.
That would require deploying corelang into a public repo somewhere, which is a different issue.
This is a workaround for #30. By adding a java-file we force
coreLang-0.1.0.jar
to be generated.The MAL reference compiler uses (only?)
*.mal
-files as input. This means that any project that uses coreLang along with the reference compiler actually usescoreLang-0.1.0-source.jar
, notcoreLang-0.1.0.jar
. The problem is that maven expects to find acoreLang-0.1.0.jar
when downloading coreLang in order to work properly.Another workaround could perhaps be to copy the
*.mal
-files intocoreLang-0.1.0.jar
as part of the buildprocess, but the above solves the problem for now.You can't build e.g. icsLang with the reference compiler unless you already have
coreLang-0.1.0.jar
installed. Steps to reproduce:export JAVA_HOME=/usr/lib/jvm/java-11-openjdk # setup on archlinux. other OS do this differently.
rm -rf ~/.m2/repository/org/mal-lang/corelang/0.1.0
cd coreLang
mvn install # only installs coreLang-0.1.0-source.jar not coreLang-0.1.0.jar
cd icsLang
mvn test # fails
cp ~/.m2/repository/org/mal-lang/corelang/0.1.0/corelang-0.1.0{-source,}.jar
mvn test # succeeds