Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to build with ./mvnw clean install fails #123

Closed
aptly-io opened this issue Sep 6, 2020 · 12 comments
Closed

Trying to build with ./mvnw clean install fails #123

aptly-io opened this issue Sep 6, 2020 · 12 comments
Labels

Comments

@aptly-io
Copy link

aptly-io commented Sep 6, 2020

Hello,

I wonder how I have to build the jar/war?
In old issues I see that there might have been a Gradle build in the past?
But there are no build.gradle files (anymore?).
Maybe my environment needs some specific setup?
If so, could it be described in the README.md how to build?

I see this error messages appear when running ./mvnw clean install in the top-level directory

... [removed output that indicates no issues]
[INFO] --- kotlin-maven-plugin:1.4.0:kapt (kapt) @ acrarium ---
[INFO] Applied plugin: 'spring'
[INFO] Applied plugin: 'jpa'
[INFO] Applied plugin: 'all-open'
[INFO] Applied plugin: 'no-arg'
[ERROR] /Users/franchan/dev/acrarium/Acrarium/acrarium/target/kaptStubs/compile/com/faendir/acra/ui/view/report/ReportView.java:25: error: cannot access PrettyTime
    private final org.xbib.time.pretty.PrettyTime prettyTime = null;
                                      ^
  bad class file: /Users/franchan/.m2/repository/org/xbib/time/2.1.0/time-2.1.0.jar(org/xbib/time/pretty/PrettyTime.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[ERROR] /Users/franchan/dev/acrarium/Acrarium/acrarium/src/main/kotlin/com/faendir/acra/model/view/Queries.kt: (18, 31) Unresolved reference: QApp
[ERROR] /Users/franchan/dev/acrarium/Acrarium/acrarium/src/main/kotlin/com/faendir/acra/model/view/Queries.kt: (19, 31) Unresolved reference: QBug
[ERROR] /Users/franchan/dev/acrarium/Acrarium/acrarium/src/main/kotlin/com/faendir/acra/model/view/Queries.kt: (20, 31) Unresolved reference: QReport
[ERROR] /Users/franchan/dev/acrarium/Acrarium/acrarium/src/main/kotlin/com/faendir/acra/model/view/Queries.kt: (21, 31) Unresolved reference: QStacktrace
[ERROR] /Users/franchan/dev/acrarium/Acrarium/acrarium/src/main/kotlin/com/faendir/acra/model/view/Queries.kt: (31, 46) Unresolved reference: QBug
... [several similar errors]
@F43nd1r
Copy link
Owner

F43nd1r commented Sep 6, 2020

you're probably running on JDK 8. I use 14, but 11+ should work.

@F43nd1r
Copy link
Owner

F43nd1r commented Sep 6, 2020

Yes, I was using gradle because I prefer it over maven. But then the (unofficial) vaadin gradle plugin went paid so I had to go to maven. There is no gradle build anymore.

@aptly-io
Copy link
Author

aptly-io commented Sep 6, 2020

Hello,

I got further with ./mvnw clean install -DskipTests after installing java11
I build a docker image but when I run this, I see the following in the logs:

java.lang.RuntimeException: Unable to initialize com.vaadin.flow.spring.VaadinServletContextInitializer$VaadinAppShellContextListener
...
Caused by: java.lang.IllegalStateException: Running project in development mode with no access to folder '/Users/franchan/dev/acrarium/Acrarium/acrarium'.
Build project in production mode instead, see https://vaadin.com/docs/v15/flow/production/tutorial-production-mode-basic.html

Maybe I need to pass another option? Or might I have to use, like you, the JDK 14?

PS without the skipTests I get a failure due to a missing license for vaadin

Caused by: java.lang.RuntimeException: Unable to validate subscription. Please go to https://vaadin.com/pro/validate-license to check that your subscription is active. You can also find instructions for installing the license on a build server at https://vaadin.com/pro/validate-license

@aptly-io
Copy link
Author

aptly-io commented Sep 6, 2020

Anybody looking for the same:

./mvnw clean package -Pproduction -DskipTests
cd acrarium
docker build -t<user>/acrarium:<tag>

@aptly-io aptly-io closed this as completed Sep 6, 2020
@aptly-io aptly-io reopened this Apr 3, 2021
@aptly-io
Copy link
Author

aptly-io commented Apr 3, 2021

It has been some time since I tried to build Acrarium myself.
I'm using java 11 and run into an authorization error for https://maven.pkg.github.com/f43nd1r/*): Not authorized
Is there a way to get around this?

This is the console ouput:

francis@francis-NUC7i7BNH:~/dev/projects/acrarium-x/clone/Acrarium$ ./mvnw  clean package -Pproduction -DskipTests
Found .mvn/wrapper/maven-wrapper.jar
/home/francis/dev/projects/acrarium-x/clone/Acrarium
Takari Maven Wrapper 0.5.5
Downloading Maven binary from https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] parent                                                             [pom]
[INFO] Acrarium                                                           [jar]
[INFO] 
[INFO] -------------------------< com.faendir:parent >-------------------------
[INFO] Building parent 1.2.2-SNAPSHOT                                     [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ parent ---
[INFO] 
[INFO] --- flatten-maven-plugin:1.2.7:clean (flatten.clean) @ parent ---
[INFO] Deleting /home/francis/dev/projects/acrarium-x/clone/Acrarium/.flattened-pom.xml
[INFO] 
[INFO] --- flatten-maven-plugin:1.2.7:flatten (flatten) @ parent ---
[INFO] Generating flattened POM of project com.faendir:parent:pom:1.2.2-SNAPSHOT...
[INFO] 
[INFO] ------------------------< com.faendir:acrarium >------------------------
[INFO] Building Acrarium 1.2.2-SNAPSHOT                                   [2/2]
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from github: https://maven.pkg.github.com/f43nd1r/*/org/webjars/npm/mobile-drag-drop/maven-metadata.xml
[WARNING] Could not transfer metadata org.webjars.npm:mobile-drag-drop/maven-metadata.xml from/to github (https://maven.pkg.github.com/f43nd1r/*): Not authorized
Downloading from github: https://maven.pkg.github.com/f43nd1r/*/com/faendir/liquibase/liquibase-kotlin-dsl/3.1.0/liquibase-kotlin-dsl-3.1.0.pom
[WARNING] Failure to transfer org.webjars.npm:mobile-drag-drop/maven-metadata.xml from https://maven.pkg.github.com/f43nd1r/* was cached in the local repository, resolution will not be reattempted until the update interval of github has elapsed or updates are forced. Original error: Could not transfer metadata org.webjars.npm:mobile-drag-drop/maven-metadata.xml from/to github (https://maven.pkg.github.com/f43nd1r/*): Not authorized
[WARNING] Failure to transfer org.webjars.npm:mobile-drag-drop/maven-metadata.xml from https://maven.pkg.github.com/f43nd1r/* was cached in the local repository, resolution will not be reattempted until the update interval of github has elapsed or updates are forced. Original error: Could not transfer metadata org.webjars.npm:mobile-drag-drop/maven-metadata.xml from/to github (https://maven.pkg.github.com/f43nd1r/*): Not authorized
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for parent 1.2.2-SNAPSHOT:
[INFO] 
[INFO] parent ............................................. SUCCESS [  0.637 s]
[INFO] Acrarium ........................................... FAILURE [  1.882 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.904 s
[INFO] Finished at: 2021-04-03T21:22:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project acrarium: Could not resolve dependencies for project com.faendir:acrarium:jar:1.2.2-SNAPSHOT: Failed to collect dependencies at com.faendir.liquibase:liquibase-kotlin-dsl:jar:3.1.0: Failed to read artifact descriptor for com.faendir.liquibase:liquibase-kotlin-dsl:jar:3.1.0: Could not transfer artifact com.faendir.liquibase:liquibase-kotlin-dsl:pom:3.1.0 from/to github (https://maven.pkg.github.com/f43nd1r/*): Not authorized -> [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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :acrarium
francis@francis-NUC7i7BNH:~/dev/projects/acrarium-x/clone/Acrarium$ 

@aptly-io
Copy link
Author

aptly-io commented Apr 4, 2021

I read through aforementioned link but it does not help me. I made me a ~/.m2/settings.xml, inside added a github Personal Access Token, updated the <url>https://maven.pkg.github.com/f43nd1r/*</url>. Should that do it?
Also tried ./mvnw install thinking this would 'install' the package.

Still running into the authorization issue (code 400)
Failed to execute goal on project acrarium: Could not resolve dependencies for project com.faendir:acrarium:jar:1.2.2-SNAPSHOT: Failed to collect dependencies at com.faendir.liquibase:liquibase-kotlin-dsl:jar:3.1.0: Failed to read artifact descriptor for com.faendir.liquibase:liquibase-kotlin-dsl:jar:3.1.0: Could not transfer artifact com.faendir.liquibase:liquibase-kotlin-dsl:pom:3.1.0 from/to github (https://maven.pkg.github.com/f43nd1r/*): Failed to transfer file https://maven.pkg.github.com/f43nd1r/*/com/faendir/liquibase/liquibase-kotlin-dsl/3.1.0/liquibase-kotlin-dsl-3.1.0.pom with status code 400

Or also
Could not transfer metadata org.webjars.npm:mobile-drag-drop/maven-metadata.xml from/to github (https://maven.pkg.github.com/f43nd1r/*): Not authorized

PS since it's a public repo, is the purpose for package download access control, tracking who tries to manually build? Note I've not intention to publish/delete packages ...

@F43nd1r
Copy link
Owner

F43nd1r commented Apr 4, 2021

It's just a dependency I haven't bothered to publish anywhere else.

@F43nd1r
Copy link
Owner

F43nd1r commented Apr 4, 2021

Make sure your access token has at least read:packages access level.

@aptly-io
Copy link
Author

aptly-io commented Apr 4, 2021

@F43nd1r thanks. It was set but for some reason that does not work for me. What's odd is that the github UI shows a 'never used' next to it?
I succeeded building by lowering the version number for liquibase to 3.0.0 in acrarium/pom.xml. Not optimal ...

@F43nd1r
Copy link
Owner

F43nd1r commented Apr 4, 2021

At some point I'll probably set up publish to maven central for that libary. Or github removes the authentication requirement, as is apparently in work.
FWIW I had to follow the tutorial to the letter to make it work, including the profile setup.

I already miss jcenter and it isn't even quite gone yet.

@aptly-io
Copy link
Author

aptly-io commented Apr 5, 2021

@F43nd1r thank you for the explanation for the choice of the package manager and its limitation with passwords!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants