You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lars Huttar <la...@sil.org> on 2011/07/27 21:16:22 UTC

C3 alpha-3 mvn dependency error: cocoon-optional

Hello,

I have installed Cocoon 3.0 alpha 3, and am trying to follow the 
instructions at
http://cocoon.apache.org/3.0/download.html

Our goal is to set up an environment like we have with Cocoon 2.1.11, 
namely, a single Cocoon instance, running multiple web apps, each 
referenced by a separate URL prefix. (Or they could be called a single 
web app - I don't know that it matters whether you call it one or many 
web apps.)

Following the instructions under "Maven 2 archetypes" (we're actually 
running maven 3, but hopefully that doesn't matter?), I was able to 
"Create a Cocoon 3 block that contains the samples." That command was 
successful.

But then when I try to "After running the archetype plugin, change to 
the base directory of the new module and enter 'mvn jetty:run'", I get 
an error,
[ERROR] Failed to execute goal on project C3samples: Could not resolve 
dependencies for project org.sil:C3samples:jar:1.0-SNAPSHOT: The 
following artifacts could not be resolved: 
org.apache.cocoon.optional:cocoon-optional:jar:3.0.0-alpha-3-SNAPSHOT, 
com.sun.jersey:jersey-core:jar:1.0.3, 
com.sun.jersey:jersey-server:jar:1.0.3: Could not find artifact 
org.apache.cocoon.optional:cocoon-optional:jar:3.0.0-alpha-3-SNAPSHOT -> 
[Help 1]

Can someone tell me what's going wrong?

I looked at the suggestions at 
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
but nothing seems applicable to our situation.

The full verbose error log from the mvn run that fails is available at
http://s3.amazonaws.com/larsUSbucket1/mvnerrors.log

Thanks for any suggestions...

Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C3 alpha-3 mvn dependency error: cocoon-optional

Posted by Lars Huttar <la...@sil.org>.
Francesco, thanks for your helpful replies.
More below...

On 7/28/2011 2:20 AM, Francesco Chicchiriccò wrote:
> This problem - wrong version for cocoon-optional in 
> cocoon-archetype-sample pom.xml - has already been fixed in version 
> beta-1-SNAPSHOT. Thanks anyway for reporting - and good fix ;-)

I had tried building the beta-1 snapshot, and ran into errors there. And 
since the online instructions didn't cover the beta-1 snapshot, I 
decided to go with the alpha for now.

But I guess my next step is to try the beta-1 snapshot instead, and ask 
for help with those errors (if different from the jersey dependency errors).

>> A similar question goes for the empty cocoon block, and the samples 
>> block. I guess the empty cocoon block is a dependency for the webapp, 
>> but what about the others? Do I need to add them as dependencies too?
>
> The logic behind the four available archetypes is very close to Cocoon 
> 2.2 approach [1]: the typical scenario is when you have a single 
> webapp, and one or more blocks implementing features. In order to 
> group all these modules together, you need what you are calling 
> "Super-POM" i.e.a multi-module Maven project. About this, there is an 
> archetype for every kind of project: block, webapp and parent.

Thank you, this is helpful. It would be helpful to have a link to [1] in 
the "Maven 2 archetypes" section of 
http://cocoon.apache.org/3.0/download.html. I guess this is also going 
to be put into the Cocoon 3 docs around 
http://cocoon.apache.org/3.0/reference/html-single/index.html#webapps.system-setup 
or something.

Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C3 alpha-3 mvn dependency error: cocoon-optional

Posted by Francesco Chicchiriccò <il...@apache.org>.
Hi Lars,
nice to see that you are putting your hands on Cocoon 3 :-)

See my comments embedded below.

Regards.

On 27/07/2011 22:56, Lars Huttar wrote:
> On 7/27/2011 3:06 PM, Lars Huttar wrote:
>> Now I'm really in over my head. Searching at 
>> http://search.maven.org/#search|ga|1|a%3A%22jersey%22
>> the only artifact there named "jersey" is from group 
>> com.cedarsoft.rest, which also has an artifact named "server". Could 
>> the project have split "jersey-server" into two parts, and changed to 
>> a completely different groupId?? There are no search results for an 
>> artifact named "jersey-server".
>
> OK, now I've made it work.
> Besides removing "-SNAPSHOT" from the <version> of the cocoon-optional 
> <dependency> in the generated pom.xml,

This problem - wrong version for cocoon-optional in 
cocoon-archetype-sample pom.xml - has already been fixed in version 
beta-1-SNAPSHOT. Thanks anyway for reporting - and good fix ;-)

