gwtboot / gwt-boot-samples

GWT Boot: Samples to check all the Starters
Apache License 2.0
40 stars 23 forks source link

Is the artifact published? #6

Closed baldram closed 6 years ago

baldram commented 6 years ago

Hello gwt-boot founders!

This is a very interesting project. Thanks for publishing it. Unluckily it's hard to start using it ;-)

I would like to use gwt-boot-starter-parent for examples of my library https://github.com/baldram/gwt-leaflet-d3, to reduce the size of example GWT projects being a part of my library's repo.

Unfortunately something went wrong. It looks like the artifact is not published: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT

Do I need to add anything like a custom repository to access it? Then it is not documented. I mean something like popular sonatype's one for snapshots.

    <repositories>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

If it is supposed to be accessible from Maven Central, then something is wrong for sure.

Do a simple check. Clone gwt-boot-samples repository. Go inside a folder and call: $ mvn clean

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-basic:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-basic-with-spring-boot:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent-with-spring-boot:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-collection:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-elemento-core:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-elemento-template:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-rxgwt:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-ui-gwtbootstrap3:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-ui-gwtmaterial:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-ui-domino:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 13
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-ui-domino-dagger2:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
[FATAL] Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-ui-vue-gwt:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10
 @ 
[ERROR] The build could not read 11 projects -> [Help 1]
[ERROR]   
[ERROR]   The project com.github.gwtboot:gwt-boot-sample-basic:1.0.0-SNAPSHOT (/home/msx/workspace/java/gwt/gwt-boot-samples/gwt-boot-sample-basic/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-basic:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10 -> [Help 2]
[
#and so on...
#and so on...
#and so on...

I will have the same issue following steps from READ.me to use gwt-boot-starter with own project.

PS: In your case it may work if you have a local POM in your .m2 folder.

lofidewanto commented 6 years ago

Hmm actually all the Snapshots dependencies are uploaded into Sonatype repo, see

https://oss.sonatype.org/content/repositories/snapshots/com/github/gwtboot/

lofidewanto commented 6 years ago

I'll check whether we need those items "Snapshots". Because sofar I did not need to use them explicitly...

lofidewanto commented 6 years ago

Do you use an internal Nexus repo as a proxy?

baldram commented 6 years ago

No, just in the simplest way without any proxy or internal Nexus. The plan was to use it for other public Github repo.

steps to reproduce:

$ git clone https://github.com/gwtboot/gwt-boot-samples.git
$ cd gwt-boot-samples/
$ mvn clean

Errors like mentioned above...

lofidewanto commented 6 years ago

This is wyrd, because I have Travis installed for that repo: https://travis-ci.org/gwtboot/gwt-boot-samples

... and it works normally...

lofidewanto commented 6 years ago

I checked the gwtboot-module and it already contains all the needed Snapshots repositories, see:

https://github.com/gwtboot/gwt-boot-modules/blob/master/pom.xml

So, no need to add those repos manually...

lofidewanto commented 6 years ago

Could you please turn on your debug mode for Maven?

With... -X

Also please check your settings.xml file, whether you define other repos which overwrite the correct repos.

baldram commented 6 years ago

I have no settings.xml. Just default. Should I have something defined to use this repo? For other stuff or libs I do not need to do anything specific. In some cases I extend repositories of the pom.xml by adding sonatype or jitpack. But in this case nothing was required according to documentation... If something should be added, could you please clarify.

mvn clean result: mvn-clean-result.txt

baldram commented 6 years ago

I also see that Travis handled it properly. You mentioned that https://github.com/gwtboot/gwt-boot-modules/blob/master/pom.xml contains all Snapshots repositories already. I checked, this is fine. The problem is only with "samples" project.

So gwt-boot-modules works:

$ git clone https://github.com/gwtboot/gwt-boot-modules.git`
$ cd gwt-boot-modules/
$ mvn clean

...gives successfully:

[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/sonatype/plugins/nexus-staging-maven-plugin/1.6.8/nexus-staging-maven-plugin-1.6.8.pom
Downloaded: https://repo.maven.apache.org/maven2/org/sonatype/plugins/nexus-staging-maven-plugin/1.6.8/nexus-staging-maven-plugin-1.6.8.pom (12 KB at 19.2 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/sonatype/nexus/maven/nexus-staging/1.6.8/nexus-staging-1.6.8.pom
...
...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.554 s
[INFO] Finished at: 2018-08-25T17:07:43+02:00
[INFO] Final Memory: 23M/392M

In case of gwt-boot-samples

$ git clone https://github.com/gwtboot/gwt-boot-samples.git
$ cd gwt-boot-samples/
$ mvn clean

...gives errors like mentioned in https://github.com/gwtboot/gwt-boot-samples/issues/6#issuecomment-415962333.

If it requires snapshot repository, interesting is that at the bottom of gwt-boot-samples/pom.xml is:

    <repositories>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

So maybe some additional snapshot repository is required for gwt-boot-samples project? Or at least the one which will "open" the way to gwt-boot-modules/blob/master/pom.xml to find all remaining repositories, or so.

But something is weird and as you see at least one of gwtboot related GitHub projects has worked for me.

EDIT (solution/workaround): Yes, it's about missing repositories in gwt-boot-samples project. The workaround was to add the following (copied from pom.xml of gwt-boot-modules) to each samples subproject's xml.

<repositories>
        <repository>
            <id>sonatype-snapshots</id>
            <name>Sonatype Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>

So for instance I extended gwt-boot-sample-basic. Then some other also started to work (because I had artifacts cached locally). Then tried to call mvn clean from the root folder of gwt-boot-samples project. It still didn't work for one of subprojects: gwt-boot-sample-basic-with-spring-boot. The problem was like following:

[ERROR]     Non-resolvable parent POM for com.github.gwtboot:gwt-boot-sample-basic-with-spring-boot:1.0.0-SNAPSHOT: Could not find artifact com.github.gwtboot:gwt-boot-starter-parent-with-spring-boot:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 24, column 10 -> [Help 2]

Then I extended pom.xml of this subproject and resolved dependencies successfully.

After this, when I called mvn clean from the root folder, everything worked.

Conclusion. The repositories section of the pom.xml is not inherited as expected by the child pom's. To fix the problem it's enough to extend pom.xml of gwt-boot-sample-basic and gwt-boot-sample-basic-with-spring-boot. I would send a pull-request, but I think that what I did is a workaround only and you may have a better idea...

So let's say now it works ;-) But I guess someone else trying to use gwt-boot-samples would give up earlier. In case of errors would rather have not enough patience to make it working ;-) It should rather work just out of the box...

PS: I think you should be able to reproduce this issue. Just go to your local Maven cache and delete this folder ~/.m2/repository/com/github/gwtboot. Then call mvn clean from gwt-boot-samples. You should be able to see errors.

PS: I think also that it should be documented in https://github.com/gwtboot/gwt-boot-samples/blob/master/README.md that proper <repository> has to be added. A proposal here: https://github.com/gwtboot/gwt-boot-samples/pull/7 .

lofidewanto commented 6 years ago

Thanks a lot, you are right. The example cannot find those modules since the modules are not yet released and not yet in public OSS Nexus.

In Travis is ok maybe because it already add the SNAPSHOTS OSS Nexus directly but local you don't have this, therefore you need to add the OSS Nexus SNAPSHOTS to be able to access the gwtboot-modules.

This is only needed since we are not yet have a release version in OSS Nexus public.

I'll merge your pull request. But we should not add the OSS Nexus SNAPSHOTS in all of the examples, since if we are already releasing the gwtboot-modules in OSS Nexus public we won't need this.

lofidewanto commented 6 years ago

Vegoku already merge it, I added a description why we need it. All done.

baldram commented 6 years ago

Thanks. Please note that until gwtboot-modules are released, the project gwt-boot-samples will not compile for newcomers. My pull request was only about adding additional clarification to the documentation. No pom.xml changes, but according to this, what you mentioned: "we should not add the OSS Nexus SNAPSHOTS in all of the examples, since if we are already releasing the gwtboot-modules in OSS Nexus public", it's fine

lofidewanto commented 6 years ago

Yes, actually I would like to release the first version so that they are available in Maven Central. But domino-ui and some other still need the dependencies to SNAPSHOTS:

https://github.com/gwtboot/gwt-boot-modules/blob/master/pom.xml

We also could just release the first version with all the libs which are already released and wait for the next version for the rest of the libs...

rov63rus commented 4 years ago

I almost gave up but decided to look at closed issues:) I've exact the same setup and issue as baldram.

Is this issue solved?

P.S.: I came here from gradle world. I just wanted to see if maven samples would work out of the box.

baldram commented 4 years ago

@rov63rus I think it worked in the way I described later in here (the later comment in this thread): https://github.com/gwtboot/gwt-boot-samples/issues/6#issuecomment-415976139

lofidewanto commented 4 years ago

@rov63rus: This issue is closed. Everything should work properly. BUT: If you are in the enterprise environment without access to Maven SNAPSHOTS you will have a problem, since GWT Boot is not in Maven RELEASES yet, because some projects are still in SNAPSHOTS...

lofidewanto commented 3 years ago

FYI: Today I released the version 1.0.0 Final in Maven Central.