diff --git a/.gitattributes b/.gitattributes index 225f8f119c..3bb3b5ea8a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,8 @@ -*.jar -text -crlf -*.graffle -text -crlf +# Auto detect text files and perform LF normalization +* text=auto + +*.java text diff=java +*.html text diff=html +*.css text +*.js text +*.sql text diff --git a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/AbstractRepositoryTestCase.java b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/AbstractRepositoryTestCase.java index 2ad80f8147..3b2f379fba 100644 --- a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/AbstractRepositoryTestCase.java +++ b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/AbstractRepositoryTestCase.java @@ -1,76 +1,76 @@ -package org.apache.maven.repository.internal; - -/* - * 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 java.net.MalformedURLException; - -import org.apache.maven.repository.internal.util.ConsoleRepositoryListener; -import org.apache.maven.repository.internal.util.ConsoleTransferListener; -import org.codehaus.plexus.PlexusTestCase; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; - -public abstract class AbstractRepositoryTestCase - extends PlexusTestCase -{ - protected RepositorySystem system; - - protected RepositorySystemSession session; - - @Override - protected void setUp() - throws Exception - { - super.setUp(); - system = lookup( RepositorySystem.class ); - session = newMavenRepositorySystemSession( system ); - } - - @Override - protected void tearDown() - throws Exception - { - session = null; - system = null; - super.tearDown(); - } - - public static RepositorySystemSession newMavenRepositorySystemSession( RepositorySystem system ) - { - MavenRepositorySystemSession session = new MavenRepositorySystemSession( true ); - - LocalRepository localRepo = new LocalRepository( "target/local-repo" ); - session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) ); - - session.setTransferListener( new ConsoleTransferListener() ); - session.setRepositoryListener( new ConsoleRepositoryListener() ); - - return session; - } - - public static RemoteRepository newTestRepository() - throws MalformedURLException - { - return new RemoteRepository( "repo", "default", - getTestFile( "target/test-classes/repo" ).toURI().toURL().toString() ); - } -} +package org.apache.maven.repository.internal; + +/* + * 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 java.net.MalformedURLException; + +import org.apache.maven.repository.internal.util.ConsoleRepositoryListener; +import org.apache.maven.repository.internal.util.ConsoleTransferListener; +import org.codehaus.plexus.PlexusTestCase; +import org.sonatype.aether.RepositorySystem; +import org.sonatype.aether.RepositorySystemSession; +import org.sonatype.aether.repository.LocalRepository; +import org.sonatype.aether.repository.RemoteRepository; + +public abstract class AbstractRepositoryTestCase + extends PlexusTestCase +{ + protected RepositorySystem system; + + protected RepositorySystemSession session; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + system = lookup( RepositorySystem.class ); + session = newMavenRepositorySystemSession( system ); + } + + @Override + protected void tearDown() + throws Exception + { + session = null; + system = null; + super.tearDown(); + } + + public static RepositorySystemSession newMavenRepositorySystemSession( RepositorySystem system ) + { + MavenRepositorySystemSession session = new MavenRepositorySystemSession( true ); + + LocalRepository localRepo = new LocalRepository( "target/local-repo" ); + session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) ); + + session.setTransferListener( new ConsoleTransferListener() ); + session.setRepositoryListener( new ConsoleRepositoryListener() ); + + return session; + } + + public static RemoteRepository newTestRepository() + throws MalformedURLException + { + return new RemoteRepository( "repo", "default", + getTestFile( "target/test-classes/repo" ).toURI().toURL().toString() ); + } +} diff --git a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultVersionResolverTest.java b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultVersionResolverTest.java index 39eaaf6473..1feaef808b 100644 --- a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultVersionResolverTest.java +++ b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultVersionResolverTest.java @@ -1,96 +1,96 @@ -package org.apache.maven.repository.internal; - -/* - * 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.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.VersionResolver; -import org.sonatype.aether.resolution.VersionRequest; -import org.sonatype.aether.resolution.VersionResult; -import org.sonatype.aether.util.artifact.DefaultArtifact; - -public class DefaultVersionResolverTest - extends AbstractRepositoryTestCase -{ - private DefaultVersionResolver versionResolver; - - @Override - protected void setUp() - throws Exception - { - super.setUp(); - // be sure we're testing the right class, i.e. DefaultVersionResolver.class - versionResolver = (DefaultVersionResolver) lookup( VersionResolver.class, "default" ); - } - - @Override - protected void tearDown() - throws Exception - { - versionResolver = null; - super.tearDown(); - } - - public void testResolveSeparateInstalledClassifiedNonUniqueVersionedArtifacts() - throws Exception - { - VersionRequest requestB = new VersionRequest(); - requestB.addRepository( newTestRepository() ); - Artifact artifactB = - new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierB", "jar", "07.20.3-SNAPSHOT" ); - requestB.setArtifact( artifactB ); - - VersionResult resultB = versionResolver.resolveVersion( session, requestB ); - assertEquals( "07.20.3-20120809.112920-97", resultB.getVersion() ); - - VersionRequest requestA = new VersionRequest(); - requestA.addRepository( newTestRepository() ); - - Artifact artifactA = - new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierA", "jar", "07.20.3-SNAPSHOT" ); - requestA.setArtifact( artifactA ); - - VersionResult resultA = versionResolver.resolveVersion( session, requestA ); - assertEquals( "07.20.3-20120809.112124-88", resultA.getVersion() ); - } - - public void testResolveSeparateInstalledClassifiedNonVersionedArtifacts() - throws Exception - { - VersionRequest requestA = new VersionRequest(); - requestA.addRepository( newTestRepository() ); - String versionA = "07.20.3-20120809.112124-88"; - Artifact artifactA = - new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierA", "jar", versionA ); - requestA.setArtifact( artifactA ); - - VersionResult resultA = versionResolver.resolveVersion( session, requestA ); - assertEquals( versionA, resultA.getVersion() ); - - VersionRequest requestB = new VersionRequest(); - requestB.addRepository( newTestRepository() ); - String versionB = "07.20.3-20120809.112920-97"; - Artifact artifactB = - new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierB", "jar", versionB ); - requestB.setArtifact( artifactB ); - - VersionResult resultB = versionResolver.resolveVersion( session, requestB ); - assertEquals( versionB, resultB.getVersion() ); - } -} +package org.apache.maven.repository.internal; + +/* + * 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.sonatype.aether.artifact.Artifact; +import org.sonatype.aether.impl.VersionResolver; +import org.sonatype.aether.resolution.VersionRequest; +import org.sonatype.aether.resolution.VersionResult; +import org.sonatype.aether.util.artifact.DefaultArtifact; + +public class DefaultVersionResolverTest + extends AbstractRepositoryTestCase +{ + private DefaultVersionResolver versionResolver; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + // be sure we're testing the right class, i.e. DefaultVersionResolver.class + versionResolver = (DefaultVersionResolver) lookup( VersionResolver.class, "default" ); + } + + @Override + protected void tearDown() + throws Exception + { + versionResolver = null; + super.tearDown(); + } + + public void testResolveSeparateInstalledClassifiedNonUniqueVersionedArtifacts() + throws Exception + { + VersionRequest requestB = new VersionRequest(); + requestB.addRepository( newTestRepository() ); + Artifact artifactB = + new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierB", "jar", "07.20.3-SNAPSHOT" ); + requestB.setArtifact( artifactB ); + + VersionResult resultB = versionResolver.resolveVersion( session, requestB ); + assertEquals( "07.20.3-20120809.112920-97", resultB.getVersion() ); + + VersionRequest requestA = new VersionRequest(); + requestA.addRepository( newTestRepository() ); + + Artifact artifactA = + new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierA", "jar", "07.20.3-SNAPSHOT" ); + requestA.setArtifact( artifactA ); + + VersionResult resultA = versionResolver.resolveVersion( session, requestA ); + assertEquals( "07.20.3-20120809.112124-88", resultA.getVersion() ); + } + + public void testResolveSeparateInstalledClassifiedNonVersionedArtifacts() + throws Exception + { + VersionRequest requestA = new VersionRequest(); + requestA.addRepository( newTestRepository() ); + String versionA = "07.20.3-20120809.112124-88"; + Artifact artifactA = + new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierA", "jar", versionA ); + requestA.setArtifact( artifactA ); + + VersionResult resultA = versionResolver.resolveVersion( session, requestA ); + assertEquals( versionA, resultA.getVersion() ); + + VersionRequest requestB = new VersionRequest(); + requestB.addRepository( newTestRepository() ); + String versionB = "07.20.3-20120809.112920-97"; + Artifact artifactB = + new DefaultArtifact( "org.apache.maven.its", "dep-mng5324", "classifierB", "jar", versionB ); + requestB.setArtifact( artifactB ); + + VersionResult resultB = versionResolver.resolveVersion( session, requestB ); + assertEquals( versionB, resultB.getVersion() ); + } +} diff --git a/maven-aether-provider/src/test/resources/repo/org/apache/maven/its/dep-mng5324/07.20.3-SNAPSHOT/maven-metadata.xml b/maven-aether-provider/src/test/resources/repo/org/apache/maven/its/dep-mng5324/07.20.3-SNAPSHOT/maven-metadata.xml index db26c6eb30..9f0a7fedd6 100644 --- a/maven-aether-provider/src/test/resources/repo/org/apache/maven/its/dep-mng5324/07.20.3-SNAPSHOT/maven-metadata.xml +++ b/maven-aether-provider/src/test/resources/repo/org/apache/maven/its/dep-mng5324/07.20.3-SNAPSHOT/maven-metadata.xml @@ -1,49 +1,49 @@ - - - - - - org.apache.maven.its - dep-mng5324 - 07.20.3-SNAPSHOT - - - 20120809.112920 - 97 - - 20120809112920 - - - classifierA - jar - 07.20.3-20120809.112124-88 - 20120809112124 - - - classifierB - jar - 07.20.3-20120809.112920-97 - 20120809112920 - - - + + + + + + org.apache.maven.its + dep-mng5324 + 07.20.3-SNAPSHOT + + + 20120809.112920 + 97 + + 20120809112920 + + + classifierA + jar + 07.20.3-20120809.112124-88 + 20120809112124 + + + classifierB + jar + 07.20.3-20120809.112920-97 + 20120809112920 + + + \ No newline at end of file diff --git a/maven-core/src/site/apt/artifact-handlers.apt b/maven-core/src/site/apt/artifact-handlers.apt index 7f211a6ac7..3eea01785f 100644 --- a/maven-core/src/site/apt/artifact-handlers.apt +++ b/maven-core/src/site/apt/artifact-handlers.apt @@ -1,41 +1,41 @@ - --- - Default Artifact Handlers Reference - --- - Hervé Boutemy - --- - 2012-08-13 - --- - -Default Artifact Handlers Reference - - Some artifact handlers are defined by default: - -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -|| type || extension || packaging || classifier || language || added to classpath || includesDependencies || -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | none | | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | java | <<>> | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <<>> | <= type> | | java | <<>> | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <<>> | <= type> | | java | <<>> | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | java | | <<>> | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | java | | <<>> | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | java | | <<>> | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | java | | <<>> | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <= type> | <= type> | | java | | <<>> | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <<>> | <= type> | <<>> | java | | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <<>> | <= type> | <<>> | java | <<>> | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <<>> | <<>> | <<>> | java | <<>> | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ -| <<>> | <<>> | <<>> | <<>> | java | <<>> | | -*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ + --- + Default Artifact Handlers Reference + --- + Hervé Boutemy + --- + 2012-08-13 + --- + +Default Artifact Handlers Reference + + Some artifact handlers are defined by default: + +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +|| type || extension || packaging || classifier || language || added to classpath || includesDependencies || +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | none | | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | java | <<>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <<>> | <= type> | | java | <<>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <<>> | <= type> | | java | <<>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | java | | <<>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | java | | <<>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | java | | <<>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | java | | <<>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <= type> | <= type> | | java | | <<>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <<>> | <= type> | <<>> | java | | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <<>> | <= type> | <<>> | java | <<>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <<>> | <<>> | <<>> | java | <<>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<>> | <<>> | <<>> | <<>> | java | <<>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ diff --git a/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java b/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java index 2edbcf4410..ac02e106d3 100644 --- a/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java +++ b/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java @@ -1,89 +1,89 @@ -package org.apache.maven.artifact.handler; - -/* - * 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 java.io.File; -import java.util.List; - -import org.codehaus.plexus.PlexusTestCase; -import org.codehaus.plexus.util.FileUtils; - -public class ArtifactHandlerTest - extends PlexusTestCase -{ - public void testAptConsistency() - throws Exception - { - File apt = getTestFile( "src/site/apt/artifact-handlers.apt" ); - - @SuppressWarnings( "unchecked" ) - List lines = FileUtils.loadFile( apt ); - - for ( String line : lines ) - { - if ( line.startsWith( "||" ) ) - { - String[] cols = line.split( "\\|\\|" ); - String[] expected = - new String[] { "", "type", "extension", "packaging", "classifier", "language", "added to classpath", - "includesDependencies", "" }; - - int i = 0; - for ( String col : cols ) - { - assertEquals( "Wrong column header", expected[i++], col.trim() ); - } - } - else if ( line.startsWith( "|" ) ) - { - String[] cols = line.split( "\\|" ); - - String type = trimApt( cols[1] ); - String extension = trimApt( cols[2], type ); - String packaging = trimApt( cols[3], type ); - String classifier = trimApt( cols[4] ); - String language = trimApt( cols[5] ); - String addedToClasspath = trimApt( cols[6] ); - String includesDependencies = trimApt( cols[7] ); - - ArtifactHandler handler = lookup( ArtifactHandler.class, type ); - assertEquals( type + " extension", handler.getExtension(), extension ); - assertEquals( type + " packaging", handler.getPackaging(), packaging ); - assertEquals( type + " classifier", handler.getClassifier(), classifier ); - assertEquals( type + " language", handler.getLanguage(), language ); - assertEquals( type + " addedToClasspath", handler.isAddedToClasspath() ? "true" : null, addedToClasspath ); - assertEquals( type + " includesDependencies", handler.isIncludesDependencies() ? "true" : null, includesDependencies ); - } - } - } - - private String trimApt( String content, String type ) - { - String value = trimApt( content ); - return "= type".equals( value ) ? type : value; - } - - private String trimApt( String content ) - { - content = content.replace( '<', ' ' ).replace( '>', ' ' ).trim(); - - return ( content.length() == 0 ) ? null : content; - } -} +package org.apache.maven.artifact.handler; + +/* + * 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 java.io.File; +import java.util.List; + +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.FileUtils; + +public class ArtifactHandlerTest + extends PlexusTestCase +{ + public void testAptConsistency() + throws Exception + { + File apt = getTestFile( "src/site/apt/artifact-handlers.apt" ); + + @SuppressWarnings( "unchecked" ) + List lines = FileUtils.loadFile( apt ); + + for ( String line : lines ) + { + if ( line.startsWith( "||" ) ) + { + String[] cols = line.split( "\\|\\|" ); + String[] expected = + new String[] { "", "type", "extension", "packaging", "classifier", "language", "added to classpath", + "includesDependencies", "" }; + + int i = 0; + for ( String col : cols ) + { + assertEquals( "Wrong column header", expected[i++], col.trim() ); + } + } + else if ( line.startsWith( "|" ) ) + { + String[] cols = line.split( "\\|" ); + + String type = trimApt( cols[1] ); + String extension = trimApt( cols[2], type ); + String packaging = trimApt( cols[3], type ); + String classifier = trimApt( cols[4] ); + String language = trimApt( cols[5] ); + String addedToClasspath = trimApt( cols[6] ); + String includesDependencies = trimApt( cols[7] ); + + ArtifactHandler handler = lookup( ArtifactHandler.class, type ); + assertEquals( type + " extension", handler.getExtension(), extension ); + assertEquals( type + " packaging", handler.getPackaging(), packaging ); + assertEquals( type + " classifier", handler.getClassifier(), classifier ); + assertEquals( type + " language", handler.getLanguage(), language ); + assertEquals( type + " addedToClasspath", handler.isAddedToClasspath() ? "true" : null, addedToClasspath ); + assertEquals( type + " includesDependencies", handler.isIncludesDependencies() ? "true" : null, includesDependencies ); + } + } + } + + private String trimApt( String content, String type ) + { + String value = trimApt( content ); + return "= type".equals( value ) ? type : value; + } + + private String trimApt( String content ) + { + content = content.replace( '<', ' ' ).replace( '>', ' ' ).trim(); + + return ( content.length() == 0 ) ? null : content; + } +} diff --git a/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java b/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java index aa81f4642e..9727bdf8a2 100644 --- a/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java +++ b/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java @@ -1,60 +1,60 @@ -package org.apache.maven.exception; - -/* - * 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 java.io.IOException; -import java.net.ConnectException; - -import org.apache.maven.plugin.MojoExecutionException; - -import junit.framework.TestCase; - -/** - * @author Barrie Treloar - */ -public class DefaultExceptionHandlerTest - extends TestCase -{ - /** - * Running Maven under JDK7 may cause connection issues because IPv6 is used by default. - *