> I followed the advice of 
> http://jersey.java.net/nonav/documentation/latest/user-guide.html#chapter_deps:
>
> "And the following repositories need to be added to the pom:
>
> <repositories>
> <repository>
> <id>maven2-repository.java.net</id>
> <name>Java.net Repository for Maven</name>
> <url>http://download.java.net/maven/2/</url>
> <layout>default</layout>
> </repository>
> <repository>
> <id>maven-repository.java.net</id>
> <name>Java.net Maven 1 Repository (legacy)</name>
> <url>http://download.java.net/maven/1</url>
> <layout>legacy</layout>
> </repository>
> </repositories>
> "
>
> I added those to the generated pom.xml.

Actually, this is a bit too much: you only need to add

<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>

before </project>, at the end of pom.xml.

I've just fixed this in the trunk, thanks again for reporting.

> Now jetty runs... hooray!
> (Although there are still several warnings about logger.)
>
> The instructions at
> http://cocoon.apache.org/3.0/download.html
> are also incorrect in that they say "point your browser at 
> http://localhost:8080" - For me at least, the port is 8888, and I'm 
> pretty sure I didn't do anything special to configure that.

I've fixed this in the documentation for beta-1-SNAPSHOT, thanks: this 
means that you will see the fix online at next release.

I don't have permissions to modify 
/x1/www/cocoon.apache.org/3.0/download.html on minotaur.apache.org, so I 
am not able to fix the online version: is there anyone who can do this 
quick fix?

> Question: was I right to add those repositories to my generated 
> pom.xml? If so, I'll have to add them to the pom.xml of each of the 
> other artifacts I generate: archetype-block, archetype-webapp, 
> archetype-parent? Should I instead add them to the Super-POM that I 
> read about, and if so, where is that?
>
> Then once I've created all these artifacts, where do I develop my code 
> -- under the webapp artifact?
>
> What is the purpose of the parent module that I'm told to create? Does 
> it even affect the webapp?
> A similar question goes for the empty cocoon block, and the samples 
> block. I guess the empty cocoon block is a dependency for the webapp, 
> but what about the others? Do I need to add them as dependencies too?

The logic behind the four available archetypes is very close to Cocoon 
2.2 approach [1]: the typical scenario is when you have a single webapp, 
and one or more blocks implementing features. In order to group all 
these modules together, you need what you are calling "Super-POM" i.e.a 
multi-module Maven project. About this, there is an archetype for every 
kind of project: block, webapp and parent.

> Sorry to lob so many questions, but I am doing my best to get oriented 
> to how Cocoon and its dependencies work, so that I will be able to use 
> it effectively and contribute to development where needed.
>
> I will try to blog what I learn (or contribute to Cocoon 3 docs) so 
> that others will have an easier time learning the system.

Try-outs, tests, questions and blog posts are very very welcome :-)

[1] http://cocoon.apache.org/2.2/1159_1_1.html

-- 
Francesco Chicchiriccò

Apache Cocoon Committer and PMC Member
http://people.apache.org/~ilgrosso/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C3 alpha-3 mvn dependency error: cocoon-optional

Posted by Lars Huttar <la...@sil.org>.
On 7/27/2011 3:06 PM, Lars Huttar wrote:
>
> Now I'm really in over my head. Searching at 
> http://search.maven.org/#search|ga|1|a%3A%22jersey%22
> the only artifact there named "jersey" is from group 
> com.cedarsoft.rest, which also has an artifact named "server". Could 
> the project have split "jersey-server" into two parts, and changed to 
> a completely different groupId?? There are no search results for an 
> artifact named "jersey-server".
>
> Help...
> Lars
>

OK, now I've made it work.
Besides removing "-SNAPSHOT" from the <version> of the cocoon-optional 
<dependency> in the generated pom.xml, I followed the advice of 
http://jersey.java.net/nonav/documentation/latest/user-guide.html#chapter_deps:

"And the following repositories need to be added to the pom:

<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>maven-repository.java.net</id>
<name>Java.net Maven 1 Repository (legacy)</name>
<url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</repository>
</repositories>
"

I added those to the generated pom.xml.

Now jetty runs... hooray!
(Although there are still several warnings about logger.)

The instructions at
http://cocoon.apache.org/3.0/download.html
are also incorrect in that they say "point your browser at 
http://localhost:8080" - For me at least, the port is 8888, and I'm 
pretty sure I didn't do anything special to configure that.

Question: was I right to add those repositories to my generated pom.xml? 
If so, I'll have to add them to the pom.xml of each of the other 
artifacts I generate: archetype-block, archetype-webapp, 
archetype-parent? Should I instead add them to the Super-POM that I read 
about, and if so, where is that?

Then once I've created all these artifacts, where do I develop my code 
-- under the webapp artifact?

What is the purpose of the parent module that I'm told to create? Does 
it even affect the webapp?
A similar question goes for the empty cocoon block, and the samples 
block. I guess the empty cocoon block is a dependency for the webapp, 
but what about the others? Do I need to add them as dependencies too?

Sorry to lob so many questions, but I am doing my best to get oriented 
to how Cocoon and its dependencies work, so that I will be able to use 
it effectively and contribute to development where needed.

