-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 PeterAU2 wrote: > I'm building the 'Very simple Session EJB' example from > http://cwiki.apache.org/GMOxDOC20/very-simple-session-ejb-example.html > The POM is below.
See my in-line responses below. HTH, Greg > I'm running a training course at a client's premises. The training room > machines don't have an Internet connection.The only way I can get things > onto the (Windows) machines is taking it with me on a CD. I like this article http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html because it is one of my Maven critical mass articles. Besides having graphics that visualize the pom, it talks about the dependency management. "Beyond simply setting values to inherit, parents also have the power to create default configurations for their children without actually imposing values upon them. Dependency management is an especially powerful instrument for configuring a set of dependencies through a common location (a POM's parent). The dependencyManagement element syntax is similar to that of the dependency section. What it does, however, is allow children to inherit dependency settings, but not the dependency itself. Adding a dependency with the dependencyManagement element does not actually add the dependency to the POM, nor does it add a dependency to the children; it creates a default configuration for any dependency that a child may choose to add within its own dependency section. Settings by dependencyManagement also apply to the current POM's dependency configuration (although configurations overridden inside the dependency element always take precedence). So do this: 1.) Create a simple pom project i.e. make the packaging pom. 2.) Add all the dependency projects that you will need to the dependencyManagement section of your pom. 3.) Go to a network aware work station and use mvn package or mvn compile I have noticed that Maven will load all those dependencies in a local repository because I declared the dependency in my pom project. For example, I added the wagon provider jars in a parent pom at work and all of those jars came down to my local repository. 4.) Maven will add all those packages to your local repository. 5.) Look at the .m2 repository location on this network aware work station. You will find thin in our settings.xml file. MS Windows puts this in a nasty path under My Documents as the logon user. I am doing this from memory so I do recall what it is. 6.) Use Nero to burn that directory to a cd or use a thumb drive with drag and drop. 7.) Go to each of your training machines and drop that directory in the same place for each training user id. If you have two users that login on the same machine, then each need a copy. (There are alternatives but this may be the simplest for the amount of time you have to prepare.) 8.) Make adjustments to this procedure until you have all the stuff in your local repository. I believe that running through the final sample application with a mvn compile or mvn deploy on a network work station, then you will have all that you need for the class. 9.) Ohh..You'll need to use Wendy's note on the --offline during class compilation. > This example is one of them, but there will be others as well. > The alternative is to convert the pom file into a standard ant build.xml > file, and then I can use ant. I'm looking into the ant:ant that you > mentioned. > At the moment, neither mvn clean install site nor mvn ant:ant are working at > all. > > Problem with mvn clean site install -------------------------- > > I have also posted this to > http://www.nabble.com/Building-sample-project---maven-error-tf4729095s134.html > as I don't know whether it's a maven problem or a samples problem. > > I'm trying to build the simple project from > http://cwiki.apache.org/GMOxDOC20/very-simple-session-ejb-example.html > > I've downloaded the file > http://cwiki.apache.org/GMOxDOC20/very-simple-session-ejb-example.data/mytime_.zip > and unzipped it. > > I've installed Maven 2.0, and can check it with mvn -version > Maven version: 2.0.7 > Java version: 1.5.0_04 > OS name: "windows xp" version: "5.1" arch: "x86" Looks ok. > > When I try to build the source, using mvn clean install site > I get a raft of errors, starting with: > > [INFO] Scanning for projects... > Downloading: > http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/samples/samples/2.0-SNAPSHOT/samples-2.0-SNAPSHOT.pom I walked down the path in a web browser. If you look here http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/samples/samples/2.0-SNAPSHOT/ you'll see that the file names have changed. Perhaps http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/samples/samples/2.0-SNAPSHOT/samples-2.0-20070626.185118-2.pom is what you need to use. Note that there is also a 2.1 version. I recommend that you find the right version and file a bug/RFE/patch to have the files updated. > [INFO] > ------------------------------------------------------------------------ > [ERROR] FATAL ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to resolve artifact. > > GroupId: org.apache.geronimo.samples > ArtifactId: samples > Version: 2.0-SNAPSHOT > > Reason: Unable to download the artifact from any repository > > org.apache.geronimo.samples:samples:pom:2.0-SNAPSHOT > > from the specified remote repositories: > central (http://repo1.maven.org/maven2), > apache-snapshots (http://people.apache.org/repo/m2-snapshot-repository) > > > [INFO] > ------------------------------------------------------------------------ > [INFO] Trace > org.apache.maven.reactor.MavenExecutionException: Cannot find parent: > org.apache.geronimo.samples:samples for project: > null:calculator-stateless-pojo:pom:null f > or project null:calculator-stateless-pojo:pom:null You may need to fix the first issue above. When I saw "Cannot find parent", I see this code below > <relativePath>../pom.xml</relativePath> Do you have the > <parent> > <groupId>org.apache.geronimo.samples</groupId> > <artifactId>samples</artifactId> > <version>2.0-SNAPSHOT</version> > <relativePath>../pom.xml</relativePath> > </parent> org.apache.geronimo.samples in the right place on the file system? Once again, this article may be your friend to get going http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html . > > > If I try just browsing to the URL: > http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/samples/samples/2.0-SNAPSHOT/samples-2.0-SNAPSHOT.pom > I get a 404. > > > > > Problem with mvn ant:ant -------------------------- > When I run mvn ant:ant on the below pom, I get the same error as if I try > mvn clean site install. > > > > pom.xml ---------------------- > <?xml version="1.0" encoding="UTF-8"?> > <!-- > Licensed to the Apache Software Foundation (ASF) under one > or more contributor license agreements. See the NOTICE file > distributed with this work for additional information > regarding copyright ownership. The ASF licenses this file > to you under the Apache License, Version 2.0 (the > "License"); you may not use this file except in compliance > with the License. You may obtain a copy of the License at > > http://www.apache.org/licenses/LICENSE-2.0 > > Unless required by applicable law or agreed to in writing, > software distributed under the License is distributed on an > "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY > KIND, either express or implied. See the License for the > specific language governing permissions and limitations > under the License. > --> > > <!-- $Rev: 550875 $ $Date: 2007-06-26 13:40:09 -0400 (Tue, 26 Jun 2007) $ > --> > > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > > <modelVersion>4.0.0</modelVersion> > > <parent> > <groupId>org.apache.geronimo.samples</groupId> > <artifactId>samples</artifactId> > <version>2.0-SNAPSHOT</version> > <relativePath>../pom.xml</relativePath> > </parent> > > <artifactId>mytime</artifactId> > <name>Geronimo Samples :: mytime</name> > <packaging>pom</packaging> > > <description> > Geronimo mytime sample created from an archetype. > </description> > > <modules> > <module>mytime-ejb</module> > <module>mytime-war</module> > <module>mytime-ear</module> > </modules> > > <build> > <plugins> > <plugin> > <artifactId>maven-site-plugin</artifactId> > <inherited>false</inherited> > <configuration> > <outputDirectory>${project.basedir}/docs</outputDirectory> > </configuration> > </plugin> > </plugins> > </build> > > <repositories> > <repository> > <id>apache-snapshots</id> > <name>Apache Snapshots Repository</name> > <url>http://people.apache.org/repo/m2-snapshot-repository</url> > <layout>default</layout> > <snapshots> > <enabled>true</enabled> > <updatePolicy>daily</updatePolicy> > <checksumPolicy>ignore</checksumPolicy> > </snapshots> > <releases> > <enabled>false</enabled> > </releases> > </repository> > </repositories> > > </project> > > ----------------------- > > Wendy Smoak-3 wrote: >> On 10/31/07, PeterAU2 <[EMAIL PROTECTED]> wrote: >>> Simple question that I haven't been able to find an answer in the online >>> doc. >>> Does Maven require an Internet connection in order to run? >>> (The system I'll be trialling it on doesn't have an Internet connection) >> You can use the -o (or --offline) command line switch to tell it you >> are running offline, but you will first have to make sure that all of >> the dependencies you need are in your local repository. >> >> Can you tell us more about the environment? You will need to get all >> of the dependency jars onto the build box somehow... >> >> -- >> Wendy >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFHKXzPxyxe5L6mr7IRAipXAKCbDZq4kn9iUiWYGqUKSRSrURjV8QCghSIe Kzd1zDQOmgkPCWQ+YRln9bY= =YoYA -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
