This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Is 'mvn --offline' mode when loading projects desirable? | ||
---|---|---|---|
Product: | projects | Reporter: | Antonin Nebuzelsky <anebuzelsky> |
Component: | Maven | Assignee: | _ theanuradha <theanuradha> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jcampbell, jglick, pjiricka, theanuradha |
Priority: | P2 | Keywords: | UI |
Version: | 7.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 193021, 195440 | ||
Bug Blocks: | 189727 |
Description
Antonin Nebuzelsky
2010-08-25 11:41:50 UTC
So the issue here is that org.glassfish:pom:8 is unavailable in the local repo. It is not even in the v3 source tree; you would need to check out https://svn.dev.java.net/svn/glassfish-svn/tags/master-pom-8/ to add it locally by 'mvn install', so people would usually simply download it. Maven will refuse to load a project whose parent POM is missing, naturally enough. I'm not sure if NB 6.9 loaded the project in "online" mode, thus forcing the artifact to be downloaded via HTTP when the project was opened. But it did inject "dummy POMs" during artifact resolution (cf. NbArtifact) as placeholders for those which were missing. This logic could easily be recreated (now in NbArtifactFixer), but it is problematic. In this example, the parent POM specifies (among other things) <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> which is a critical piece of configuration for the IDE's source code editor, which would be missed if you loaded the project with a dummy POM. I am inclined to mark the project as incomplete rather than pretend to load it but actually omit this kind of configuration. Clicking "Revalidate" is the currently recommended way to fix the problem; it downloads the parent POM and makes it available for loading within the IDE, as well as for command-line builds. But we can also consider having the IDE attempt an online reload asynchronously after the project is initially loaded with a fatal error like this - triggered either after loading or opening. (Performing a synchronous online reload during project load is I think unacceptable since it could block critical IDE queries, project opening, etc.) An online reload would be the rough equivalent of running "Revalidate" automatically on your behalf, except that it would use the embedded Maven, not forking the external Maven as "Revalidate" does ('mvn validate'). If this works we could consider removing the "Revalidate" fix (bug #189727) since it would not be likely to fix any additional problems; it could still be useful for demonstrating to the user that a problem in your POM is real (as far as command-line Maven is concerned), not just an IDE bug. There might be obscure circumstances where running CLI Maven would be better for downloading missing artifacts, e.g. if you have a special proxy setup or a repository manager that the embedder does not understand, though you could just press F11 or run any other goal to accomplish this as well. > I am inclined to mark the project as incomplete rather than pretend to... Agreed, I think the 6.9 way had its own problems, and marking the project as incomplete is better. However, currently the project is labeled as "misconfigured", which is misleading, and has a different meaning than "incomplete". Actually, even "incomplete" does not capture the right meaning - how about <partially loaded Maven project> ? > But we can also consider having the IDE attempt an online reload asynchronously > after the project is initially loaded with a fatal error like this +1, good idea. *** Bug 190444 has been marked as a duplicate of this bug. *** core-main #d73f986cfd5c ~ core-main #fdb2b61dd52b (merge problems) (In reply to comment #0) > * checkout glassfish project from > https://svn.dev.java.net/svn/glassfish-svn/trunk/v3 You will probably want to also apply: https://glassfish.dev.java.net/issues/show_bug.cgi?id=13614 *** Bug 190444 has been marked as a duplicate of this bug. *** *** Bug 190444 has been marked as a duplicate of this bug. *** |