I will try to blog what I learn (or contribute to Cocoon 3 docs) so that 
others will have an easier time learning the system.

Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C3 alpha-3 mvn dependency error: cocoon-optional

Posted by Lars Huttar <la...@sil.org>.
On 7/27/2011 2:16 PM, Lars Huttar wrote:
>
> But then when I try to "After running the archetype plugin, change to 
> the base directory of the new module and enter 'mvn jetty:run'", I get 
> an error,
> [ERROR] Failed to execute goal on project C3samples: Could not resolve 
> dependencies for project org.sil:C3samples:jar:1.0-SNAPSHOT: The 
> following artifacts could not be resolved: 
> org.apache.cocoon.optional:cocoon-optional:jar:3.0.0-alpha-3-SNAPSHOT, 
> com.sun.jersey:jersey-core:jar:1.0.3, 
> com.sun.jersey:jersey-server:jar:1.0.3: Could not find artifact 
> org.apache.cocoon.optional:cocoon-optional:jar:3.0.0-alpha-3-SNAPSHOT 
> -> [Help 1]
>
> Can someone tell me what's going wrong?
>

OK, I see in the pom this dependency configuration for cocoon-optional:

<dependency>
<groupId>org.apache.cocoon.optional</groupId>
<artifactId>cocoon-optional</artifactId>
<version>3.0.0-alpha-3-SNAPSHOT</version>
</dependency>

I notice that this is the only Cocoon artifact in pom whose version ends 
with -SNAPSHOT.

Is this a mistake, that I can fix by just modifying pom.xml and removing 
-SNAPSHOT from the <version>?

I tried that, and reran mvn jetty:run, with the following result:

[ERROR] Failed to execute goal on project C3samples: Could not resolve 
dependencies for project org.sil:C3samples:jar:1.0-SNAPSHOT: The 
following artifacts could not be resolved: 
com.sun.jersey:jersey-core:jar:1.0.3, 
com.sun.jersey:jersey-server:jar:1.0.3: Failure to find 
com.sun.jersey:jersey-core:jar:1.0.3 in http://repo1.maven.org/maven2 
was cached in the local repository, resolution will not be reattempted 
until the update interval of central has elapsed or updates are forced 
-> [Help 1]

Now I'm really in over my head. Searching at 
http://search.maven.org/#search|ga|1|a%3A%22jersey%22
the only artifact there named "jersey" is from group com.cedarsoft.rest, 
which also has an artifact named "server". Could the project have split 
"jersey-server" into two parts, and changed to a completely different 
groupId?? There are no search results for an artifact named "jersey-server".

Help...
Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C3 alpha-3 mvn dependency error: cocoon-optional

Posted by Lars Huttar <la...@sil.org>.
On 7/27/2011 2:16 PM, Lars Huttar wrote:
>
> I looked at the suggestions at 
> http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
> but nothing seems applicable to our situation.

Note that I'm new to maven, so I'm trying to learn it in order to be 
able to work effectively with Cocoon 3.

In an effort to make troubleshooting easier and to make sure I haven't 
overlooked something obvious and non-Cocoon-related:

Specifically regarding the troubleshooting suggestions above:

>  1. The POM misses the declaration of the <repository> which hosts the
>     artifact.
>

It's true, my C3samples/pom.xml does not have a <repository> element at 
all. But mvn was able to resolve other dependencies just fine, 
apparently downloading those files from a repository.
There must be a repository defined somewhere.

>  1. The repository you have configured requires authentication and
>     Maven failed to provide the correct credentials to the server. In
>     this case, make sure your ${user.home}/.m2/settings.xml contains a
>     <server> declaration whose <id> matches the <id> of the remote
>     repository to use. See the Maven Settings Reference
>     <http://maven.apache.org/settings.html#Servers> for more details.
>

See above. Mvn was able download some dependencies, so why not 
cocoon-optional? Anyway I don't think authentication is needed for 
downloading Cocoon dependencies!

>  1. The remote repository in question uses SSL and the JVM running
>     Maven does not trust the certificate of the server.
>

Same answer as previous.

>  1. There is a general network problem that prevents Maven from
>     accessing any remote repository, e.g. a missing proxy configuration.
>

Ibid.

>  1. You have configured Maven to perform strict checksum validation
>     and the files to download got corrupted.
>

I haven't explicitly configured Maven to perform strict checksum 
validation. Also if this were the problem, wouldn't I get a message 
about failing checksum validation?

>  1. Maven failed to save the files to your local repository, see
>     LocalRepositoryNotAccessibleException
>     <https://cwiki.apache.org/confluence/display/MAVEN/LocalRepositoryNotAccessibleException>
>     for more details.
>

Again, I think if this were the problem, I would have the same problem 
when mvn was resolving other dependencies, of which it did many 
successfully before mvn jetty:run.

Thanks for any ideas on how to fix this problem.

Lars