- * e.g running mvn site:run will cause Jetty to fail. - *

- *

- * The resolution is to add -Djava.net.preferIPv4Stack=true to the command line as documented in - * http://cwiki.apache.org/confluence/display/MAVEN/ConnectException - *

- */ - public void testJdk7ipv6() - { - ConnectException connEx = new ConnectException( "Connection refused: connect" ); - IOException ioEx = new IOException( "Unable to establish loopback connection" ); - ioEx.initCause( connEx ); - MojoExecutionException mojoEx = - new MojoExecutionException( "Error executing Jetty: Unable to establish loopback connection", ioEx ); - - ExceptionHandler exceptionHandler = new DefaultExceptionHandler(); - ExceptionSummary exceptionSummary = exceptionHandler.handleException( mojoEx ); - - String expectedReference = "http://cwiki.apache.org/confluence/display/MAVEN/ConnectException"; - assertEquals( expectedReference, exceptionSummary.getReference() ); - - } -} +package org.apache.maven.exception; + +/* + * 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 java.io.IOException; +import java.net.ConnectException; + +import org.apache.maven.plugin.MojoExecutionException; + +import junit.framework.TestCase; + +/** + * @author Barrie Treloar + */ +public class DefaultExceptionHandlerTest + extends TestCase +{ + /** + * Running Maven under JDK7 may cause connection issues because IPv6 is used by default. + *

+ * e.g running mvn site:run will cause Jetty to fail. + *

+ *

+ * The resolution is to add -Djava.net.preferIPv4Stack=true to the command line as documented in + * http://cwiki.apache.org/confluence/display/MAVEN/ConnectException + *

+ */ + public void testJdk7ipv6() + { + ConnectException connEx = new ConnectException( "Connection refused: connect" ); + IOException ioEx = new IOException( "Unable to establish loopback connection" ); + ioEx.initCause( connEx ); + MojoExecutionException mojoEx = + new MojoExecutionException( "Error executing Jetty: Unable to establish loopback connection", ioEx ); + + ExceptionHandler exceptionHandler = new DefaultExceptionHandler(); + ExceptionSummary exceptionSummary = exceptionHandler.handleException( mojoEx ); + + String expectedReference = "http://cwiki.apache.org/confluence/display/MAVEN/ConnectException"; + assertEquals( expectedReference, exceptionSummary.getReference() ); + + } +} diff --git a/pom.xml b/pom.xml index 68dec80e94..1beec5161e 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 1.16 3.0.10 2.3.0 - 2.3 + 2.4-SNAPSHOT 1.3 1.7 1.6 diff --git a/src/site/site.xml b/src/site/site.xml index fb96718f68..6954e93cde 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,74 +1,74 @@ - - - - - - - - ${project.name} - http://maven.apache.org/images/apache-maven-project.png - http://maven.apache.org/ - - - http://maven.apache.org/images/maventxt_logo_200.gif - - - - org.apache.maven.skins - maven-fluido-skin - 1.2.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + ${project.name} + http://maven.apache.org/images/apache-maven-project.png + http://maven.apache.org/ + + + http://maven.apache.org/images/maventxt_logo_200.gif + + + + org.apache.maven.skins + maven-fluido-skin + 1.2.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file