Author: sisbell
Date: Sat Jul 19 12:51:06 2008
New Revision: 678209
URL: http://svn.apache.org/viewvc?rev=678209&view=rev
Log:
License headers, javadocs, additional exception handling.
Added:
maven/sandbox/branches/SI_MAVEN_2_1_A/BUILDER.IMPL.txt
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
Added: maven/sandbox/branches/SI_MAVEN_2_1_A/BUILDER.IMPL.txt
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/BUILDER.IMPL.txt?rev=678209&view=auto
==============================================================================
--- maven/sandbox/branches/SI_MAVEN_2_1_A/BUILDER.IMPL.txt (added)
+++ maven/sandbox/branches/SI_MAVEN_2_1_A/BUILDER.IMPL.txt Sat Jul 19 12:51:06
2008
@@ -0,0 +1,83 @@
+Tested Build on Linux FC-5:
+
+Failed IT Tests from trunk:
+Failed tests:
+
testitMNG3341(org.apache.maven.integrationtests.MavenITmng3341MetadataUpdatedFromDeploymentRepositoryTest)
+Tests in error:
+
testitMNG3380(org.apache.maven.integrationtests.MavenITmng3380ManagedRelocatedTransdepsTest)
+
+These two IT tests also fail with new builder code. IT0095 - fails with new
builder code since the behavior of constructing the SCM tag has
+changed to only use artifact id, not module.
+
+maven-embedder EmbedderUsingScmPluginTest fails due to incorrect locale.
+
+----------------------------------------------------
+[INFO] Building Maven Quick Start Archetype
+[INFO]
+[INFO] Id: org.apache.maven:embedder-test-project:jar:1.0-SNAPSHOT
+[INFO] task-segment: [org.apache.maven.plugins:maven-scm-plugin:1.0:diff]
(aggregator-style)
+[INFO] ------------------------------------------------------------------------
+[INFO] [scm:diff]
+[INFO] Executing: svn --non-interactive diff
+[INFO] Working directory:
/home/shane/checkout/SI_MAVEN_2_1_A/maven-embedder/target/scm-plugin-from-embedder
+[ERROR] Provider message:
+[ERROR] The svn command failed.
+[ERROR] Command output:
+[ERROR] svn: error: cannot set LC_ALL locale
+svn: error: environment variable LANG is en_US.UTF-8
+svn: error: please check that your locale name is correct
+
+org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the
plugin manager executing goal
'org.apache.maven.plugins:maven-scm-plugin:1.0:diff': Mojo execution failed.
+ at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:525)
+ at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:285)
+ at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:200)
+ at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:169)
+ at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:223)
+ at
org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:904)
+ at
org.apache.maven.embedder.execution.AbstractEmbedderExecutionTestCase.runWithProject(AbstractEmbedderExecutionTestCase.java:100)
+ at
org.apache.maven.embedder.execution.AbstractEmbedderExecutionTestCase.runWithProject(AbstractEmbedderExecutionTestCase.java:48)
+ at
org.apache.maven.embedder.execution.EmbedderUsingScmPluginTest.testRunningScmPlugin(EmbedderUsingScmPluginTest.java:47)
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
+ at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
+ at java.lang.reflect.Method.invoke(Method.java:597)
+ at junit.framework.TestCase.runTest(TestCase.java:154)
+ at junit.framework.TestCase.runBare(TestCase.java:127)
+ at junit.framework.TestResult$1.protect(TestResult.java:106)
+ at junit.framework.TestResult.runProtected(TestResult.java:124)
+ at junit.framework.TestResult.run(TestResult.java:109)
+ at junit.framework.TestCase.run(TestCase.java:118)
+ at junit.textui.TestRunner.doRun(TestRunner.java:116)
+ at
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
+ at junit.textui.TestRunner.doRun(TestRunner.java:109)
+ at
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
+ at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
+ at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
+ at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
+ at java.lang.reflect.Method.invoke(Method.java:597)
+ at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
+Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution
failed.
+ at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:660)
+ at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:518)
+ ... 29 more
+Caused by: org.apache.maven.plugin.MojoExecutionException: Command failed.The
svn command failed.
+ at
org.apache.maven.scm.plugin.AbstractScmMojo.checkResult(AbstractScmMojo.java:398)
+ at org.apache.maven.scm.plugin.DiffMojo.execute(DiffMojo.java:92)
+ at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:638)
+ ... 30 more
+
+junit.framework.AssertionFailedError: Encountered Exceptions in
MavenExecutionResult during testRunningScmPlugin
+ at
org.apache.maven.embedder.execution.AbstractEmbedderExecutionTestCase.assertNoExceptions(AbstractEmbedderExecutionTestCase.java:123)
+ at
org.apache.maven.embedder.execution.AbstractEmbedderExecutionTestCase.runWithProject(AbstractEmbedderExecutionTestCase.java:102)
+ at
org.apache.maven.embedder.execution.AbstractEmbedderExecutionTestCase.runWithProject(AbstractEmbedderExecutionTestCase.java:48)
+ at
org.apache.maven.embedder.execution.EmbedderUsingScmPluginTest.testRunningScmPlugin(EmbedderUsingScmPluginTest.java:47)
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
+ at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
+ at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
+ at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
+ at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
\ No newline at end of file
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
import org.apache.maven.shared.model.ModelContainer;
import org.apache.maven.shared.model.ModelContainerAction;
import org.apache.maven.shared.model.ModelContainerFactory;
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
import org.apache.maven.shared.model.ModelContainer;
import org.apache.maven.shared.model.ModelContainerAction;
import org.apache.maven.shared.model.ModelContainerFactory;
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -12,22 +31,40 @@
public class PomArtifactResolver {
+ /**
+ * Local repository used in resolving artifacts
+ */
private ArtifactRepository localRepository;
+ /**
+ * Remote repositories used in resolving artifacts
+ */
private List<ArtifactRepository> remoteRepositories;
+ /**
+ * Artifact resolver used to resolve artifacts
+ */
private ArtifactResolver resolver;
- public PomArtifactResolver(ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories, ArtifactResolver resolver) {
+ /**
+ * Constructor
+ *
+ * @param localRepository local repository used in resolving artifacts
+ * @param remoteRepositories remote repositories used in resolving
artifacts
+ * @param resolver artifact resolver used to resolve artifacts
+ */
+ public PomArtifactResolver(ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories,
+ ArtifactResolver resolver) {
this.localRepository = localRepository;
this.remoteRepositories = remoteRepositories;
this.resolver = resolver;
}
/**
- * State change: sets file.
+ * Resolves the specified artifact
*
- * @param artifact
+ * @param artifact the artifact to resolve
+ * @throws IOException if there is a problem resolving the artifact
*/
public void resolve(Artifact artifact) throws IOException {
File artifactFile = new File(localRepository.getBasedir(),
localRepository.pathOf(artifact));
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -15,20 +34,22 @@
/**
* Provides a wrapper for the maven model.
*/
-public final class
- PomClassicDomainModel implements InputStreamDomainModel {
+public final class PomClassicDomainModel implements InputStreamDomainModel {
private byte[] inputBytes;
private String eventHistory;
+ /**
+ * Maven model
+ */
private Model model;
-
/**
* Constructor
*
* @param model maven model
+ * @throws IOException if there is a problem constructing the model
*/
public PomClassicDomainModel(Model model) throws IOException {
if (model == null) {
@@ -42,6 +63,12 @@
inputBytes = baos.toByteArray();
}
+ /**
+ * Constructor
+ *
+ * @param inputStream input stream of the maven model
+ * @throws IOException if there is a problem constructing the model
+ */
public PomClassicDomainModel(InputStream inputStream) throws IOException {
if (inputStream == null) {
throw new IllegalArgumentException("inputStream: null");
@@ -49,12 +76,25 @@
this.inputBytes = IOUtil.toByteArray(inputStream);
}
+
+ /**
+ * Returns true if groupId.equals(a.groupId) &&
artifactId.equals(a.artifactId) && version.equals(a.version),
+ * otherwise returns false.
+ *
+ * @param a model to compare
+ * @return true if groupId.equals(a.groupId) &&
artifactId.equals(a.artifactId) && version.equals(a.version),
+ * otherwise returns false.
+ */
public boolean matchesModel(Model a) {
- Model model;
- try {
- model = getModel();
- } catch (IOException e) {
- return false;
+ if(a == null) {
+ throw new IllegalArgumentException("a: null");
+ }
+ if(model == null) {
+ try {
+ model = getModel();
+ } catch (IOException e) {
+ return false;
+ }
}
String groupId = (model.getGroupId() == null) ?
model.getParent().getGroupId() : model.getGroupId();
@@ -68,12 +108,17 @@
return groupId.equals(aGroupId) && artifactId.equals(aArtifactId) &&
version.equals(aVersion);
}
+
public boolean matchesParent(Parent parent) {
- Model model;
- try {
- model = getModel();
- } catch (IOException e) {
- return false;
+ if(parent == null) {
+ throw new IllegalArgumentException("parent: null");
+ }
+ if(model == null) {
+ try {
+ model = getModel();
+ } catch (IOException e) {
+ return false;
+ }
}
String groupId = (model.getGroupId() == null) ?
model.getParent().getGroupId() : model.getGroupId();
@@ -84,6 +129,11 @@
&& parent.getVersion().equals(version));
}
+ /**
+ * Returns XML model as string
+ *
+ * @return XML model as string
+ */
public String asString() {
try
{
@@ -114,32 +164,40 @@
}
}
+ /**
+ * @see
org.apache.maven.shared.model.InputStreamDomainModel#getInputStream()
+ */
public InputStream getInputStream() {
byte[] copy = new byte[inputBytes.length];
System.arraycopy(inputBytes, 0, copy, 0, inputBytes.length);
return new ByteArrayInputStream(copy);
}
+ /**
+ * @see org.apache.maven.shared.model.DomainModel#getEventHistory()
+ */
public String getEventHistory() {
return eventHistory;
}
+ /**
+ * @see org.apache.maven.shared.model.DomainModel#setEventHistory(String)
+ */
public void setEventHistory(String eventHistory) {
if(eventHistory == null) {
throw new IllegalArgumentException("eventHistory: null");
}
- //System.out.println(eventHistory);
this.eventHistory = eventHistory;
}
+ /**
+ * Returns true if this.asString.equals(o.asString()), otherwise false.
+ *
+ * @param o domain model
+ * @return true if this.asString.equals(o.asString()), otherwise false.
+ */
public boolean equals(Object o) {
return o instanceof PomClassicDomainModel &&
this.asString().equals(((PomClassicDomainModel) o).asString());
}
- //TODO: Workaround
- private byte[] removeIllegalCharacters(byte[] bytes) {
- // what is it supposed to do? which are the illegal characters to
remove?
- // for encoding support, new String(bytes) and String.getBytes()
should not be used
- return new String(bytes).replaceAll("ø",
"").replaceAll("&(?![a-zA-Z]{1,8};)", "&").getBytes();
- }
}
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.shared.model.*;
import org.apache.maven.shared.model.impl.DefaultModelDataSource;
@@ -14,12 +33,14 @@
*/
public final class PomClassicTransformer implements ModelTransformer {
- private Set<String> uris;
-
- public String getBaseUri() {
- return ProjectUri.baseUri;
- }
-
+ /**
+ * The URIs this tranformer supports
+ */
+ private final Set<String> uris;
+
+ /**
+ * Default constructor
+ */
public PomClassicTransformer() {
this.uris = new HashSet<String>(Arrays.asList(
ProjectUri.Build.Extensions.xUri,
@@ -81,6 +102,9 @@
));
}
+ /**
+ * @see ModelTransformer#transformToDomainModel(java.util.List)
+ */
public DomainModel transformToDomainModel(List<ModelProperty> properties)
throws IOException {
if (properties == null) {
throw new IllegalArgumentException("properties: null");
@@ -104,6 +128,9 @@
}
}
+ /**
+ * @see ModelTransformer#transformToModelProperties(java.util.List)
+ */
public List<ModelProperty> transformToModelProperties(List<DomainModel>
domainModels) throws IOException {
if (domainModels == null || domainModels.isEmpty()) {
throw new IllegalArgumentException("domainModels: null or empty");
@@ -301,6 +328,22 @@
return modelProperties;
}
+ /**
+ * Returns the base uri of all model properties:
http://apache.org/maven/project/
+ *
+ * @return Returns the base uri of all model properties:
http://apache.org/maven/project/
+ */
+ public String getBaseUri() {
+ return ProjectUri.baseUri;
+ }
+
+ /**
+ * Returns all model properties containing the specified uri from the
specified properties list.
+ *
+ * @param uri the uri to use in finding the returned model properties
+ * @param properties the model properties list to search
+ * @return all model properties containing the specified uri from the
specified properties list
+ */
private static List<ModelProperty> getPropertiesFor(String uri,
List<ModelProperty> properties) {
List<ModelProperty> modelProperties = new ArrayList<ModelProperty>();
for (ModelProperty mp : properties) {
@@ -311,6 +354,14 @@
return modelProperties;
}
+
+ /**
+ * Returns the first model property containing the specified uri from the
specified properties list.
+ *
+ * @param uri the uri to use in finding the returned model property
+ * @param properties the model properties list to search
+ * @return the first model property containing the specified uri from the
specified properties list.
+ */
private static ModelProperty getPropertyFor(String uri,
List<ModelProperty> properties) {
for (ModelProperty mp : properties) {
if (uri.equals(mp.getUri())) {
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.model.InterpolatorProperty;
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder;
+/*
+ * 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.
+ */
+
/**
* Defines all the unique ids for canonical data model.
*/
Modified:
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java?rev=678209&r1=678208&r2=678209&view=diff
==============================================================================
---
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
(original)
+++
maven/sandbox/branches/SI_MAVEN_2_1_A/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
Sat Jul 19 12:51:06 2008
@@ -1,5 +1,24 @@
package org.apache.maven.project.builder.impl;
+/*
+ * 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.
+ */
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.model.Model;
@@ -186,8 +205,8 @@
}
}
- System.out.println("getDomainModelParentsFromLocalPath: Time = " +
(System.currentTimeMillis() - start) + ", Gid ="
- + model.getGroupId() + ", Artifact Id= " +
model.getArtifactId() + ", Version = " + model.getVersion());
+ // System.out.println("getDomainModelParentsFromLocalPath: Time = " +
(System.currentTimeMillis() - start) + ", Gid ="
+ // + model.getGroupId() + ", Artifact Id= " +
model.getArtifactId() + ", Version = " + model.getVersion());
return domainModels;
}